tape: ui: TapeRestore: make datastore mapping selectable

by adding a custom field (grid) where the user can select
a target datastore for each source datastore on tape

if we have not loaded the content of the media set yet,
we have to load it on window open to get the list of datastores
on the tape

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-03-25 11:04:40 +01:00
committed by Dietmar Maurer
parent a32bb86df9
commit 657c47db35
2 changed files with 273 additions and 44 deletions

View File

@ -24,11 +24,18 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
return;
}
let mediaset = selection[0].data.text;
let uuid = selection[0].data['media-set-uuid'];
let node = selection[0];
let mediaset = node.data.text;
let uuid = node.data['media-set-uuid'];
let datastores = node.data.datastores;
while (!datastores && node.get('depth') > 2) {
node = node.parentNode;
datastores = node.data.datastores;
}
Ext.create('PBS.TapeManagement.TapeRestoreWindow', {
mediaset,
uuid,
datastores,
listeners: {
destroy: function() {
me.reload();
@ -185,6 +192,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
}
let storeList = Object.values(stores);
let storeNameList = Object.keys(stores);
let expand = storeList.length === 1;
for (const store of storeList) {
store.children = Object.values(store.tapes);
@ -198,6 +206,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
}
node.set('loaded', true);
node.set('datastores', storeNameList);
Proxmox.Utils.setErrorMask(view, false);
node.expand();
} catch (error) {