ui: storage: backup: refactor extraColumns assignment

makes it easier to add columns, and uses less indentation

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-04-25 09:21:27 +02:00 committed by Thomas Lamprecht
parent 9a023d5540
commit 73ea065ac2

View File

@ -195,9 +195,10 @@ Ext.define('PVE.storage.BackupView', {
pruneButton, pruneButton,
); );
me.extraColumns = {};
if (isPBS) { if (isPBS) {
me.extraColumns = { me.extraColumns.encrypted = {
encrypted: {
header: gettext('Encrypted'), header: gettext('Encrypted'),
dataIndex: 'encrypted', dataIndex: 'encrypted',
renderer: PVE.Utils.render_backup_encryption, renderer: PVE.Utils.render_backup_encryption,
@ -205,8 +206,8 @@ Ext.define('PVE.storage.BackupView', {
property: 'encrypted', property: 'encrypted',
transform: encrypted => encrypted ? 1 : 0, transform: encrypted => encrypted ? 1 : 0,
}, },
}, };
verification: { me.extraColumns.verification = {
header: gettext('Verify State'), header: gettext('Verify State'),
dataIndex: 'verification', dataIndex: 'verification',
renderer: PVE.Utils.render_backup_verification, renderer: PVE.Utils.render_backup_verification,
@ -218,7 +219,6 @@ Ext.define('PVE.storage.BackupView', {
return order[state] ?? order.__default__; return order[state] ?? order.__default__;
}, },
}, },
},
}; };
} }