diff --git a/deployment/src/main/java/io/quarkus/jgit/deployment/JGitDevServicesProcessor.java b/deployment/src/main/java/io/quarkus/jgit/deployment/JGitDevServicesProcessor.java index 25b744b..fdf845d 100644 --- a/deployment/src/main/java/io/quarkus/jgit/deployment/JGitDevServicesProcessor.java +++ b/deployment/src/main/java/io/quarkus/jgit/deployment/JGitDevServicesProcessor.java @@ -37,12 +37,11 @@ DevServicesResultBuildItem createContainer(JGitBuildTimeConfig config, closeBuildItem.addCloseTask(closeable::close, true); devService = new RunningDevService(JGitProcessor.FEATURE, gitServer.getContainerId(), closeable, configOverrides); - giteaServiceInfo.produce( - new GiteaDevServiceInfoBuildItem( - gitServer.getHost(), - gitServer.getHttpPort(), - config.devservices().adminUsername(), - config.devservices().adminPassword())); + giteaServiceInfo.produce(new GiteaDevServiceInfoBuildItem( + gitServer.getHost(), + gitServer.getHttpPort(), + config.devservices().adminUsername(), + config.devservices().adminPassword())); return devService.toBuildItem(); } @@ -59,5 +58,4 @@ public boolean getAsBoolean() { return config.devservices().enabled(); } } - } diff --git a/deployment/src/main/java/io/quarkus/jgit/deployment/devui/GiteaDevUIProcessor.java b/deployment/src/main/java/io/quarkus/jgit/deployment/devui/GiteaDevUIProcessor.java new file mode 100644 index 0000000..41dedf3 --- /dev/null +++ b/deployment/src/main/java/io/quarkus/jgit/deployment/devui/GiteaDevUIProcessor.java @@ -0,0 +1,26 @@ +package io.quarkus.jgit.deployment.devui; + +import java.util.Optional; + +import io.quarkus.deployment.IsDevelopment; +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.devui.spi.page.CardPageBuildItem; +import io.quarkus.devui.spi.page.Page; +import io.quarkus.jgit.deployment.GiteaDevServiceInfoBuildItem; + +public class GiteaDevUIProcessor { + + @BuildStep(onlyIf = IsDevelopment.class) + void createCard(Optional info, BuildProducer cardPage) { + info.ifPresent(i -> { + String url = "http://" + i.host() + ":" + i.httpPort(); + CardPageBuildItem card = new CardPageBuildItem(); + card.addPage(Page.externalPageBuilder("Gitea Dashboard") + .doNotEmbed() + .icon("font-awesome-solid:code-branch") + .url(url, url)); + cardPage.produce(card); + }); + } +}