From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9D23C82629 for ; Mon, 29 Nov 2021 15:39:46 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 95BDCB838 for ; Mon, 29 Nov 2021 15:39:46 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 7AAEAB7F1 for ; Mon, 29 Nov 2021 15:39:44 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5452E447CF for ; Mon, 29 Nov 2021 15:39:44 +0100 (CET) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Mon, 29 Nov 2021 15:39:42 +0100 Message-Id: <20211129143943.1598243-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211129143943.1598243-1-d.csapak@proxmox.com> References: <20211129143943.1598243-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.186 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v2 3/4] ui: tape/BackupJobEdit: add second tab with group filters X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2021 14:39:46 -0000 adds a second tab and adapts the styling to our usual one (border/padding) adds a change listener to the datastore selector to change it on the group filters remaining changes are mostly indentation changes Signed-off-by: Dominik Csapak --- www/tape/window/TapeBackupJob.js | 231 +++++++++++++++++-------------- 1 file changed, 128 insertions(+), 103 deletions(-) diff --git a/www/tape/window/TapeBackupJob.js b/www/tape/window/TapeBackupJob.js index 72821115..266360ce 100644 --- a/www/tape/window/TapeBackupJob.js +++ b/www/tape/window/TapeBackupJob.js @@ -11,6 +11,8 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', { fieldDefaults: { labelWidth: 120 }, + bodyPadding: 0, + cbindData: function(initialConfig) { let me = this; @@ -28,117 +30,140 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', { }, items: { - xtype: 'inputpanel', - onGetValues: function(values) { - let me = this; - - if (values['export-media-set'] && !me.up('pbsTapeBackupJobEdit').isCreate) { - Proxmox.Utils.assemble_field_data(values, { "delete": 'eject-media' }); - } - PBS.Utils.delete_if_default(values, 'notify-user'); - 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'), - name: 'store', - }, - { - xtype: 'pbsMediaPoolSelector', - fieldLabel: gettext('Media Pool'), - name: 'pool', - }, - { - xtype: 'pbsDriveSelector', - fieldLabel: gettext('Drive'), - name: 'drive', - }, + xtype: 'tabpanel', + bodyPadding: 10, + border: 0, + items: [ { - xtype: 'pmxUserSelector', - name: 'notify-user', - fieldLabel: gettext('Notify User'), - emptyText: 'root@pam', - allowBlank: true, - value: null, - renderer: Ext.String.htmlEncode, - }, - ], + title: gettext('Options'), + xtype: 'inputpanel', + onGetValues: function(values) { + let me = this; - column2: [ - { - fieldLabel: gettext('Schedule'), - xtype: 'pbsCalendarEvent', - name: 'schedule', - emptyText: gettext('none (disabled)'), - cbind: { - deleteEmpty: '{!isCreate}', - value: '{scheduleValue}', - }, - }, - { - fieldLabel: gettext('Export Media-Set'), - xtype: 'proxmoxcheckbox', - name: 'export-media-set', - cbind: { - deleteEmpty: '{!isCreate}', + if (values['export-media-set'] && !me.up('pbsTapeBackupJobEdit').isCreate) { + Proxmox.Utils.assemble_field_data(values, { "delete": 'eject-media' }); + } + PBS.Utils.delete_if_default(values, 'notify-user'); + return values; }, - listeners: { - change: function(cb, value) { - let me = this; - let eject = me.up('window').down('proxmoxcheckbox[name=eject-media]'); - if (value) { - eject.setValue(false); - } - eject.setDisabled(!!value); + column1: [ + { + xtype: 'pmxDisplayEditField', + name: 'id', + fieldLabel: gettext('Job ID'), + renderer: Ext.htmlEncode, + allowBlank: false, + cbind: { + editable: '{isCreate}', + }, }, - }, - }, - { - fieldLabel: gettext('Eject Media'), - xtype: 'proxmoxcheckbox', - name: 'eject-media', - cbind: { - deleteEmpty: '{!isCreate}', - }, - }, - { - fieldLabel: gettext('Latest Only'), - xtype: 'proxmoxcheckbox', - name: 'latest-only', - cbind: { - deleteEmpty: '{!isCreate}', - }, - }, - ], + { + xtype: 'pbsDataStoreSelector', + fieldLabel: gettext('Local Datastore'), + name: 'store', + listeners: { + change: function(field, value) { + let me = this; + me.up('tabpanel').down('pbsGroupFilter').setLocalDatastore(value); + }, + }, + }, + { + xtype: 'pbsMediaPoolSelector', + fieldLabel: gettext('Media Pool'), + name: 'pool', + }, + { + xtype: 'pbsDriveSelector', + fieldLabel: gettext('Drive'), + name: 'drive', + }, + { + xtype: 'pmxUserSelector', + name: 'notify-user', + fieldLabel: gettext('Notify User'), + emptyText: 'root@pam', + allowBlank: true, + value: null, + renderer: Ext.String.htmlEncode, + }, + ], - columnB: [ - { - fieldLabel: gettext('Backup Groups'), - xtype: 'displayfield', - name: 'group-filter', - renderer: v => v ? Ext.String.htmlEncode(v) : gettext('All'), - cbind: { - hidden: '{isCreate}', - }, + column2: [ + { + fieldLabel: gettext('Schedule'), + xtype: 'pbsCalendarEvent', + name: 'schedule', + emptyText: gettext('none (disabled)'), + cbind: { + deleteEmpty: '{!isCreate}', + value: '{scheduleValue}', + }, + }, + { + fieldLabel: gettext('Export Media-Set'), + xtype: 'proxmoxcheckbox', + name: 'export-media-set', + cbind: { + deleteEmpty: '{!isCreate}', + }, + listeners: { + change: 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}', + }, + }, + { + fieldLabel: gettext('Latest Only'), + xtype: 'proxmoxcheckbox', + name: 'latest-only', + cbind: { + deleteEmpty: '{!isCreate}', + }, + }, + ], + + columnB: [ + { + fieldLabel: gettext('Comment'), + xtype: 'proxmoxtextfield', + name: 'comment', + cbind: { + deleteEmpty: '{!isCreate}', + }, + }, + ], }, { - fieldLabel: gettext('Comment'), - xtype: 'proxmoxtextfield', - name: 'comment', - cbind: { - deleteEmpty: '{!isCreate}', + xtype: 'inputpanel', + onGetValues: function(values) { + PBS.Utils.delete_if_default(values, 'group-filter'); + if (Ext.isArray(values['group-filter']) && values['group-filter'].length === 0) { + delete values['group-filter']; + values.delete = 'group-filter'; + } + return values; }, + title: gettext('Group Filter'), + items: [ + { + xtype: 'pbsGroupFilter', + name: 'group-filter', + }, + ], }, ], }, -- 2.30.2