mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-25 06:03:57 +03:00
ui: tape: fix restore datastore mapping parameter construction
We recently took into account the selected datastore when restoring from tape, but the snapshot grids value may not only be a single datastore, it can also be a list of snapshots, datastores or 'all'. Handle these cases and extract the source datastore correctly. This fixes tape restoration when not a whole datastore is selected. Reported in the forum: https://forum.proxmox.com/threads/restore-from-lto-parameter-verification-errors-store.128445 Fixes: df881ed0 ("ui: tape: fix restoring a single datastore") Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
7075496424
commit
73bd988c42
@ -380,6 +380,19 @@ Ext.define('PBS.TapeManagement.TapeRestoreWindow', {
|
||||
if (values.store.toString() !== "") {
|
||||
if (vm.get('singleDatastore')) {
|
||||
let source = controller.lookup('snapshotGrid').getValue();
|
||||
if (source === 'all') {
|
||||
// all values are selected
|
||||
source = values.store;
|
||||
} else if (Ext.isArray(source)) {
|
||||
if (source[0].indexOf(':') !== -1) {
|
||||
// one or multiple snapshots are selected
|
||||
// extract datastore from first
|
||||
source = source[0].split(':')[0];
|
||||
} else {
|
||||
// one whole datstore is selected
|
||||
source = source[0];
|
||||
}
|
||||
}
|
||||
datastores.push(`${source}=${values.store}`);
|
||||
} else {
|
||||
datastores.push(values.store);
|
||||
|
Loading…
x
Reference in New Issue
Block a user