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 B9EB41FF0E7 for ; Thu, 13 Aug 2026 19:11:31 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D085F21B29; Thu, 13 Aug 2026 19:11:14 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 24/28] ui: add retention timespan form and use it for sync job edit window Date: Thu, 13 Aug 2026 19:09:58 +0200 Message-ID: <20260813171002.809441-25-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260813171002.809441-1-c.ebner@proxmox.com> References: <20260813171002.809441-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1786641018303 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.147 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) PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS 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: F2TTC2R522E3HPLZAD44PSTNRWWY3PDD X-Message-ID-Hash: F2TTC2R522E3HPLZAD44PSTNRWWY3PDD 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: Based on the calender event form, the retention timespan form provides some useful template values for snapshot retention to be set on sync jobs. Signed-off-by: Christian Ebner --- www/Makefile | 1 + www/form/RetentionTimespan.js | 21 +++++++++++++++++++++ www/window/SyncJobEdit.js | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 www/form/RetentionTimespan.js diff --git a/www/Makefile b/www/Makefile index 568836455..e14a17507 100644 --- a/www/Makefile +++ b/www/Makefile @@ -56,6 +56,7 @@ JSSRC= \ form/GroupFilter.js \ form/VerifyOutdatedAfter.js \ form/EncryptionKeySelector.js \ + form/RetentionTimespan.js \ data/RunningTasksStore.js \ button/TaskButton.js \ panel/PrunePanel.js \ diff --git a/www/form/RetentionTimespan.js b/www/form/RetentionTimespan.js new file mode 100644 index 000000000..9a84c59a2 --- /dev/null +++ b/www/form/RetentionTimespan.js @@ -0,0 +1,21 @@ +Ext.define('PBS.data.RetentionTimespanTemplates', { + extend: 'Ext.data.Store', + alias: 'store.retentionTimespanTemplates', + + field: ['value', 'text'], + data: [ + { value: '1 day', text: Ext.String.format(gettext('Retain for {0} day'), 1) }, + { value: '4 weeks', text: Ext.String.format(gettext('Retain for {0} weeks'), 4) }, + { value: '1 month', text: Ext.String.format(gettext('Retain for {0} month'), 1) }, + { value: '1 year', text: Ext.String.format(gettext('Retain for {0} year'), 1) }, + ], +}); + +Ext.define('PBS.form.RetentionTimespan', { + extend: 'PBS.form.CalendarEvent', + alias: 'widget.pbsRetentionTimespan', + + store: { + type: 'retentionTimespanTemplates', + }, +}); diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js index 961ce2951..91519f95a 100644 --- a/www/window/SyncJobEdit.js +++ b/www/window/SyncJobEdit.js @@ -231,6 +231,15 @@ Ext.define('PBS.window.SyncJobEdit', { // NOTE: handle deleteEmpty in onGetValues due to bandwidth field having a cbind too, // further hide rate limit field depending on sync direction in controller init. }, + { + xtype: 'pbsRetentionTimespan', + name: 'retention-timespan', + fieldLabel: gettext('Retention Timespan'), + emptyText: gettext('keep retention from snapshot'), + cbind: { + deleteEmpty: '{!isCreate}', + }, + }, ], column2: [ -- 2.47.3