web: fix rendering of version
This commit is contained in:
parent
3b7bba5a62
commit
b80b2626a6
|
@ -14,8 +14,4 @@ export class Version {
|
|||
return DefaultClient.fetch<Version>(["admin", "version"]);
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return this.version_current;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ export abstract class AdminStatusCard<T> extends AggregateCard {
|
|||
|
||||
value?: T;
|
||||
|
||||
renderValue(): TemplateResult {
|
||||
return html`${this.value}`;
|
||||
}
|
||||
|
||||
renderInner(): TemplateResult {
|
||||
return html`<p class="center-value">
|
||||
${until(this.getPrimaryValue().then((v) => {
|
||||
|
@ -23,7 +27,7 @@ export abstract class AdminStatusCard<T> extends AggregateCard {
|
|||
return this.getStatus(v);
|
||||
}).then((status) => {
|
||||
return html`<p class="ak-aggregate-card">
|
||||
<i class="${status.icon}"></i> ${this.value}
|
||||
<i class="${status.icon}"></i> ${this.renderValue()}
|
||||
</p>
|
||||
${status.message ? html`<p class="subtext">${status.message}</p>` : html``}`;
|
||||
}), html`<ak-spinner size="${SpinnerSize.Large}"></ak-spinner>`)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { gettext } from "django";
|
||||
import { customElement } from "lit-element";
|
||||
import { customElement, html, TemplateResult } from "lit-element";
|
||||
import { Version } from "../../../api/Versions";
|
||||
import { AdminStatusCard, AdminStatus } from "./AdminStatusCard";
|
||||
|
||||
|
@ -24,4 +24,8 @@ export class VersionStatusCard extends AdminStatusCard<Version> {
|
|||
}
|
||||
}
|
||||
|
||||
renderValue(): TemplateResult {
|
||||
return html`${this.value?.version_current}`;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in New Issue