ui: add BackupFileDownloader

enables to be able to download whole files from the backup (e.g.
the decoded didx/fidx/blobs) for unencrypted backups

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-06-23 12:09:48 +02:00
committed by Dietmar Maurer
parent 7b1e26699d
commit 98425309b0
3 changed files with 162 additions and 0 deletions

View File

@ -195,6 +195,25 @@ Ext.define('PBS.DataStoreContent', {
});
win.on('destroy', this.reload, this);
win.show();
},
openBackupFileDownloader: function() {
let me = this;
let view = me.getView();
let rec = view.selModel.getSelection()[0];
if (!(rec && rec.data)) return;
let data = rec.data;
Ext.create('PBS.window.BackupFileDownloader', {
baseurl: `/api2/json/admin/datastore/${view.datastore}`,
params: {
'backup-id': data['backup-id'],
'backup-type': data['backup-type'],
'backup-time': (data['backup-time'].getTime()/1000).toFixed(0),
},
files: data.files,
}).show();
}
},
@ -277,6 +296,16 @@ Ext.define('PBS.DataStoreContent', {
parentXType: 'pbsDataStoreContent',
enableFn: function(record) { return !record.data.leaf; },
handler: 'onPrune',
},
{
xtype: 'proxmoxButton',
text: gettext('Download Files'),
disabled: true,
parentXType: 'pbsDataStoreContent',
handler: 'openBackupFileDownloader',
enableFn: function(record) {
return !!record.data.leaf;
},
}
],
});