187 files
This commit is contained in:
1 parent
16c9b4d7f4
commit
d6413e19b5
187 files changed
+15542
-2765
No files matched your search
+7
-7
@@ -166,10 +166,10 @@ export class MaintenanceStorageSectionCard extends LitElement {
|
||||
render() {
|
||||
if (!this._loaded || !this._summary) return nothing;
|
||||
const s = this._summary;
|
||||
if (s.document_count === 0) return nothing; // self-hide when unused
|
||||
if (!s.document_count) return nothing; // self-hide when unused (or malformed)
|
||||
const L = this._lang;
|
||||
|
||||
const rows = Object.entries(s.by_object)
|
||||
const rows = Object.entries(s.by_object ?? {})
|
||||
.filter(([, v]) => v.files > 0 || v.links > 0)
|
||||
.map(([id, v]) => ({ id, name: this._nameFor(id), entry: this._entryFor(id), ...v }))
|
||||
.sort((a, b) => b.bytes - a.bytes);
|
||||
@@ -188,8 +188,8 @@ export class MaintenanceStorageSectionCard extends LitElement {
|
||||
<span class="emoji">🗄️</span>
|
||||
<span class="title-text">${t("doc_storage_title", L)}</span>
|
||||
<span class="header-summary">
|
||||
${formatBytes(s.total_bytes)}
|
||||
${s.dedup_savings_bytes > 0 ? html`<span class="saved">−${formatBytes(s.dedup_savings_bytes)}</span>` : nothing}
|
||||
${formatBytes(s.total_bytes, L)}
|
||||
${s.dedup_savings_bytes > 0 ? html`<span class="saved">−${formatBytes(s.dedup_savings_bytes, L)}</span>` : nothing}
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
@@ -207,7 +207,7 @@ export class MaintenanceStorageSectionCard extends LitElement {
|
||||
<div class="body">
|
||||
<div class="totals">
|
||||
<div class="stat">
|
||||
<div class="stat-value">${formatBytes(s.total_bytes)}</div>
|
||||
<div class="stat-value">${formatBytes(s.total_bytes, L)}</div>
|
||||
<div class="stat-label">
|
||||
<ha-icon icon="mdi:file-document-outline"></ha-icon> ${s.file_count}
|
||||
<ha-icon icon="mdi:link-variant"></ha-icon> ${s.link_count}
|
||||
@@ -215,7 +215,7 @@ export class MaintenanceStorageSectionCard extends LitElement {
|
||||
</div>
|
||||
${s.dedup_savings_bytes > 0
|
||||
? html`<div class="stat">
|
||||
<div class="stat-value saved">−${formatBytes(s.dedup_savings_bytes)}</div>
|
||||
<div class="stat-value saved">−${formatBytes(s.dedup_savings_bytes, L)}</div>
|
||||
<div class="stat-label">${t("doc_storage_saved", L)}</div>
|
||||
</div>`
|
||||
: nothing}
|
||||
@@ -275,7 +275,7 @@ export class MaintenanceStorageSectionCard extends LitElement {
|
||||
${r.files > 0 ? html`<ha-icon icon="mdi:file-document-outline"></ha-icon>${r.files}` : nothing}
|
||||
${r.links > 0 ? html`<ha-icon icon="mdi:link-variant"></ha-icon>${r.links}` : nothing}
|
||||
</span>
|
||||
<span class="obj-size">${formatBytes(r.bytes)}</span>
|
||||
<span class="obj-size">${formatBytes(r.bytes, L)}</span>
|
||||
${eid ? html`<ha-icon class="obj-go" icon="mdi:chevron-right"></ha-icon>` : nothing}
|
||||
</div>
|
||||
`;
|
||||
|
||||
Reference in new issue
Block a user