Skip to content

Commit 382cf44

Browse files
Merge pull request quarkusio#47788 from melloware/info-card-display-name
DevUI Info card allow displayName
2 parents 93fbb8a + 997c1d7 commit 382cf44

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

extensions/info/deployment/src/main/resources/dev-ui/qwc-info.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,15 @@ export class QwcInfo extends LitElement {
191191
externalConstributors.map(key => {
192192
const extInfo = info[key];
193193
const rows = [];
194+
let displayName = key;
194195
for (const property of Object.keys(extInfo)){
195-
rows.push(html`<tr><td class="row-header">${property}</td><td>${extInfo[property]}</td></tr>`);
196+
if (property === 'displayName'){
197+
displayName = extInfo[property];
198+
}else{
199+
rows.push(html`<tr><td class="row-header">${property}</td><td>${extInfo[property]}</td></tr>`);
200+
}
196201
}
197-
cards.push(html`<qui-card header=${key}>
202+
cards.push(html`<qui-card header=${displayName}>
198203
<div class="cardContent" slot="content">
199204
<vaadin-icon icon="font-awesome-solid:circle-info"></vaadin-icon>
200205
<table class="table">

extensions/info/runtime-spi/src/main/java/io/quarkus/info/runtime/spi/InfoContributor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ public interface InfoContributor {
1313
*/
1414
String name();
1515

16+
/**
17+
* The display name of the contributor in the DevUI card will fall back to {@code name()} if not set
18+
*/
19+
default String displayName() {
20+
return name();
21+
}
22+
1623
/**
1724
* Properties to add under {@code name}
1825
*/

extensions/info/runtime/src/main/java/io/quarkus/info/runtime/JavaInfoContributor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public String name() {
1212
return "java";
1313
}
1414

15+
@Override
16+
public String displayName() {
17+
return "Java";
18+
}
19+
1520
@Override
1621
public Map<String, Object> data() {
1722
//TODO: should we add more information like 'java.runtime.*' and 'java.vm.*' ?

extensions/info/runtime/src/main/java/io/quarkus/info/runtime/OsInfoContributor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ public String name() {
1111
return "os";
1212
}
1313

14+
@Override
15+
public String displayName() {
16+
return "Operating System";
17+
}
18+
1419
@Override
1520
public Map<String, Object> data() {
1621
Map<String, Object> result = new LinkedHashMap<>();

0 commit comments

Comments
 (0)