feat: Add loader (#1180)

This commit is contained in:
Julien Deveaux
2024-12-21 01:00:50 +01:00
committed by GitHub
parent 3b1c82793a
commit 30c5263a30
2 changed files with 17 additions and 8 deletions

View File

@@ -323,16 +323,22 @@ class MiniGraphCard extends LitElement {
}
renderGraph() {
const ready = this.entity[0] && this.Graph[0]._history !== undefined;
return this.config.show.graph ? html`
<div class="graph">
<div class="graph__container">
${this.renderLabels()}
${this.renderLabelsSecondary()}
<div class="graph__container__svg">
${this.renderSvg()}
</div>
</div>
${this.renderLegend()}
${ready ? html`
<div class="graph__container">
${this.renderLabels()}
${this.renderLabelsSecondary()}
<div class="graph__container__svg">
${this.renderSvg()}
</div>
</div>
${this.renderLegend()}
` : html`
<ha-circular-progress indeterminate></ha-circular-progress>
`}
</div>` : '';
}

View File

@@ -67,6 +67,9 @@ const style = css`
ha-card[hover] {
cursor: pointer;
}
ha-circular-progress {
margin: auto;
}
.flex {
display: flex;
display: -webkit-flex;