From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 5416A1FF17A for ; Fri, 18 Jul 2025 11:54:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D566F192F9; Fri, 18 Jul 2025 11:55:50 +0200 (CEST) Message-ID: Date: Fri, 18 Jul 2025 11:55:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox Backup Server development discussion , Christian Ebner References: <20250715125332.954494-1-c.ebner@proxmox.com> <20250715125332.954494-33-c.ebner@proxmox.com> Content-Language: de-AT, en-US From: Lukas Wagner In-Reply-To: <20250715125332.954494-33-c.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1752832544233 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.018 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup v8 23/45] ui: add datastore type selector and reorganize component layout 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: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On 2025-07-15 14:53, Christian Ebner wrote: > In preparation for adding the S3 backed datastore variant to the edit > window. Introduce a datastore type selector in order to distinguish > between creation of regular and removable datastores, instead of > using the checkbox as is currently the case. > > This allows to more easily expand for further datastore type variants > while keeping the datastore edit window compact. > > Since selecting the type is one of the first steps during datastore > creation, position the component right below the datastore name field > and re-organize the components related to the removable datastore > creation, while keeping additional required components for the S3 > backed datastore creation in mind. > > Signed-off-by: Christian Ebner > --- > changes since version 7: > - no changes > > www/window/DataStoreEdit.js | 78 +++++++++++++++++++++---------------- > 1 file changed, 45 insertions(+), 33 deletions(-) > > diff --git a/www/window/DataStoreEdit.js b/www/window/DataStoreEdit.js > index 372984e37..cd94f0335 100644 > --- a/www/window/DataStoreEdit.js > +++ b/www/window/DataStoreEdit.js > @@ -52,6 +52,41 @@ Ext.define('PBS.DataStoreEdit', { > allowBlank: false, > fieldLabel: gettext('Name'), > }, > + { > + xtype: 'proxmoxKVComboBox', > + name: 'datastore-type', > + fieldLabel: gettext('Datastore Type'), > + value: '__default__', > + submitValue: false, > + comboItems: [ > + ['__default__', 'Local'], > + ['removable', 'Removable'], These should use gettext > + ], > + cbind: { > + disabled: '{!isCreate}', > + }, > + listeners: { > + change: function (checkbox, selected) { > + let isRemovable = selected === 'removable'; > + > + let inputPanel = checkbox.up('inputpanel'); > + let pathField = inputPanel.down('[name=path]'); > + let uuidEditField = inputPanel.down('[name=backing-device]'); > + > + uuidEditField.setDisabled(!isRemovable); > + uuidEditField.allowBlank = !isRemovable; > + uuidEditField.setValue(''); > + > + if (isRemovable) { > + pathField.setFieldLabel(gettext('Path on Device')); > + pathField.setEmptyText(gettext('A relative path')); > + } else { > + pathField.setFieldLabel(gettext('Backing Path')); > + pathField.setEmptyText(gettext('An absolute path')); > + } > + }, > + }, > + }, I think this could be transformed into a viewModel, bound properties, formulas, etc. while at it, but since this was pre-existing code, it's not too bad IMO. > { > xtype: 'pmxDisplayEditField', > cbind: { > @@ -63,17 +98,6 @@ Ext.define('PBS.DataStoreEdit', { > emptyText: gettext('An absolute path'), > validator: (val) => val?.trim() !== '/', > }, > - { > - xtype: 'pbsPartitionSelector', > - fieldLabel: gettext('Device'), > - name: 'backing-device', > - disabled: true, > - allowBlank: true, > - cbind: { > - editable: '{isCreate}', > - }, > - emptyText: gettext('Device path'), > - }, > ], > column2: [ > { > @@ -97,31 +121,19 @@ Ext.define('PBS.DataStoreEdit', { > value: '{scheduleValue}', > }, > }, > - ], > - columnB: [ > { > - xtype: 'checkbox', > - boxLabel: gettext('Removable datastore'), > - submitValue: false, > - listeners: { > - change: function (checkbox, isRemovable) { > - let inputPanel = checkbox.up('inputpanel'); > - let pathField = inputPanel.down('[name=path]'); > - let uuidEditField = inputPanel.down('[name=backing-device]'); > - > - uuidEditField.setDisabled(!isRemovable); > - uuidEditField.allowBlank = !isRemovable; > - uuidEditField.setValue(''); > - if (isRemovable) { > - pathField.setFieldLabel(gettext('Path on Device')); > - pathField.setEmptyText(gettext('A relative path')); > - } else { > - pathField.setFieldLabel(gettext('Backing Path')); > - pathField.setEmptyText(gettext('An absolute path')); > - } > - }, > + xtype: 'pbsPartitionSelector', > + fieldLabel: gettext('Device'), > + name: 'backing-device', > + disabled: true, > + allowBlank: true, > + cbind: { > + editable: '{isCreate}', > }, > + emptyText: gettext('Device path'), > }, > + ], > + columnB: [ > { > xtype: 'textfield', > name: 'comment', -- - Lukas _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel