ui: tape: improve tape-erase and add it to library view
refactor erase window, limit drives to changer if given Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
3cdd1a3424
commit
85205bc253
51
www/tape/window/Erase.js
Normal file
51
www/tape/window/Erase.js
Normal file
@ -0,0 +1,51 @@
|
||||
Ext.define('PBS.TapeManagement.EraseWindow', {
|
||||
extend: 'Proxmox.window.Edit',
|
||||
mixins: ['Proxmox.Mixin.CBind'],
|
||||
|
||||
|
||||
changer: undefined,
|
||||
label: undefined,
|
||||
|
||||
cbindData: function(config) {
|
||||
let me = this;
|
||||
return {};
|
||||
},
|
||||
|
||||
title: gettext('Erase'),
|
||||
url: `/api2/extjs/tape/drive`,
|
||||
showProgress: true,
|
||||
submitUrl: function(url, values) {
|
||||
let drive = values.drive;
|
||||
delete values.drive;
|
||||
return `${url}/${drive}/erase-media`;
|
||||
},
|
||||
|
||||
method: 'POST',
|
||||
items: [
|
||||
{
|
||||
xtype: 'displayfield',
|
||||
cls: 'pmx-hint',
|
||||
value: gettext('Make sure to insert the tape into the selected drive.'),
|
||||
cbind: {
|
||||
hidden: '{changer}',
|
||||
},
|
||||
},
|
||||
{
|
||||
xtype: 'displayfield',
|
||||
name: 'label-text',
|
||||
submitValue: true,
|
||||
fieldLabel: gettext('Media'),
|
||||
cbind: {
|
||||
value: '{label}',
|
||||
},
|
||||
},
|
||||
{
|
||||
xtype: 'pbsDriveSelector',
|
||||
fieldLabel: gettext('Drive'),
|
||||
name: 'drive',
|
||||
cbind: {
|
||||
changer: '{changer}',
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
Reference in New Issue
Block a user