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 64AB91FF0B6 for ; Thu, 12 Nov 2026 16:14:37 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 391B7219F0; Thu, 12 Nov 2026 16:11:42 +0100 (CET) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v7 26/28] ui: firewall: groups: add controls for dangling references Date: Thu, 12 Nov 2026 16:10:43 +0100 Message-ID: <20261112151045.577923-27-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112151045.577923-1-a.bied-charreton@proxmox.com> References: <20261112151045.577923-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794496255852 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.558 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: LJN6XZBXMUF7B6VRLMEOPBMEEOQM2VVW X-Message-ID-Hash: LJN6XZBXMUF7B6VRLMEOPBMEEOQM2VVW X-MailFrom: a.bied-charreton@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add the reference action selector the ipset and alias dialogs have for security groups as well. The edit dialog has it in its advanced section, preselected to 'rename'. The remove button becomes a FirewallObjectRemove, preselected to 'drop'. Both dialogs wait on the task the API returns. Signed-off-by: Arthur Bied-Charreton --- www/manager6/Utils.js | 2 + www/manager6/dc/SecurityGroups.js | 81 +++++++++++++++++++++++++++++-- 2 files changed, 79 insertions(+), 4 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index f44b8c90..b585d85e 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2221,6 +2221,8 @@ Ext.define('PVE.Utils', { download: [gettext('File'), gettext('Download')], 'fw-alias-delete': [gettext('Firewall Alias'), gettext('Delete')], 'fw-alias-rename': [gettext('Firewall Alias'), gettext('Rename')], + 'fw-group-delete': [gettext('Firewall Security Group'), gettext('Delete')], + 'fw-group-rename': [gettext('Firewall Security Group'), gettext('Rename')], 'fw-ipset-delete': [gettext('Firewall IPSet'), gettext('Delete')], 'fw-ipset-rename': [gettext('Firewall IPSet'), gettext('Rename')], 'fw-sdn-ipset-refs': [gettext('Firewall SDN IPSets'), gettext('Update References')], diff --git a/www/manager6/dc/SecurityGroups.js b/www/manager6/dc/SecurityGroups.js index a1454003..43a154ff 100644 --- a/www/manager6/dc/SecurityGroups.js +++ b/www/manager6/dc/SecurityGroups.js @@ -12,6 +12,10 @@ Ext.define('PVE.SecurityGroupEdit', { allow_iface: false, + showProgress: true, + + onlineHelp: 'pve_firewall_dangling_references', + initComponent: function () { var me = this; @@ -49,10 +53,43 @@ Ext.define('PVE.SecurityGroupEdit', { }); } + let advancedItems = []; + if (!me.isCreate) { + advancedItems.push({ + xtype: 'pveFirewallReferenceAction', + preferredValue: 'rename', + referenceActions: [ + { + text: gettext('Keep'), + value: 'keep', + description: gettext('Do not touch firewall rules referencing this security group.'), + }, + { + text: gettext('Disable'), + value: 'disable', + description: gettext('Disable firewall rules referencing this security group.'), + }, + { + text: gettext('Delete'), + value: 'drop', + description: gettext('Delete firewall rules referencing this security group.'), + }, + { + text: gettext('Rename'), + value: 'rename', + description: gettext( + 'Rewrite referencing firewall rules to point to the new security group name.', + ), + }, + ], + }); + } + var ipanel = Ext.create('Proxmox.panel.InputPanel', { // InputPanel does not have a 'create' property, does it need a 'isCreate' isCreate: me.isCreate, items: items, + advancedItems: advancedItems.length ? advancedItems : undefined, }); Ext.apply(me, { @@ -148,11 +185,47 @@ Ext.define('PVE.SecurityGroupList', { }, }); - me.removeBtn = Ext.create('Proxmox.button.StdRemoveButton', { + me.removeBtn = new Proxmox.button.Button({ + text: gettext('Remove'), + disabled: true, + dangerous: true, selModel: sm, - baseurl: me.base_url + '/', - enableFn: (rec) => canEdit && rec && me.base_url, - callback: () => reload(), + enableFn: (rec) => canEdit && !!rec, + handler: function (btn, event, rec) { + Ext.create('PVE.window.FirewallObjectRemove', { + item: { id: rec.data.group }, + url: me.base_url + '/' + rec.data.group, + text: Ext.String.format( + gettext("Are you sure you want to remove security group '{0}'"), + rec.data.group, + ), + referenceActions: [ + { + text: gettext('Keep'), + value: 'keep', + description: gettext( + 'Do not touch firewall rules referencing this security group.', + ), + }, + { + text: gettext('Disable'), + value: 'disable', + description: gettext( + 'Disable firewall rules referencing this security group.', + ), + }, + { + text: gettext('Delete'), + value: 'drop', + description: gettext( + 'Delete firewall rules referencing this security group.', + ), + }, + ], + apiCallDone: reload, + taskDone: reload, + }).show(); + }, }); Ext.apply(me, { -- 2.47.3