[pbs-devel] [PATCH proxmox-backup 6/7] ui: tape/ChangerStatus: hide selector for single drives in barcode-label

Dominik Csapak d.csapak at proxmox.com
Thu Apr 8 13:39:19 CEST 2021


it is rather pointless to let the user select something were there
is no choice. We have to keep the window though, since the user may
want to choose a pool

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/tape/ChangerStatus.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index 9b1d8c47..2f6e29df 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -302,6 +302,8 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 		return;
 	    }
 
+	    let singleDrive = me.drives.length === 1 ? me.drives[0] : undefined;
+
 	    Ext.create('Proxmox.window.Edit', {
 		title: gettext('Barcode Label'),
 		showTaskViewer: true,
@@ -315,9 +317,11 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 
 		items: [
 		    {
-			xtype: 'pbsDriveSelector',
+			xtype: singleDrive === undefined ? 'pbsDriveSelector' : 'displayfield',
 			fieldLabel: gettext('Drive'),
+			submitValue: true,
 			name: 'drive',
+			value: singleDrive,
 			changer: changer,
 		    },
 		    {
-- 
2.20.1






More information about the pbs-devel mailing list