all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob-Tobias Winter <tobias@stuttgart.de>
To: pbs-devel@lists.proxmox.com
Cc: Jakob-Tobias Winter <tobias@stuttgart.de>
Subject: [PATCH proxmox-backup 4/4] ui: tape restore: allow selecting several drives
Date: Thu, 12 Nov 2026 12:37:37 +0100	[thread overview]
Message-ID: <20261112113737.748541-5-tobias@stuttgart.de> (raw)
In-Reply-To: <20261112113737.748541-1-tobias@stuttgart.de>

Turn the drive selector of the restore window into a multi-select
field and submit it as the new 'drives' parameter, so that a restore
can read several media in parallel. Like the API, the selector does
not accept several drives that are not in the same changer.

Signed-off-by: Jakob-Tobias Winter <tobias@stuttgart.de>
---
changes since the RFC:
- one multi-select field that is sent as 'drives', instead of a
  second field for additional drives
- the drive selector does not accept several drives that are not in
  the same changer

 www/tape/form/DriveSelector.js | 17 +++++++++++++++++
 www/tape/window/TapeRestore.js |  5 +++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/www/tape/form/DriveSelector.js b/www/tape/form/DriveSelector.js
index ca4188c25..0a5515493 100644
--- a/www/tape/form/DriveSelector.js
+++ b/www/tape/form/DriveSelector.js
@@ -52,6 +52,23 @@ Ext.define('PBS.form.DriveSelector', {
         ],
     },
 
+    // several drives can only be used together if they are in the same changer
+    validator: function (value) {
+        let me = this;
+
+        let drives = me.multiSelect ? me.getValue() || [] : [];
+        if (drives.length > 1) {
+            let changers = drives.map(
+                (drive) => me.store.getAt(me.store.findExact('name', drive))?.data.changer,
+            );
+            if (changers.some((changer) => !changer || changer !== changers[0])) {
+                return gettext('Several drives have to be in the same changer');
+            }
+        }
+
+        return me.callParent([value]);
+    },
+
     initComponent: function () {
         let me = this;
 
diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js
index 8ee4f17a9..47efab2de 100644
--- a/www/tape/window/TapeRestore.js
+++ b/www/tape/window/TapeRestore.js
@@ -475,9 +475,10 @@ Ext.define('PBS.TapeManagement.TapeRestoreWindow', {
                     column2: [
                         {
                             xtype: 'pbsDriveSelector',
-                            name: 'drive',
-                            fieldLabel: gettext('Drive'),
+                            name: 'drives',
+                            fieldLabel: gettext('Drives'),
                             labelWidth: 120,
+                            multiSelect: true,
                         },
                         {
                             xtype: 'pbsDataStoreSelector',
-- 
2.53.0




      parent reply	other threads:[~2026-11-12 11:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 11:37 [PATCH proxmox-backup 0/4] fix 7333 use multiple tape drives for restoring Jakob-Tobias Winter
2026-11-12 11:37 ` [PATCH proxmox-backup 1/4] tape: drive: add a pool to use several drives for one task Jakob-Tobias Winter
2026-11-12 11:37 ` [PATCH proxmox-backup 2/4] tape: restore: use a drive pool for the selective restore Jakob-Tobias Winter
2026-11-12 11:37 ` [PATCH proxmox-backup 3/4] close #7333: tape: restore: allow using several drives in parallel Jakob-Tobias Winter
2026-11-12 11:37 ` Jakob-Tobias Winter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261112113737.748541-5-tobias@stuttgart.de \
    --to=tobias@stuttgart.de \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal