diff --git a/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/devui/LoggingManagerDevUIProcessor.java b/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/devui/LoggingManagerDevUIProcessor.java index f3a3c5a..5946045 100644 --- a/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/devui/LoggingManagerDevUIProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/devui/LoggingManagerDevUIProcessor.java @@ -6,6 +6,7 @@ import io.quarkiverse.loggingmanager.LogController; import io.quarkiverse.loggingmanager.devui.LoggingManagerJsonRpcService; import io.quarkus.deployment.IsDevelopment; +import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.devui.spi.JsonRPCProvidersBuildItem; import io.quarkus.devui.spi.page.CardPageBuildItem; @@ -15,23 +16,24 @@ public class LoggingManagerDevUIProcessor { private static final String LEVEL = "level"; @BuildStep(onlyIf = IsDevelopment.class) - public CardPageBuildItem pages() { - CardPageBuildItem pageBuildItem = new CardPageBuildItem(); + public void pages(BuildProducer cardPageBuildItemBuildProducer) { + CardPageBuildItem card = new CardPageBuildItem(); - pageBuildItem.addBuildTimeData(LEVEL, LogController.LEVELS + card.addBuildTimeData(LEVEL, LogController.LEVELS .stream().map((level) -> Map.of(LEVEL, level)) .collect(Collectors.toList())); - pageBuildItem.addPage(Page.tableDataPageBuilder("Level") + card.addPage(Page.tableDataPageBuilder("Level") .showColumn(LEVEL) .buildTimeDataKey(LEVEL) .icon("font-awesome-solid:layer-group")); - pageBuildItem.addPage(Page.webComponentPageBuilder() + card.addPage(Page.webComponentPageBuilder() .icon("font-awesome-solid:play") .componentLink("qwc-logging-manager-loggers.js")); - return pageBuildItem; + card.setCustomCard("qwc-logging-manager-card.js"); + cardPageBuildItemBuildProducer.produce(card); } @BuildStep(onlyIf = IsDevelopment.class) diff --git a/deployment/src/main/resources/dev-ui/qwc-logging-manager-card.js b/deployment/src/main/resources/dev-ui/qwc-logging-manager-card.js new file mode 100644 index 0000000..7a466c1 --- /dev/null +++ b/deployment/src/main/resources/dev-ui/qwc-logging-manager-card.js @@ -0,0 +1,86 @@ +import { LitElement, html, css} from 'lit'; +import { pages } from 'build-time-data'; +import 'qwc/qwc-extension-link.js'; + +const NAME = "Logging Manager"; +export class QwcLoggingManagerCard extends LitElement { + + static styles = css` + .identity { + display: flex; + justify-content: flex-start; + } + + .description { + padding-bottom: 10px; + } + + .logo { + padding-bottom: 10px; + margin-right: 5px; + } + + .card-content { + color: var(--lumo-contrast-90pct); + display: flex; + flex-direction: column; + justify-content: flex-start; + padding: 2px 2px; + height: 100%; + } + + .card-content slot { + display: flex; + flex-flow: column wrap; + padding-top: 5px; + } + `; + + static properties = { + description: {type: String} + }; + + constructor() { + super(); + } + + connectedCallback() { + super.connectedCallback(); + } + + render() { + return html`
+
+ +
${this.description}
+
+ ${this._renderCardLinks()} +
+ `; + } + + _renderCardLinks(){ + return html`${pages.map(page => html` + + + `)}`; + } + +} +customElements.define('qwc-logging-manager-card', QwcLoggingManagerCard); \ No newline at end of file