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 442B8825AE for ; Mon, 29 Nov 2021 15:40:17 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 304E9B839 for ; Mon, 29 Nov 2021 15:39:47 +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 D9575B7FC 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 79C77449FE 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:43 +0100 Message-Id: <20211129143943.1598243-5-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 4/4] ui: SyncJobEdit: 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:40:17 -0000 adds a second tab and adapts the styling to our usual one (border/padding) adds a change listener to the remote datastore selector to change the remote + datastore on the group filters remaining changes are mostly indentation changes Signed-off-by: Dominik Csapak --- www/window/SyncJobEdit.js | 233 +++++++++++++++++++++----------------- 1 file changed, 130 insertions(+), 103 deletions(-) diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js index 3437ef23..8abfacf7 100644 --- a/www/window/SyncJobEdit.js +++ b/www/window/SyncJobEdit.js @@ -98,6 +98,8 @@ Ext.define('PBS.window.SyncJobEdit', { subject: gettext('SyncJob'), + bodyPadding: 0, + fieldDefaults: { labelWidth: 120 }, defaultFocus: 'proxmoxtextfield[name=comment]', @@ -118,117 +120,142 @@ Ext.define('PBS.window.SyncJobEdit', { }, items: { - xtype: 'inputpanel', - onGetValues: function(values) { - let me = this; - - if (!values.id && me.up('pbsSyncJobEdit').isCreate) { - values.id = 's-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 13); - } - if (!me.isCreate) { - PBS.Utils.delete_if_default(values, 'rate-in'); - if (typeof values.delete === 'string') { - values.delete = values.delete.split(','); - } - } - return values; - }, - column1: [ - { - xtype: 'pmxDisplayEditField', - fieldLabel: gettext('Local Datastore'), - name: 'store', - submitValue: true, - cbind: { - editable: '{editDatastore}', - value: '{datastore}', - }, - editConfig: { - xtype: 'pbsDataStoreSelector', - allowBlank: false, - }, - }, - { - fieldLabel: gettext('Local Owner'), - xtype: 'pbsAuthidSelector', - name: 'owner', - cbind: { - value: '{authid}', - deleteEmpty: '{!isCreate}', - }, - }, + xtype: 'tabpanel', + bodyPadding: 10, + border: 0, + items: [ { - fieldLabel: gettext('Remove vanished'), - xtype: 'proxmoxcheckbox', - name: 'remove-vanished', - autoEl: { - tag: 'div', - 'data-qtip': gettext('Remove snapshots from local datastore if they vanished from source datastore?'), + title: 'Options', + xtype: 'inputpanel', + onGetValues: function(values) { + let me = this; + + if (!values.id && me.up('pbsSyncJobEdit').isCreate) { + values.id = 's-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 13); + } + if (!me.isCreate) { + PBS.Utils.delete_if_default(values, 'rate-in'); + if (typeof values.delete === 'string') { + values.delete = values.delete.split(','); + } + } + return values; }, - uncheckedValue: false, - value: false, - }, - ], + column1: [ + { + xtype: 'pmxDisplayEditField', + fieldLabel: gettext('Local Datastore'), + name: 'store', + submitValue: true, + cbind: { + editable: '{editDatastore}', + value: '{datastore}', + }, + editConfig: { + xtype: 'pbsDataStoreSelector', + allowBlank: false, + }, + }, + { + fieldLabel: gettext('Local Owner'), + xtype: 'pbsAuthidSelector', + name: 'owner', + cbind: { + value: '{authid}', + deleteEmpty: '{!isCreate}', + }, + }, + { + fieldLabel: gettext('Remove vanished'), + xtype: 'proxmoxcheckbox', + name: 'remove-vanished', + autoEl: { + tag: 'div', + 'data-qtip': gettext('Remove snapshots from local datastore if they vanished from source datastore?'), + }, + uncheckedValue: false, + value: false, + }, + ], - column2: [ - { - fieldLabel: gettext('Source Remote'), - xtype: 'pbsRemoteSelector', - allowBlank: false, - name: 'remote', - listeners: { - change: function(f, value) { - let me = this; - let remoteStoreField = me.up('pbsSyncJobEdit').down('field[name=remote-store]'); - remoteStoreField.setRemote(value); + column2: [ + { + fieldLabel: gettext('Source Remote'), + xtype: 'pbsRemoteSelector', + allowBlank: false, + name: 'remote', + listeners: { + change: function(f, value) { + let me = this; + let remoteStoreField = me.up('pbsSyncJobEdit').down('field[name=remote-store]'); + remoteStoreField.setRemote(value); + }, + }, }, - }, - }, - { - fieldLabel: gettext('Source Datastore'), - xtype: 'pbsRemoteStoreSelector', - allowBlank: false, - autoSelect: false, - name: 'remote-store', - disabled: true, - }, - { - fieldLabel: gettext('Sync Schedule'), - xtype: 'pbsCalendarEvent', - name: 'schedule', - emptyText: gettext('none (disabled)'), - cbind: { - deleteEmpty: '{!isCreate}', - value: '{scheduleValue}', - }, - }, - { - xtype: 'pmxBandwidthField', - name: 'rate-in', - fieldLabel: gettext('Rate Limit'), - emptyText: gettext('Unlimited'), - submitAutoScaledSizeUnit: true, - // NOTE: handle deleteEmpty in onGetValues due to bandwidth field having a cbind too - }, - ], + { + fieldLabel: gettext('Source Datastore'), + xtype: 'pbsRemoteStoreSelector', + allowBlank: false, + autoSelect: false, + name: 'remote-store', + disabled: true, + listeners: { + change: function(field, value) { + let me = this; + let remoteField = me.up('pbsSyncJobEdit').down('field[name=remote]'); + let remote = remoteField.getValue(); + me.up('tabpanel').down('pbsGroupFilter').setRemoteDatastore(remote, value); + }, + }, + }, + { + fieldLabel: gettext('Sync Schedule'), + xtype: 'pbsCalendarEvent', + name: 'schedule', + emptyText: gettext('none (disabled)'), + cbind: { + deleteEmpty: '{!isCreate}', + value: '{scheduleValue}', + }, + }, + { + xtype: 'pmxBandwidthField', + name: 'rate-in', + fieldLabel: gettext('Rate Limit'), + emptyText: gettext('Unlimited'), + submitAutoScaledSizeUnit: true, + // NOTE: handle deleteEmpty in onGetValues due to bandwidth field having a cbind too + }, + ], - columnB: [ - { - fieldLabel: gettext('Backup Groups'), - xtype: 'displayfield', - name: 'group-filter', - renderer: v => v ? Ext.String.htmlEncode(v) : gettext('All'), - cbind: { - hidden: '{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