ui: tape/ChangerStatus: hide selector for single drives in barcode-label

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-04-08 13:39:19 +02:00 committed by Dietmar Maurer
parent a316178768
commit 3f0e344bc1
1 changed files with 5 additions and 1 deletions

View File

@ -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,
},
{