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 305941FF16F for ; Tue, 22 Jul 2025 11:24:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 94D3E34440; Tue, 22 Jul 2025 11:25:52 +0200 (CEST) Mime-Version: 1.0 Date: Tue, 22 Jul 2025 11:25:19 +0200 Message-Id: From: "Lukas Wagner" To: "Christian Ebner" , X-Mailer: aerc 0.20.1-0-g2ecb8770224a References: <20250715125332.954494-1-c.ebner@proxmox.com> <20250715125332.954494-37-c.ebner@proxmox.com> <7bb55d70-bc35-4fd4-b6e1-14c771263593@proxmox.com> <96d44987-670f-4f8b-a642-4df70ac1bff7@proxmox.com> In-Reply-To: <96d44987-670f-4f8b-a642-4df70ac1bff7@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753176311274 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 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 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 27/45] ui: add s3 client selector and bucket field for s3 backend setup 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 Sat Jul 19, 2025 at 2:28 PM CEST, Christian Ebner wrote: > On 7/18/25 12:02 PM, Lukas Wagner wrote: >>> listeners: { >>> change: function (checkbox, selected) { >>> let isRemovable = selected === 'removable'; >>> + let isS3 = selected === 's3'; >>> >>> let inputPanel = checkbox.up('inputpanel'); >>> let pathField = inputPanel.down('[name=path]'); >>> let uuidEditField = inputPanel.down('[name=backing-device]'); >>> + let bucketField = inputPanel.down('[name=bucket]'); >>> + let s3ClientSelector = inputPanel.down('[name=s3client]'); >>> >>> uuidEditField.setDisabled(!isRemovable); >>> uuidEditField.allowBlank = !isRemovable; >>> uuidEditField.setValue(''); >>> >>> + bucketField.setDisabled(!isS3); >>> + bucketField.allowBlank = !isS3; >>> + bucketField.setValue(''); >>> + >>> + s3ClientSelector.setDisabled(!isS3); >>> + s3ClientSelector.allowBlank = !isS3; >>> + s3ClientSelector.setValue(''); >>> + >>> if (isRemovable) { >>> pathField.setFieldLabel(gettext('Path on Device')); >>> pathField.setEmptyText(gettext('A relative path')); >>> + } else if (isS3) { >>> + pathField.setFieldLabel(gettext('Store Cache')); >>> + pathField.setEmptyText(gettext('An absolute path')); >>> } else { >>> pathField.setFieldLabel(gettext('Backing Path')); >>> pathField.setEmptyText(gettext('An absolute path')); >> >> Yup, with these additional changes I'd definitely prefer the viewModel approach mentioned earlier :) > > Well... I did check this out, also based on the off-list input you gave > me on this one, but unfortunately the viewModel and binding approach > does not work just yet, since the `pmxDisplayField` xtype used for the > `path` does not implement the logic for bindings of the `fieldLabel` and > `emtpyText`. Therefore these cannot be dynamically adapted by the use of > formulas and/or view model data. > > So I would like to rather do this as followup instead, to not further > delay the path series until I've figured out how to correctly add these > as bindable values in the corresponding component. > > But I do see the benefits of the viewModel and formulas approach, thanks > a lot for your input on that. As a workaround we could just keep the fieldLabel and emptyText static and use separate fields that are hidden/shown on demand, supported by the view model. Might need some additional code in onSetValues and/or onGetValues to then map these fields to the correct parameter in the end. But as you said, this is definitely material for a follow-up, no pressure now. _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel