From e985b53c07ca73eead05ef8e264ba983312f5b70 Mon Sep 17 00:00:00 2001 From: Melloware Date: Mon, 14 Oct 2024 08:28:57 -0400 Subject: [PATCH] Fix #148: DevUI Card and Readme (#152) --- README.md | 14 +-- .../deployment/devui/GiteaDevUIProcessor.java | 20 ++++- .../main/resources/dev-ui/qwc-jgit-card.js | 86 +++++++++++++++++++ docs/modules/ROOT/assets/images/jgit.svg | 1 + docs/modules/ROOT/assets/images/plus-sign.svg | 66 ++++++++++++++ docs/modules/ROOT/assets/images/quarkus.svg | 1 + .../resources/META-INF/quarkus-extension.yaml | 5 +- 7 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 deployment/src/main/resources/dev-ui/qwc-jgit-card.js create mode 100644 docs/modules/ROOT/assets/images/jgit.svg create mode 100644 docs/modules/ROOT/assets/images/plus-sign.svg create mode 100644 docs/modules/ROOT/assets/images/quarkus.svg diff --git a/README.md b/README.md index 234bc06..a1ad7be 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ -# Quarkus - JGit - -[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-) - +
+ + +# Quarkus JGit +
+
[![Version](https://img.shields.io/maven-central/v/io.quarkiverse.jgit/quarkus-jgit?logo=apache-maven&style=flat-square)](https://search.maven.org/artifact/io.quarkiverse.jgit/quarkus-jgit) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) +[![Build](https://github.com/quarkiverse/quarkus-jgit/actions/workflows/build.yml/badge.svg)](https://github.com/quarkiverse/quarkus-jgit/actions/workflows/build.yml) ## Introduction @@ -40,4 +44,4 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file 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 index 41dedf3..494c9ed 100644 --- a/deployment/src/main/java/io/quarkus/jgit/deployment/devui/GiteaDevUIProcessor.java +++ b/deployment/src/main/java/io/quarkus/jgit/deployment/devui/GiteaDevUIProcessor.java @@ -2,10 +2,13 @@ import java.util.Optional; +import org.eclipse.jgit.api.Git; + 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.ExternalPageBuilder; import io.quarkus.devui.spi.page.Page; import io.quarkus.jgit.deployment.GiteaDevServiceInfoBuildItem; @@ -13,14 +16,25 @@ public class GiteaDevUIProcessor { @BuildStep(onlyIf = IsDevelopment.class) void createCard(Optional info, BuildProducer cardPage) { + CardPageBuildItem card = new CardPageBuildItem(); + 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); }); + + final ExternalPageBuilder versionPage = Page.externalPageBuilder("JGit Version") + .icon("font-awesome-solid:tag") + .url("https://www.eclipse.org/jgit/") + .doNotEmbed() + .staticLabel(Git.class.getPackage().getImplementationVersion()); + + card.addPage(versionPage); + + card.setCustomCard("qwc-jgit-card.js"); + cardPage.produce(card); } -} +} \ No newline at end of file diff --git a/deployment/src/main/resources/dev-ui/qwc-jgit-card.js b/deployment/src/main/resources/dev-ui/qwc-jgit-card.js new file mode 100644 index 0000000..fa0badc --- /dev/null +++ b/deployment/src/main/resources/dev-ui/qwc-jgit-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 = "JGit"; +export class QwcJGitCard 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-jgit-card', QwcJGitCard); \ No newline at end of file diff --git a/docs/modules/ROOT/assets/images/jgit.svg b/docs/modules/ROOT/assets/images/jgit.svg new file mode 100644 index 0000000..5bf444b --- /dev/null +++ b/docs/modules/ROOT/assets/images/jgit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/modules/ROOT/assets/images/plus-sign.svg b/docs/modules/ROOT/assets/images/plus-sign.svg new file mode 100644 index 0000000..ea94fe7 --- /dev/null +++ b/docs/modules/ROOT/assets/images/plus-sign.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/docs/modules/ROOT/assets/images/quarkus.svg b/docs/modules/ROOT/assets/images/quarkus.svg new file mode 100644 index 0000000..1969e1e --- /dev/null +++ b/docs/modules/ROOT/assets/images/quarkus.svg @@ -0,0 +1 @@ +quarkus_icon_rgb_1024px_reverse \ No newline at end of file diff --git a/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 5899774..0362bf3 100644 --- a/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -6,5 +6,8 @@ metadata: - "git" categories: - "miscellaneous" + config: + - "quarkus.jgit." guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-jgit/dev/index.html - status: "stable" + icon-url: "https://raw.githubusercontent.com/quarkiverse/quarkus-jgit/main/docs/modules/ROOT/assets/images/jgit.svg" + status: "stable" \ No newline at end of file