Files
.cargo
debian
docs
etc
examples
src
tests
www
button
config
css
dashboard
data
datastore
form
images
panel
tape
form
window
ChangerEdit.js
DriveEdit.js
EncryptionEdit.js
Erase.js
LabelMedia.js
PoolEdit.js
TapeBackup.js
TapeBackupJob.js
TapeRestore.js
BackupJobs.js
BackupOverview.js
ChangerConfig.js
ChangerStatus.js
DriveConfig.js
DriveStatus.js
EncryptionKeys.js
PoolConfig.js
TapeInventory.js
TapeManagement.js
window
Application.js
Dashboard.js
DirectoryList.js
LoginView.js
MainView.js
Makefile
NavigationTree.js
OnlineHelpInfo.js
ServerAdministration.js
ServerStatus.js
Subscription.js
SystemConfiguration.js
Utils.js
VersionInfo.js
ZFSList.js
index.hbs
zsh-completions
.gitignore
Cargo.toml
Makefile
README.rst
TODO.rst
defines.mk
rustfmt.toml
proxmox-backup/www/tape/window/Erase.js
Dominik Csapak a2e30cd51d ui: tape: rename erase to format
erase is a different action, so correctly call it 'format'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-04-14 12:25:53 +02:00

96 lines
1.9 KiB
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 {
singleDrive: me.singleDrive,
hasSingleDrive: !!me.singleDrive,
warning: Ext.String.format(gettext("Are you sure you want to format tape '{0}' ?"), me.label),
};
},
title: gettext('Format/Erase'),
url: `/api2/extjs/tape/drive`,
showProgress: true,
submitUrl: function(url, values) {
let drive = values.drive;
delete values.drive;
return `${url}/${drive}/format-media`;
},
layout: 'hbox',
width: 400,
method: 'POST',
isCreate: true,
submitText: gettext('Ok'),
items: [
{
xtype: 'container',
padding: 0,
layout: {
type: 'hbox',
align: 'stretch',
},
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}',
},
},
],
},
],
},
],
});