Add backup size to backup table (#11365)

This commit is contained in:
Joakim Sørensen 2022-01-20 17:08:53 +01:00 committed by GitHub
parent 81faae6f74
commit 930c7e4afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -119,7 +119,7 @@ export class HassioBackups extends LitElement {
private _columns = memoizeOne(
(narrow: boolean): DataTableColumnContainer => ({
name: {
title: this.supervisor?.localize("backup.name") || "",
title: this.supervisor.localize("backup.name"),
sortable: true,
filterable: true,
grows: true,
@ -127,8 +127,16 @@ export class HassioBackups extends LitElement {
html`${entry || backup.slug}
<div class="secondary">${backup.secondary}</div>`,
},
size: {
title: this.supervisor.localize("backup.size"),
width: "15%",
hidden: narrow,
filterable: true,
sortable: true,
template: (entry: number) => Math.ceil(entry * 10) / 10 + " MB",
},
date: {
title: this.supervisor?.localize("backup.created") || "",
title: this.supervisor.localize("backup.created"),
width: "15%",
direction: "desc",
hidden: narrow,
@ -188,11 +196,11 @@ export class HassioBackups extends LitElement {
slot="trigger"
></ha-icon-button>
<mwc-list-item>
${this.supervisor?.localize("common.reload")}
${this.supervisor.localize("common.reload")}
</mwc-list-item>
${atLeastVersion(this.hass.config.version, 0, 116)
? html`<mwc-list-item>
${this.supervisor?.localize("backup.upload_backup")}
${this.supervisor.localize("backup.upload_backup")}
</mwc-list-item>`
: ""}
</ha-button-menu>

View File

@ -20,6 +20,7 @@ export interface HassioBackup {
slug: string;
date: string;
name: string;
size: number;
type: "full" | "partial";
protected: boolean;
content: BackupContent;

View File

@ -4445,6 +4445,7 @@
"partial_backup": "Partial backup",
"addons": "Add-ons",
"folders": "Folders",
"size": "Size",
"password": "Backup password",
"confirm_password": "Confirm backup password",
"password_protection": "Password protection",