web: re-format with prettier
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -1,4 +1,12 @@
|
||||
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
|
||||
import {
|
||||
css,
|
||||
CSSResult,
|
||||
customElement,
|
||||
html,
|
||||
LitElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
} from "lit-element";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
import PFCard from "@patternfly/patternfly/components/Card/card.css";
|
||||
@ -17,22 +25,24 @@ export class AggregateCard extends LitElement {
|
||||
headerLink?: string;
|
||||
|
||||
static get styles(): CSSResult[] {
|
||||
return [PFBase, PFCard, PFFlex, AKGlobal].concat([css`
|
||||
.pf-c-card.pf-c-card-aggregate {
|
||||
height: 100%;
|
||||
}
|
||||
.pf-c-card__header {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.center-value {
|
||||
font-size: var(--pf-global--icon--FontSize--lg);
|
||||
text-align: center;
|
||||
color: var(--pf-global--Color--100);
|
||||
}
|
||||
.subtext {
|
||||
font-size: var(--pf-global--FontSize--sm);
|
||||
}
|
||||
`]);
|
||||
return [PFBase, PFCard, PFFlex, AKGlobal].concat([
|
||||
css`
|
||||
.pf-c-card.pf-c-card-aggregate {
|
||||
height: 100%;
|
||||
}
|
||||
.pf-c-card__header {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.center-value {
|
||||
font-size: var(--pf-global--icon--FontSize--lg);
|
||||
text-align: center;
|
||||
color: var(--pf-global--Color--100);
|
||||
}
|
||||
.subtext {
|
||||
font-size: var(--pf-global--FontSize--sm);
|
||||
}
|
||||
`,
|
||||
]);
|
||||
}
|
||||
|
||||
renderInner(): TemplateResult {
|
||||
@ -40,9 +50,11 @@ export class AggregateCard extends LitElement {
|
||||
}
|
||||
|
||||
renderHeaderLink(): TemplateResult {
|
||||
return html`${this.headerLink ? html`<a href="${this.headerLink}">
|
||||
<i class="fa fa-link"> </i>
|
||||
</a>` : ""}`;
|
||||
return html`${this.headerLink
|
||||
? html`<a href="${this.headerLink}">
|
||||
<i class="fa fa-link"> </i>
|
||||
</a>`
|
||||
: ""}`;
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
@ -53,10 +65,7 @@ export class AggregateCard extends LitElement {
|
||||
</div>
|
||||
${this.renderHeaderLink()}
|
||||
</div>
|
||||
<div class="pf-c-card__body center-value">
|
||||
${this.renderInner()}
|
||||
</div>
|
||||
<div class="pf-c-card__body center-value">${this.renderInner()}</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,14 +6,14 @@ import { PFSize } from "../Spinner";
|
||||
|
||||
@customElement("ak-aggregate-card-promise")
|
||||
export class AggregatePromiseCard extends AggregateCard {
|
||||
@property({attribute: false})
|
||||
@property({ attribute: false })
|
||||
promise?: Promise<Record<string, unknown>>;
|
||||
|
||||
promiseProxy(): Promise<TemplateResult> {
|
||||
if (!this.promise) {
|
||||
return new Promise<TemplateResult>(() => html``);
|
||||
}
|
||||
return this.promise.then(s => {
|
||||
return this.promise.then((s) => {
|
||||
return html`<i class="fa fa-check-circle"></i> ${s.toString()}`;
|
||||
});
|
||||
}
|
||||
@ -23,5 +23,4 @@ export class AggregatePromiseCard extends AggregateCard {
|
||||
${until(this.promiseProxy(), html`<ak-spinner size="${PFSize.Large}"></ak-spinner>`)}
|
||||
</p>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user