ui: improve tape job edit (add eject-media and export-media-set)

And do not auto-generate job id.
This commit is contained in:
Dietmar Maurer 2021-02-24 08:41:39 +01:00
parent 52d8db7925
commit 81678129fb
2 changed files with 50 additions and 8 deletions

View File

@ -200,6 +200,20 @@ Ext.define('PBS.config.TapeBackupJobView', {
width: 120,
sortable: true,
},
{
header: gettext('Eject'),
dataIndex: 'eject-media',
renderer: Proxmox.Utils.format_boolean,
width: 60,
sortable: false,
},
{
header: gettext('Export'),
dataIndex: 'export-media-set',
renderer: Proxmox.Utils.format_boolean,
width: 60,
sortable: false,
},
{
header: gettext('Schedule'),
dataIndex: 'schedule',

View File

@ -29,15 +29,17 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
items: {
xtype: 'inputpanel',
onGetValues: function(values) {
let me = this;
if (!values.id && me.up('pbsTapeBackupJobEdit').isCreate) {
values.id = 's-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 13);
}
return values;
},
column1: [
{
xtype: 'pmxDisplayEditField',
name: 'id',
fieldLabel: gettext('Job ID'),
renderer: Ext.htmlEncode,
allowBlank: false,
cbind: {
editable: '{isCreate}',
},
},
{
xtype: 'pbsDataStoreSelector',
fieldLabel: gettext('Local Datastore'),
@ -66,6 +68,32 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
value: '{scheduleValue}',
},
},
{
fieldLabel: gettext('Export Media Set'),
xtype: 'proxmoxcheckbox',
name: 'export-media-set',
cbind: {
deleteEmpty: '{!isCreate}',
},
listeners: {
change1: function(cb, value) {
let me = this;
let eject = me.up('window').down('proxmoxcheckbox[name=eject-media]');
if (value) {
eject.setValue(false);
}
eject.setDisabled(!!value);
},
},
},
{
fieldLabel: gettext('Eject Media'),
xtype: 'proxmoxcheckbox',
name: 'eject-media',
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
columnB: [