Skip to content

Commit

Permalink
Merge pull request #31425 from cescoffier/devui-health
Browse files Browse the repository at this point in the history
Implement the health check card
  • Loading branch information
phillip-kruger authored Feb 28, 2023
2 parents 5816690 + 2f8be96 commit 2600e8f
Showing 1 changed file with 37 additions and 0 deletions.
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;
}

}

0 comments on commit 2600e8f

Please sign in to comment.