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 C6C0C1FF0C2 for ; Thu, 03 Dec 2026 10:59:23 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CEF9F217FE; Thu, 03 Dec 2026 10:58:51 +0100 (CET) From: POYEN Alexis To: pve-devel@lists.proxmox.com Subject: [RFC PATCH manager 3/3] close #4186: ui: backup: add tag based selection mode Date: Thu, 3 Dec 2026 10:27:10 +0100 Message-ID: <20261203092717.1863218-5-alexis.poyen@groupe-cyllene.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261203092717.1863218-1-alexis.poyen@groupe-cyllene.com> References: <20261203092717.1863218-1-alexis.poyen@groupe-cyllene.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 DMARC_PASS -0.1 DMARC pass policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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 X-MailFrom: alexis.poyen@groupe-cyllene.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: SFHWUHBPC6Y72IDSLLWXGLRSJUKZNPIG X-Message-ID-Hash: SFHWUHBPC6Y72IDSLLWXGLRSJUKZNPIG X-Mailman-Approved-At: Thu, 03 Dec 2026 10:58:46 +0100 CC: POYEN Alexis X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add a 'Tag based' mode to the backup job edit window, with a tag field to select the guests to back up. Show the tags of a job in the backup job list. Signed-off-by: POYEN Alexis --- www/manager6/Utils.js | 4 ++++ www/manager6/dc/Backup.js | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index fc3667f5..a6e401de 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -425,6 +425,10 @@ Ext.define('PVE.Utils', { return "Pool '" + record.data.pool + "'"; } + if (record.data.tags) { + return gettext('Tags') + ": " + record.data.tags; + } + return '-'; }, diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js index d3db9d9c..fbb5fa4a 100644 --- a/www/manager6/dc/Backup.js +++ b/www/manager6/dc/Backup.js @@ -50,11 +50,16 @@ Ext.define('PVE.dc.BackupEdit', { delete values.vmid; } else if (selMode === 'pool') { delete values.vmid; + } else if (selMode === 'tag') { + delete values.vmid; } if (selMode !== 'pool') { delete values.pool; } + if (selMode !== 'tag') { + delete values.tags; + } return values; }, @@ -181,6 +186,8 @@ Ext.define('PVE.dc.BackupEdit', { } else if (data.pool) { data.selMode = 'pool'; data.selPool = data.pool; + } else if (data.tags) { + data.selMode = 'tag'; } else { data.selMode = 'include'; } @@ -276,6 +283,7 @@ Ext.define('PVE.dc.BackupEdit', { formulas: { poolMode: (get) => get('selMode') === 'pool', + tagMode: (get) => get('selMode') === 'tag', disableVMSelection: (get) => get('selMode') !== 'include' && get('selMode') !== 'exclude', selectionLabel: function (get) { @@ -340,6 +348,7 @@ Ext.define('PVE.dc.BackupEdit', { ['all', gettext('All')], ['exclude', gettext('Exclude selected VMs')], ['pool', gettext('Pool based')], + ['tag', gettext('Tag based')], ], fieldLabel: gettext('Selection mode'), name: 'selMode', @@ -351,6 +360,17 @@ Ext.define('PVE.dc.BackupEdit', { change: 'modeChange', }, }, + { + xtype: 'pveTagFieldSet', + reference: 'tagSelector', + title: gettext('Tags to backup'), + name: 'tags', + hidden: true, + bind: { + hidden: '{!tagMode}', + disabled: '{!tagMode}', + }, + }, { xtype: 'pvePoolSelector', reference: 'poolSelector', @@ -971,6 +991,7 @@ Ext.define( 'prune-backups', 'starttime', 'storage', + 'tags', 'vmid', { name: 'enabled', type: 'boolean' }, { name: 'all', type: 'boolean' }, -- 2.53.0