ui: tape/ChangerStatus: shortcut Inventory for single drives
like 'load-media' Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
dff8ea92aa
commit
a316178768
@ -339,6 +339,25 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
|
|||||||
return;
|
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', {
|
Ext.create('Proxmox.window.Edit', {
|
||||||
title: gettext('Inventory'),
|
title: gettext('Inventory'),
|
||||||
showTaskViewer: true,
|
showTaskViewer: true,
|
||||||
@ -359,6 +378,7 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
}).show();
|
}).show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
scheduleReload: function(time) {
|
scheduleReload: function(time) {
|
||||||
|
Loading…
Reference in New Issue
Block a user