From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 18FE31FF0B7 for ; Fri, 30 Oct 2026 09:39:21 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6157A20B76; Fri, 30 Oct 2026 09:39:20 +0100 (CET) Message-ID: Date: Fri, 30 Oct 2026 09:39:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup v4 4/9] ui: prune job: align prune edit window to other "Enable" checkboxes To: Jonas Theisen , pbs-devel@lists.proxmox.com References: <20261022164343.353831-1-j.theisen@proxmox.com> <20261022164343.353831-5-j.theisen@proxmox.com> <28cb984c-b3d2-4dc6-8912-26f7c61bcad2@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <28cb984c-b3d2-4dc6-8912-26f7c61bcad2@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793349554835 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.660 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: WRCDVT5QYDF6YXOKPZH6PNCUZ722EEMU X-Message-ID-Hash: WRCDVT5QYDF6YXOKPZH6PNCUZ722EEMU X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 10/29/26 11:25 AM, Jonas Theisen wrote: > On 10/27/26 13:48, Christian Ebner wrote: >> On 10/22/26 6:44 PM, Jonas Theisen wrote: >>> Align the already existing "Enabled" checkbox in the prune job edit >>> window to the "Enable" checkboxes of the other job types: rename it >>> to "Enable", as is more common throughout the UI, add the same >>> tooltip, and disable the schedule field while the checkbox is >>> unchecked. >>> >>> Signed-off-by: Jonas Theisen >>> --- >>>   www/window/PruneJobEdit.js | 32 ++++++++++++++++++++++++++++---- >>>   1 file changed, 28 insertions(+), 4 deletions(-) >>> >>> diff --git a/www/window/PruneJobEdit.js b/www/window/PruneJobEdit.js >>> index a3dafde21..63f736570 100644 >>> --- a/www/window/PruneJobEdit.js >>> +++ b/www/window/PruneJobEdit.js >>> @@ -43,6 +43,21 @@ Ext.define('PBS.window.PruneJobEdit', { >>>           }, >>>       }, >>>   +    viewModel: { >>> +        data: { >>> +            jobEnabled: true, >>> +        }, >>> +    }, >>> + >>> +    setValues: function (values) { >>> +        let me = this; >>> + >>> +        if (!values.schedule) { >>> +            values.disable = true; >>> +        } >>> +        me.callParent([values]); >>> +    }, >>> + >>>       items: { >>>           xtype: 'inputpanel', >>>           onGetValues: function (values) { >>> @@ -115,14 +130,23 @@ Ext.define('PBS.window.PruneJobEdit', { >>>                   cbind: { >>>                       value: '{scheduleValue}', >>>                   }, >>> +                bind: { >>> +                    disabled: '{!jobEnabled}', >>> +                }, >>>               }, >>>               { >>>                   xtype: 'proxmoxcheckbox', >>> -                fieldLabel: gettext('Enabled'), >>> +                fieldLabel: gettext('Enable'), >>>                   name: 'enable', >>> -                uncheckedValue: 0, >>> -                defaultValue: 1, >>> -                checked: true, >>> +                autoEl: { >>> +                    tag: 'div', >>> +                    'data-qtip': gettext('Enable scheduled execution >>> of this job.'), >>> +                }, >>> +                bind: { >>> +                    value: '{jobEnabled}', >>> +                }, >>> +                uncheckedValue: false, >>> +                value: true, >> >> comment: no need to explicitly set the value to true, as the value has >> already the binding to `jobEnabled`. > > Implemented that change locally and ran into an issue that without the > values explicitly set, the setValues call to disable the checkbox if no > schedule is present sometimes does not work. > This seems to be due to the fact that the viewModel is bound > asynchronously and if the GET for the job config finished before that > the setValues change is never written to the viewModel and such the > default is applied. > Should i keep the explicit value setting or how should i work around that? Ack, fine by me if kept, but would add an explicit comment then on why this is required. Alternatively this could be solved by using formulas for the `enable` -> `disable` mapping and use a hidden field for the `disable` submit value, and setting `submitValue: false` on the `enable` field. But haven't verified myself (yet). >> >> Further, the onGetValues() and onSetValues() implementation here, used >> to replace `enable` with the `disable` for the submit values might be >> factored out to PBS.Utils and reused for the other job edit windows, >> as introduced by patch 7. > > Ack! Will factor these out and reuse them. >> >>>               }, >>>           ], >> >