diff --git a/www/DataStoreContent.js b/www/DataStoreContent.js index 601f3ab9..931cb7fd 100644 --- a/www/DataStoreContent.js +++ b/www/DataStoreContent.js @@ -11,6 +11,30 @@ Ext.define('pbs-data-store-snapshots', { 'files', 'owner', { name: 'size', type: 'int' }, + { + name: 'encrypted', + type: 'string', + calculate: function(data) { + let encrypted = 0; + let files = 0; + data.files.forEach(file => { + if (file.filename === 'index.json.blob') return; // is never encrypted + if (file.encrypted) { + encrypted++; + } + files++; + }); + + if (encrypted === 0) { + return Proxmox.Utils.noText; + } else if (encrypted < files) { + return gettext('Partial'); + } else if (encrypted === files) { + return Proxmox.Utils.yesText; + } + return Proxmox.Utils.unknowText; + } + } ] }); @@ -127,7 +151,13 @@ Ext.define('PBS.DataStoreContent', { group.files = item.files; group.size = item.size; group.owner = item.owner; + if (group.encrypted !== undefined && group.encrypted !== item.encrypted) { + group.encrypted = gettext('Mixed'); + } else { + group.encrypted = item.encrypted; + } } + } group.count = group.children.length; children.push(group); @@ -192,13 +222,25 @@ Ext.define('PBS.DataStoreContent', { sortable: true, dataIndex: 'owner', }, + { + header: gettext('Encrypted'), + dataIndex: 'encrypted', + }, { header: gettext("Files"), sortable: false, dataIndex: 'files', renderer: function(files) { return files.map((file) => { - return file.filename; + let icon = ''; + let size = ''; + if (file.encrypted) { + icon = ' '; + } + if (file.size) { + size = ` (${Proxmox.Utils.format_size(file.size)})`; + } + return `${icon}${file.filename}${size}`; }).join(', '); }, flex: 2