mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-04 01:10:33 -06:00
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:
parent
176924241c
commit
424d71c55a
@ -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;
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user