From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 8371D1FF0B6 for ; Thu, 12 Nov 2026 12:41:16 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id F31CD21641; Thu, 12 Nov 2026 12:41:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stuttgart.de; s=s1022; t=1794483671; bh=RMbu4NkCPZPA/IPNBORCDh2fDau1g/ZDAz2H6mBYysM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YRBbTsjB6cm+sa+6rilqbUtMyBgYBtv8VLFHws+KpAIv99+fS5WDXN0yEWMGDp6c+ DIEcwg1l97Lq3Co7SiN3vq8Hp103MjhZWm+YboQNVvM4I51LTP3Ul/b5oicw23G9+5 eIVxOSzi4SRIKBoH5xjLj9AcNVJ+unA7UsBeP+dFhiXg/YyJ3OyB9SdkEgzToRzy0q UQ2F1QwnrgQGfJ3LsQKVxQwuSnaaCJX+3ff3GRhpIZ+mAl3f1bdTD26mHpE83iv9tx WF8yPqPjxyn9TOzufWI+oOl/h3Iy5oTULS5vzebprry3I8zikBJk4BfgZYngXuTicp CIn1HL7XZkHQQ== From: Jakob-Tobias Winter To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 4/4] ui: tape restore: allow selecting several drives Date: Thu, 12 Nov 2026 12:37:37 +0100 Message-ID: <20261112113737.748541-5-tobias@stuttgart.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261112113737.748541-1-tobias@stuttgart.de> References: <20261112113737.748541-1-tobias@stuttgart.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.035 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: IL5QNENQ47KVRINAJEKDGXUXGTY5VDFN X-Message-ID-Hash: IL5QNENQ47KVRINAJEKDGXUXGTY5VDFN X-MailFrom: prvs=f560d3371a=tobias@stuttgart.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jakob-Tobias Winter X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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