2021-01-28 11:59:46 +00:00
|
|
|
Ext.define('PBS.TapeManagement.LabelMediaWindow', {
|
|
|
|
extend: 'Proxmox.window.Edit',
|
|
|
|
alias: 'widget.pbsLabelMediaWindow',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
|
|
|
isCreate: true,
|
|
|
|
isAdd: true,
|
|
|
|
title: gettext('Label Media'),
|
|
|
|
submitText: gettext('OK'),
|
|
|
|
|
2021-02-15 14:22:22 +00:00
|
|
|
url: '/api2/extjs/tape/drive/',
|
|
|
|
|
|
|
|
cbindData: function(config) {
|
|
|
|
let me = this;
|
|
|
|
return {
|
|
|
|
driveid: config.driveid,
|
2021-03-02 08:54:33 +00:00
|
|
|
label: config.label,
|
2021-02-15 14:22:22 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2021-02-08 10:10:09 +00:00
|
|
|
method: 'POST',
|
|
|
|
|
2021-01-28 11:59:46 +00:00
|
|
|
showProgress: true,
|
|
|
|
|
2021-02-15 14:22:22 +00:00
|
|
|
submitUrl: function(url, values) {
|
|
|
|
let driveid = encodeURIComponent(values.drive);
|
|
|
|
delete values.drive;
|
|
|
|
return `${url}/${driveid}/label-media`;
|
|
|
|
},
|
|
|
|
|
2021-01-28 11:59:46 +00:00
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'displayfield',
|
2021-02-15 14:22:22 +00:00
|
|
|
cls: 'pmx-hint',
|
|
|
|
value: gettext('Make sure that the correct tape is inserted the selected drive and type in the label written on the tape.'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'pmxDisplayEditField',
|
2021-01-28 11:59:46 +00:00
|
|
|
fieldLabel: gettext('Drive'),
|
2021-02-25 11:25:32 +00:00
|
|
|
submitValue: true,
|
2021-02-15 14:22:22 +00:00
|
|
|
name: 'drive',
|
|
|
|
editConfig: {
|
|
|
|
xtype: 'pbsDriveSelector',
|
|
|
|
},
|
2021-01-28 11:59:46 +00:00
|
|
|
cbind: {
|
|
|
|
value: '{driveid}',
|
2021-02-15 14:22:22 +00:00
|
|
|
editable: '{!driveid}',
|
2021-01-28 11:59:46 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
fieldLabel: gettext('Label'),
|
|
|
|
name: 'label-text',
|
|
|
|
xtype: 'proxmoxtextfield',
|
|
|
|
allowBlank: false,
|
2021-03-02 08:54:33 +00:00
|
|
|
cbind: {
|
|
|
|
value: '{label}',
|
|
|
|
},
|
2021-01-28 11:59:46 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'pbsMediaPoolSelector',
|
|
|
|
fieldLabel: gettext('Media Pool'),
|
|
|
|
name: 'pool',
|
|
|
|
allowBlank: true,
|
|
|
|
skipEmptyText: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|