2021-02-16 11:48:10 +00:00
|
|
|
Ext.define('PBS.TapeManagement.EraseWindow', {
|
|
|
|
extend: 'Proxmox.window.Edit',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
|
|
|
|
|
|
|
changer: undefined,
|
|
|
|
label: undefined,
|
|
|
|
|
|
|
|
cbindData: function(config) {
|
|
|
|
let me = this;
|
2021-04-08 11:39:16 +00:00
|
|
|
return {
|
|
|
|
singleDrive: me.singleDrive,
|
|
|
|
hasSingleDrive: !!me.singleDrive,
|
|
|
|
warning: Ext.String.format(gettext("Are you sure you want to erase tape '{0}' ?"), me.label),
|
|
|
|
};
|
2021-02-16 11:48:10 +00:00
|
|
|
},
|
|
|
|
|
2021-03-31 07:19:19 +00:00
|
|
|
title: gettext('Format/Erase'),
|
2021-02-16 11:48:10 +00:00
|
|
|
url: `/api2/extjs/tape/drive`,
|
|
|
|
showProgress: true,
|
|
|
|
submitUrl: function(url, values) {
|
|
|
|
let drive = values.drive;
|
|
|
|
delete values.drive;
|
2021-03-31 07:19:19 +00:00
|
|
|
return `${url}/${drive}/format-media`;
|
2021-02-16 11:48:10 +00:00
|
|
|
},
|
|
|
|
|
2021-04-08 11:39:16 +00:00
|
|
|
layout: 'hbox',
|
|
|
|
width: 400,
|
2021-02-16 11:48:10 +00:00
|
|
|
method: 'POST',
|
2021-04-08 11:39:16 +00:00
|
|
|
isCreate: true,
|
|
|
|
submitText: gettext('Ok'),
|
2021-02-16 11:48:10 +00:00
|
|
|
items: [
|
|
|
|
{
|
2021-04-08 11:39:16 +00:00
|
|
|
xtype: 'container',
|
|
|
|
padding: 0,
|
|
|
|
layout: {
|
|
|
|
type: 'hbox',
|
|
|
|
align: 'stretch',
|
2021-02-16 11:48:10 +00:00
|
|
|
},
|
2021-04-08 11:39:16 +00:00
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'component',
|
|
|
|
cls: [Ext.baseCSSPrefix + 'message-box-icon',
|
|
|
|
Ext.baseCSSPrefix + 'message-box-warning',
|
|
|
|
Ext.baseCSSPrefix + 'dlg-icon'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'container',
|
|
|
|
flex: 1,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'displayfield',
|
|
|
|
cbind: {
|
|
|
|
value: '{warning}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'displayfield',
|
|
|
|
cls: 'pmx-hint',
|
|
|
|
value: gettext('Make sure to insert the tape into the selected drive.'),
|
|
|
|
cbind: {
|
|
|
|
hidden: '{changer}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'hidden',
|
|
|
|
name: 'label-text',
|
|
|
|
cbind: {
|
|
|
|
value: '{label}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'hidden',
|
|
|
|
name: 'drive',
|
|
|
|
cbind: {
|
|
|
|
disabled: '{!hasSingleDrive}',
|
|
|
|
value: '{singleDrive}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'pbsDriveSelector',
|
|
|
|
fieldLabel: gettext('Drive'),
|
|
|
|
name: 'drive',
|
|
|
|
cbind: {
|
|
|
|
changer: '{changer}',
|
|
|
|
disabled: '{hasSingleDrive}',
|
|
|
|
hidden: '{hasSingleDrive}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2021-02-16 11:48:10 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|