proxmox-backup/www/tape/window/Erase.js
Dominik Csapak 85205bc253 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>
2021-02-17 06:55:53 +01:00

52 lines
986 B
JavaScript

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}',
},
},
],
});