proxmox-backup/www/tape/window
Dominik Csapak 6cff4c6bf6 fix #4977: ui: tape: restore: rework snapshot selection logic
previously, the snapshot grid returned one of three possible types of
values:
* a list of snapshots
* a list of datastores (if only whole datastores were selected)
* the string 'all' (when all snapshots were selected)

this led to some confusing and wrong code, especially the part:
```
  if (source === 'all') {
      source = values.store;
  }
```

which basically set the selected *target* store as a source.  (meaning
it tried restoring a datastore with the selected target name,
regardless if it existed or not)

This fell through in testing, since we most often only restored to the
same datastore anyway were the target and source name were the same.

Rework the return value to return the empty array in case all
snapshots are selected, since selecting none is not a valid anyway.

This means we always get an array back, which makes the code a bit
cleaner overall.

At the same time, we now differentiate correctly the 'all selected'
case, by setting the selected target as a default target.

So instead of previously having `target=target` as datastore
parameter, we now have `target` which is the correct behavior when we
want to restore the whole media set anyway.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
(cherry picked from commit 3429304733)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-10 13:09:13 +01:00
..
ChangerEdit.js ui: tape: add Edit Windows 2021-01-28 15:07:29 +01:00
DriveEdit.js ui: rename 'Changer Slot' to 'Drive Number' 2021-02-27 09:51:13 +01:00
EncryptionEdit.js ui: tape: add EncryptionPanel to add/remove encryption keys 2021-02-04 17:35:46 +01:00
Erase.js ui: tape: rename erase to format 2021-04-14 12:25:53 +02:00
LabelMedia.js ui: tape: prevent mislabeling tapes in changers 2023-04-24 10:02:20 +02:00
PoolEdit.js ui: tape/pool: set onlineHelp for edit/add window 2021-03-28 13:29:02 +02:00
TapeBackup.js ui: tape/Backup: add namespace and recursion field for manual backup 2022-05-13 14:09:53 +02:00
TapeBackupJob.js ui: tape/BackupJobEdit: add onlineHelp 2022-05-13 14:09:53 +02:00
TapeRestore.js fix #4977: ui: tape: restore: rework snapshot selection logic 2023-11-10 13:09:13 +01:00