Change loading detailed storage to use ha-alert with spinner (#26749)

* Change spinner overlay to use `ha-alert` with messaging

* Use spinner for icon slot
This commit is contained in:
Aidan Timson 2025-08-28 17:05:53 +01:00 committed by Paul Bottein
parent 176924241c
commit 424d71c55a
No known key found for this signature in database
2 changed files with 15 additions and 13 deletions

View File

@ -327,8 +327,7 @@ class HaConfigSectionStorage extends LitElement {
>${roundWithOneDecimal(freeSpaceGB)} GB</span
>`,
});
const chart = html`
<ha-segmented-bar
return html`<ha-segmented-bar
.heading=${this.hass.localize("ui.panel.config.storage.used_space")}
.description=${this.hass.localize(
"ui.panel.config.storage.detailed_description",
@ -339,17 +338,15 @@ class HaConfigSectionStorage extends LitElement {
)}
.segments=${segments}
></ha-segmented-bar>
`;
return storageInfo || storageInfo === null
? chart
: html`
<div class="loading-container">
${chart}
<div class="loading-overlay">
<ha-spinner></ha-spinner>
</div>
</div>
`;
${!storageInfo || storageInfo === null
? html`<ha-alert alert-type="info">
<ha-spinner slot="icon"></ha-spinner>
${this.hass.localize(
"ui.panel.config.storage.loading_detailed"
)}</ha-alert
>`
: nothing}`;
}
);
@ -522,6 +519,10 @@ class HaConfigSectionStorage extends LitElement {
ha-icon-next {
width: 24px;
}
ha-alert ha-spinner {
--ha-spinner-size: 24px;
}
`;
}

View File

@ -6674,6 +6674,7 @@
"description": "{percent_used} used - {free_space} free",
"used_space": "Storage",
"detailed_description": "{used} of {total} used",
"loading_detailed": "Loading detailed storage information...",
"segments": {
"used": "Used space",
"free": "Free space",