diff --git a/extensions/info/deployment/src/main/resources/dev-ui/qwc-info.js b/extensions/info/deployment/src/main/resources/dev-ui/qwc-info.js index 3cd1f9e32c2d2..5960477bd1aa8 100644 --- a/extensions/info/deployment/src/main/resources/dev-ui/qwc-info.js +++ b/extensions/info/deployment/src/main/resources/dev-ui/qwc-info.js @@ -1,4 +1,5 @@ import { LitElement, html, css} from 'lit'; +import {unsafeHTML} from 'lit/directives/unsafe-html.js'; import { columnBodyRenderer } from '@vaadin/grid/lit.js'; import { infoUrl } from 'build-time-data'; import '@vaadin/progress-bar'; @@ -22,13 +23,20 @@ export class QwcInfo extends LitElement { } .cardContent { display: flex; - align-items: center; padding: 10px; gap: 10px; + height: 100%; } vaadin-icon { font-size: xx-large; } + .table { + height: fit-content; + } + .row-header { + color: var(--lumo-contrast-50pct); + vertical-align: top; + } `; static properties = { @@ -58,8 +66,8 @@ export class QwcInfo extends LitElement { return html` ${this._renderOsInfo(this._info)} ${this._renderJavaInfo(this._info)} - ${this._renderGitInfo(this._info)} ${this._renderBuildInfo(this._info)} + ${this._renderGitInfo(this._info)} `; }else{ return html` @@ -78,9 +86,9 @@ export class QwcInfo extends LitElement {
${this._renderOsIcon(os.name)} - - - + + +
Name${os.name}
Version${os.version}
Arch${os.arch}
Name${os.name}
Version${os.version}
Arch${os.arch}
`; @@ -94,7 +102,7 @@ export class QwcInfo extends LitElement {
- +
Version${java.version}
Version${java.version}
`; @@ -121,25 +129,45 @@ export class QwcInfo extends LitElement {
- - - + + + + ${this._renderOptionalData(git)}
Branch${git.branch}
Commit${git.commit.id}
Time${git.commit.time}
Branch${git.branch}
Commit Id ${this._renderCommitId(git)}
Commit Time${git.commit.time}
`; } } + _renderCommitId(git){ + if(typeof git.commit.id === "string"){ + return html`${git.commit.id}`; + }else { + return html`${git.commit.id.full}`; + } + } + + _renderOptionalData(git){ + if(typeof git.commit.id !== "string"){ + return html`Commit User${git.commit.user.name} <${git.commit.user.email}> + Commit Message${unsafeHTML(this._replaceNewLine(git.commit.id.message.full))}` + } + } + + _replaceNewLine(line){ + return line.replace(new RegExp('\r?\n','g'), '
'); + } + _renderBuildInfo(info){ if(info.build){ let build = info.build; return html`
- - - - + + + +
Group${build.group}
Artifact${build.artifact}
Version${build.version}
Time${build.time}
Group${build.group}
Artifact${build.artifact}
Version${build.version}
Time${build.time}
`;