-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18367 from karesti/dev-ui-quarkus
Infinispan extension adds some useful links to the dev ui
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...ava/io/quarkus/infinispan/client/deployment/devconsole/InfinispanDevConsoleProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.infinispan.client.deployment.devconsole; | ||
|
||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem; | ||
import io.quarkus.infinispan.client.runtime.InfinispanClientSupplier; | ||
|
||
public class InfinispanDevConsoleProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
public DevConsoleRuntimeTemplateInfoBuildItem remoteCacheManager() { | ||
return new DevConsoleRuntimeTemplateInfoBuildItem("remoteCacheManager", new InfinispanClientSupplier()); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
extensions/infinispan-client/deployment/src/main/resources/dev-templates/embedded.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<a target="_blank" href="http://{info:remoteCacheManager.getConfiguration().servers().get(0).host()}:{info:remoteCacheManager.getConfiguration().servers().get(0).port()}" class="badge badge-light"> | ||
<i class="fa fa-external-link-alt fa-fw"></i> Web Console</a> | ||
<br> | ||
<a target="_blank" href="http://infinispan.org" class="badge badge-light"> | ||
<i class="fas fa-info fa-fw"></i> Documentation</a> | ||
<br> | ||
<a target="_blank" href="https://github.com/infinispan/infinispan-simple-tutorials" class="badge badge-light"> | ||
<i class="fa fa-hand-point-right fa-fw"></i> Simple Tutorials</a> | ||
<br> |
20 changes: 20 additions & 0 deletions
20
.../runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.infinispan.client.runtime; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import org.infinispan.client.hotrod.RemoteCacheManager; | ||
|
||
import io.quarkus.arc.Arc; | ||
|
||
public class InfinispanClientSupplier implements Supplier<RemoteCacheManager> { | ||
|
||
@Override | ||
public RemoteCacheManager get() { | ||
RemoteCacheManager cacheManager = cacheManager(); | ||
return cacheManager; | ||
} | ||
|
||
public static RemoteCacheManager cacheManager() { | ||
return Arc.container().instance(RemoteCacheManager.class).get(); | ||
} | ||
} |