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 0DCA01FF0B6 for ; Wed, 30 Sep 2026 17:22:19 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BA0EF2162C; Wed, 30 Sep 2026 17:22:18 +0200 (CEST) From: Jonas Theisen To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 06/14] fix #7904: Implement "Enable" checkbox for Verify jobs Date: Wed, 30 Sep 2026 17:18:04 +0200 Message-ID: <20260930152131.317493-7-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260930152131.317493-1-j.theisen@proxmox.com> References: <20260930152131.317493-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1790781733578 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.230 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: SNQPMW2XTBPIC5IBSEM6TYJIXTAF6KDS X-Message-ID-Hash: SNQPMW2XTBPIC5IBSEM6TYJIXTAF6KDS 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: To allow users to disable a verify job without having to remove the schedule this patch introduces an "Enable" checkbox. The value is inserted into the job config and honored by the scheduler by skipping disabled jobs altogether. If the value is not present in a job config it is assumed the job is to be enabled for backwards compatibility. If the job is disabled the schedule input box in the UI is also disabled and such is configured to not allow empty inputs anymore. Signed-off-by: Jonas Theisen --- src/api2/admin/verify.rs | 10 +++++++++- src/api2/config/verify.rs | 3 +++ src/bin/proxmox-backup-proxy.rs | 8 ++++++++ www/window/VerifyJobEdit.js | 30 ++++++++++++++++++++++++++++-- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/api2/admin/verify.rs b/src/api2/admin/verify.rs index 80659ebe2..d19f0f9db 100644 --- a/src/api2/admin/verify.rs +++ b/src/api2/admin/verify.rs @@ -73,7 +73,15 @@ pub fn list_verification_jobs( let mut list = Vec::new(); for job in job_config_iter { - let status = compute_schedule_status("verificationjob", &job.id, job.schedule.as_deref())?; + let mut status = compute_schedule_status("verificationjob", &job.id, job.schedule.as_deref())?; + + let enabled = match job.enable { + Some(c) => c, + None => true, + }; + if !enabled { + status.next_run = Some(0); + } list.push(VerificationJobStatus { config: job, diff --git a/src/api2/config/verify.rs b/src/api2/config/verify.rs index 35be9b175..a0c23841e 100644 --- a/src/api2/config/verify.rs +++ b/src/api2/config/verify.rs @@ -262,6 +262,9 @@ pub fn update_verification_job( if update.schedule.is_some() { data.schedule = update.schedule; } + if let Some(enable) = update.enable { + data.enable = Some(enable); + } if let Some(ns) = update.ns { if !ns.is_root() { data.ns = Some(ns); diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index ddeeff721..af3ebb7a7 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -728,6 +728,14 @@ async fn schedule_datastore_verify_jobs() { None => continue, }; + let job_enabled = match job_config.enable { + Some(c) => c, + None => true, //if not defined assume enabled for backwards compatibility + }; + if !job_enabled { + continue; + } + let worker_type = "verificationjob"; let auth_id = Authid::root_auth_id().clone(); if check_schedule(worker_type, &event_str, &job_id) { diff --git a/www/window/VerifyJobEdit.js b/www/window/VerifyJobEdit.js index b8d8b5810..c8e54e0f2 100644 --- a/www/window/VerifyJobEdit.js +++ b/www/window/VerifyJobEdit.js @@ -80,6 +80,14 @@ Ext.define('PBS.window.VerifyJobEdit', { }, }, + setValues: function (values) { + let me = this; + if (!values.schedule || values.schedule === '') { + values.enable = false; + } + me.callParent([values]); + }, + items: { xtype: 'inputpanel', onGetValues: function (values) { @@ -124,14 +132,32 @@ Ext.define('PBS.window.VerifyJobEdit', { ], column2: [ + { + xtype: 'proxmoxcheckbox', + fieldLabel: gettext('Enable'), + name: 'enable', + autoEl: { + tag: 'div', + 'data-qtip': gettext('Enable scheduled execution of this task.'), + }, + listeners: { + change: function (field, enabled) { + let me = this; + let view = me.up('pbsVerifyJobEdit'); + let schedule = view.down('field[name=schedule]'); + schedule.setDisabled(!enabled); + }, + }, + uncheckedValue: false, + value: true, + }, { xtype: 'pbsCalendarEvent', name: 'schedule', fieldLabel: gettext('Schedule'), - emptyText: gettext('none (disabled)'), + allowBlank: false, cbind: { value: '{scheduleValue}', - deleteEmpty: '{!isCreate}', }, }, { -- 2.47.3