Skip to content

Commit e985b53

Browse files
authored
Fix #148: DevUI Card and Readme (#152)
1 parent 359c563 commit e985b53

File tree

7 files changed

+184
-9
lines changed

7 files changed

+184
-9
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Quarkus - JGit
2-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
4-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1+
<div align="center">
2+
<img src="https://github.com/quarkiverse/quarkus-jgit/blob/main/docs/modules/ROOT/assets/images/quarkus.svg" width="67" height="70" ><img src="https://github.com/quarkiverse/quarkus-jgit/blob/main/docs/modules/ROOT/assets/images/plus-sign.svg" height="70" ><img src="https://github.com/quarkiverse/quarkus-jgit/blob/main/docs/modules/ROOT/assets/images/jgit.svg" height="70" >
3+
4+
# Quarkus JGit
5+
</div>
6+
<br>
57

68
[![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)
9+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
10+
[![Build](https://github.com/quarkiverse/quarkus-jgit/actions/workflows/build.yml/badge.svg)](https://github.com/quarkiverse/quarkus-jgit/actions/workflows/build.yml)
711

812
## Introduction
913

@@ -40,4 +44,4 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc
4044

4145
<!-- ALL-CONTRIBUTORS-LIST:END -->
4246

43-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
47+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

deployment/src/main/java/io/quarkus/jgit/deployment/devui/GiteaDevUIProcessor.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,39 @@
22

33
import java.util.Optional;
44

5+
import org.eclipse.jgit.api.Git;
6+
57
import io.quarkus.deployment.IsDevelopment;
68
import io.quarkus.deployment.annotations.BuildProducer;
79
import io.quarkus.deployment.annotations.BuildStep;
810
import io.quarkus.devui.spi.page.CardPageBuildItem;
11+
import io.quarkus.devui.spi.page.ExternalPageBuilder;
912
import io.quarkus.devui.spi.page.Page;
1013
import io.quarkus.jgit.deployment.GiteaDevServiceInfoBuildItem;
1114

1215
public class GiteaDevUIProcessor {
1316

1417
@BuildStep(onlyIf = IsDevelopment.class)
1518
void createCard(Optional<GiteaDevServiceInfoBuildItem> info, BuildProducer<CardPageBuildItem> cardPage) {
19+
CardPageBuildItem card = new CardPageBuildItem();
20+
1621
info.ifPresent(i -> {
1722
String url = "http://" + i.host() + ":" + i.httpPort();
18-
CardPageBuildItem card = new CardPageBuildItem();
1923
card.addPage(Page.externalPageBuilder("Gitea Dashboard")
2024
.doNotEmbed()
2125
.icon("font-awesome-solid:code-branch")
2226
.url(url, url));
23-
cardPage.produce(card);
2427
});
28+
29+
final ExternalPageBuilder versionPage = Page.externalPageBuilder("JGit Version")
30+
.icon("font-awesome-solid:tag")
31+
.url("https://www.eclipse.org/jgit/")
32+
.doNotEmbed()
33+
.staticLabel(Git.class.getPackage().getImplementationVersion());
34+
35+
card.addPage(versionPage);
36+
37+
card.setCustomCard("qwc-jgit-card.js");
38+
cardPage.produce(card);
2539
}
26-
}
40+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import { LitElement, html, css} from 'lit';
2+
import { pages } from 'build-time-data';
3+
import 'qwc/qwc-extension-link.js';
4+
5+
const NAME = "JGit";
6+
export class QwcJGitCard extends LitElement {
7+
8+
static styles = css`
9+
.identity {
10+
display: flex;
11+
justify-content: flex-start;
12+
}
13+
14+
.description {
15+
padding-bottom: 10px;
16+
}
17+
18+
.logo {
19+
padding-bottom: 10px;
20+
margin-right: 5px;
21+
}
22+
23+
.card-content {
24+
color: var(--lumo-contrast-90pct);
25+
display: flex;
26+
flex-direction: column;
27+
justify-content: flex-start;
28+
padding: 2px 2px;
29+
height: 100%;
30+
}
31+
32+
.card-content slot {
33+
display: flex;
34+
flex-flow: column wrap;
35+
padding-top: 5px;
36+
}
37+
`;
38+
39+
static properties = {
40+
description: {type: String}
41+
};
42+
43+
constructor() {
44+
super();
45+
}
46+
47+
connectedCallback() {
48+
super.connectedCallback();
49+
}
50+
51+
render() {
52+
return html`<div class="card-content" slot="content">
53+
<div class="identity">
54+
<div class="logo">
55+
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5MnB0IiBoZWlnaHQ9IjkycHQiIHZpZXdCb3g9IjAgMCA5MiA5MiI+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBkPSJNMCAuMTEzaDkxLjg4N1Y5MkgwWm0wIDAiLz48L2NsaXBQYXRoPjwvZGVmcz48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIHN0eWxlPSJzdHJva2U6bm9uZTtmaWxsLXJ1bGU6bm9uemVybztmaWxsOiNmMDNjMmU7ZmlsbC1vcGFjaXR5OjEiIGQ9Ik05MC4xNTYgNDEuOTY1IDUwLjAzNiAxLjg0OGE1LjkxOCA1LjkxOCAwIDAgMC04LjM3MiAwbC04LjMyOCA4LjMzMiAxMC41NjYgMTAuNTY2YTcuMDMgNy4wMyAwIDAgMSA3LjIzIDEuNjg0IDcuMDM0IDcuMDM0IDAgMCAxIDEuNjY5IDcuMjc3bDEwLjE4NyAxMC4xODRhNy4wMjggNy4wMjggMCAwIDEgNy4yNzggMS42NzIgNy4wNCA3LjA0IDAgMCAxIDAgOS45NTcgNy4wNSA3LjA1IDAgMCAxLTkuOTY1IDAgNy4wNDQgNy4wNDQgMCAwIDEtMS41MjgtNy42NmwtOS41LTkuNDk3VjU5LjM2YTcuMDQgNy4wNCAwIDAgMSAxLjg2IDExLjI5IDcuMDQgNy4wNCAwIDAgMS05Ljk1NyAwIDcuMDQgNy4wNCAwIDAgMSAwLTkuOTU4IDcuMDYgNy4wNiAwIDAgMSAyLjMwNC0xLjUzOVYzMy45MjZhNy4wNDkgNy4wNDkgMCAwIDEtMy44Mi05LjIzNEwyOS4yNDIgMTQuMjcyIDEuNzMgNDEuNzc3YTUuOTI1IDUuOTI1IDAgMCAwIDAgOC4zNzFMNDEuODUyIDkwLjI3YTUuOTI1IDUuOTI1IDAgMCAwIDguMzcgMGwzOS45MzQtMzkuOTM0YTUuOTI1IDUuOTI1IDAgMCAwIDAtOC4zNzEiLz48L2c+PC9zdmc+"
56+
alt="${NAME}"
57+
title="${NAME}"
58+
width="32"
59+
height="32">
60+
</div>
61+
<div class="description">${this.description}</div>
62+
</div>
63+
${this._renderCardLinks()}
64+
</div>
65+
`;
66+
}
67+
68+
_renderCardLinks(){
69+
return html`${pages.map(page => html`
70+
<qwc-extension-link slot="link"
71+
extensionName="${NAME}"
72+
iconName="${page.icon}"
73+
displayName="${page.title}"
74+
staticLabel="${page.staticLabel}"
75+
dynamicLabel="${page.dynamicLabel}"
76+
streamingLabel="${page.streamingLabel}"
77+
path="${page.id}"
78+
?embed=${page.embed}
79+
externalUrl="${page.metadata.externalUrl}"
80+
webcomponent="${page.componentLink}" >
81+
</qwc-extension-link>
82+
`)}`;
83+
}
84+
85+
}
86+
customElements.define('qwc-jgit-card', QwcJGitCard);
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 66 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

runtime/src/main/resources/META-INF/quarkus-extension.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ metadata:
66
- "git"
77
categories:
88
- "miscellaneous"
9+
config:
10+
- "quarkus.jgit."
911
guide: https://quarkiverse.github.io/quarkiverse-docs/quarkus-jgit/dev/index.html
10-
status: "stable"
12+
icon-url: "https://raw.githubusercontent.com/quarkiverse/quarkus-jgit/main/docs/modules/ROOT/assets/images/jgit.svg"
13+
status: "stable"

0 commit comments

Comments
 (0)