-
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.
- Loading branch information
1 parent
88cfc7d
commit 2f8be96
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...ent/src/main/java/io/quarkus/smallrye/health/deployment/SmallRyeHealthDevUiProcessor.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,37 @@ | ||
package io.quarkus.smallrye.health.deployment; | ||
|
||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.annotations.ExecutionTime; | ||
import io.quarkus.deployment.annotations.Record; | ||
import io.quarkus.devui.spi.page.CardPageBuildItem; | ||
import io.quarkus.devui.spi.page.Page; | ||
import io.quarkus.smallrye.health.runtime.SmallRyeHealthRecorder; | ||
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem; | ||
|
||
/** | ||
* This processor is responsible for the dev ui widget. | ||
*/ | ||
public class SmallRyeHealthDevUiProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
@Record(ExecutionTime.STATIC_INIT) | ||
CardPageBuildItem create(NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem, | ||
SmallRyeHealthConfig config, | ||
SmallRyeHealthRecorder recorder) { | ||
CardPageBuildItem pageBuildItem = new CardPageBuildItem("Smallrye Health"); | ||
|
||
pageBuildItem.addPage(Page.externalPageBuilder("Health") | ||
.icon("font-awesome-solid:heart-circle-bolt") | ||
.url(nonApplicationRootPathBuildItem.resolvePath(config.rootPath)) | ||
.isJsonContent()); | ||
|
||
pageBuildItem.addPage(Page.externalPageBuilder("Health UI") | ||
.icon("font-awesome-solid:stethoscope") | ||
.url(nonApplicationRootPathBuildItem.resolvePath(config.ui.rootPath)) | ||
.isHtmlContent()); | ||
|
||
return pageBuildItem; | ||
} | ||
|
||
} |