-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #19099 from karesti/fix-dev-mode-without-config
Infinispan Dev UI without Infinispan configuration
- Loading branch information
Showing
4 changed files
with
38 additions
and
26 deletions.
There are no files selected for viewing
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
12 changes: 9 additions & 3 deletions
12
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
<a target="_blank" href="http://{info:remoteCacheManager.configuration.servers.get(0).host}:{info:remoteCacheManager.configuration.servers.get(0).port}" class="badge badge-light"> | ||
{#if info:serverUrl != ""} | ||
<a target="_blank" href="http://{info:serverUrl}" 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"> | ||
{#else} | ||
<span class="badge badge-light"> | ||
<i class="fa fa-exclamation-triangle fa-fw"></i> Configuration is missing</span> | ||
<br> | ||
{/if} | ||
<a target="_blank" href="https://infinispan.org/documentation/" 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> | ||
<i class="fa fa-hand-point-right fa-fw"></i> Code Tutorials</a> | ||
<br> |
20 changes: 0 additions & 20 deletions
20
.../runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientSupplier.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
...ntime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanServerUrlSupplier.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,26 @@ | ||
package io.quarkus.infinispan.client.runtime; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import org.infinispan.client.hotrod.RemoteCacheManager; | ||
import org.infinispan.client.hotrod.configuration.ServerConfiguration; | ||
|
||
import io.quarkus.arc.Arc; | ||
|
||
public class InfinispanServerUrlSupplier implements Supplier<String> { | ||
|
||
@Override | ||
public String get() { | ||
RemoteCacheManager cacheManager = cacheManager(); | ||
if (cacheManager == null || cacheManager.getConfiguration().servers().isEmpty()) { | ||
return ""; | ||
} | ||
ServerConfiguration firstServer = cacheManager.getConfiguration().servers().get(0); | ||
|
||
return firstServer.host() + ":" + firstServer.port(); | ||
} | ||
|
||
public static RemoteCacheManager cacheManager() { | ||
return Arc.container().instance(RemoteCacheManager.class).get(); | ||
} | ||
} |