From 81678129fb4d9758f6176dd2e47075c788d0119c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 24 Feb 2021 08:41:39 +0100 Subject: [PATCH] ui: improve tape job edit (add eject-media and export-media-set) And do not auto-generate job id. --- www/tape/BackupJobs.js | 14 ++++++++++ www/tape/window/TapeBackupJob.js | 44 ++++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/www/tape/BackupJobs.js b/www/tape/BackupJobs.js index 2532fb38..b8f5a084 100644 --- a/www/tape/BackupJobs.js +++ b/www/tape/BackupJobs.js @@ -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', diff --git a/www/tape/window/TapeBackupJob.js b/www/tape/window/TapeBackupJob.js index 9902a454..7b99e647 100644 --- a/www/tape/window/TapeBackupJob.js +++ b/www/tape/window/TapeBackupJob.js @@ -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: [