Skip to content

Commit 2600e8f

Browse files
Merge pull request #31425 from cescoffier/devui-health
Implement the health check card
2 parents 5816690 + 2f8be96 commit 2600e8f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package io.quarkus.smallrye.health.deployment;
2+
3+
import io.quarkus.deployment.IsDevelopment;
4+
import io.quarkus.deployment.annotations.BuildStep;
5+
import io.quarkus.deployment.annotations.ExecutionTime;
6+
import io.quarkus.deployment.annotations.Record;
7+
import io.quarkus.devui.spi.page.CardPageBuildItem;
8+
import io.quarkus.devui.spi.page.Page;
9+
import io.quarkus.smallrye.health.runtime.SmallRyeHealthRecorder;
10+
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
11+
12+
/**
13+
* This processor is responsible for the dev ui widget.
14+
*/
15+
public class SmallRyeHealthDevUiProcessor {
16+
17+
@BuildStep(onlyIf = IsDevelopment.class)
18+
@Record(ExecutionTime.STATIC_INIT)
19+
CardPageBuildItem create(NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem,
20+
SmallRyeHealthConfig config,
21+
SmallRyeHealthRecorder recorder) {
22+
CardPageBuildItem pageBuildItem = new CardPageBuildItem("Smallrye Health");
23+
24+
pageBuildItem.addPage(Page.externalPageBuilder("Health")
25+
.icon("font-awesome-solid:heart-circle-bolt")
26+
.url(nonApplicationRootPathBuildItem.resolvePath(config.rootPath))
27+
.isJsonContent());
28+
29+
pageBuildItem.addPage(Page.externalPageBuilder("Health UI")
30+
.icon("font-awesome-solid:stethoscope")
31+
.url(nonApplicationRootPathBuildItem.resolvePath(config.ui.rootPath))
32+
.isHtmlContent());
33+
34+
return pageBuildItem;
35+
}
36+
37+
}

0 commit comments

Comments
 (0)