From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 9FF1D1FF0BC for ; Thu, 29 Oct 2026 11:25:55 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B7F4A20BCB; Thu, 29 Oct 2026 11:25:54 +0100 (CET) Message-ID: <28cb984c-b3d2-4dc6-8912-26f7c61bcad2@proxmox.com> Date: Thu, 29 Oct 2026 11:25:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH proxmox-backup v4 4/9] ui: prune job: align prune edit window to other "Enable" checkboxes To: pbs-devel@lists.proxmox.com, Christian Ebner References: <20261022164343.353831-1-j.theisen@proxmox.com> <20261022164343.353831-5-j.theisen@proxmox.com> Content-Language: en-US From: Jonas Theisen In-Reply-To: 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: 1793269551255 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.112 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: 4U255WEAQF3IOPQ77J2FODLX7OFLG6JQ X-Message-ID-Hash: 4U255WEAQF3IOPQ77J2FODLX7OFLG6JQ X-MailFrom: j.theisen@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/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? > > 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. > >>               }, >>           ], >