ui: tape/ChangerStatus: adding parameter selection to inventory

namely 'catalog' and 'read-all-labels', by always opening a
window (with a drive now autoselected) and the two checkboxes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2022-10-19 13:13:34 +02:00 committed by Wolfgang Bumiller
parent 4ebc97ad4b
commit 57ee4e9ea4

View File

@ -375,25 +375,6 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
return;
}
let singleDrive = me.drives.length === 1 ? me.drives[0] : undefined;
if (singleDrive !== undefined) {
Proxmox.Utils.API2Request({
method: 'PUT',
url: `/api2/extjs/tape/drive/${singleDrive}/inventory`,
success: function(response, opt) {
Ext.create('Proxmox.window.TaskViewer', {
upid: response.result.data,
taskDone: function(success) {
me.reload();
},
}).show();
},
failure: function(response, opt) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
});
} else {
Ext.create('Proxmox.window.Edit', {
title: gettext('Inventory'),
showTaskViewer: true,
@ -408,13 +389,26 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
items: [
{
xtype: 'pbsDriveSelector',
labelWidth: 120,
fieldLabel: gettext('Drive'),
name: 'drive',
changer: changer,
autoSelect: true,
},
{
xtype: 'proxmoxcheckbox',
labelWidth: 120,
fieldLabel: gettext('Restore Catalogs'),
name: 'catalog',
},
{
xtype: 'proxmoxcheckbox',
labelWidth: 120,
fieldLabel: gettext('Force all Tapes'),
name: 'read-all-labels',
},
],
}).show();
}
},
scheduleReload: function(time) {