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 6651C1FF0C2 for ; Thu, 22 Oct 2026 14:51:01 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 12AD821AC8; Thu, 22 Oct 2026 14:48:37 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v4 27/27] ui: firewall: groups: add controls for dangling references Date: Thu, 22 Oct 2026 14:47:08 +0200 Message-ID: <20261022124708.429069-28-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261022124708.429069-1-a.bied-charreton@proxmox.com> References: <20261022124708.429069-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: 1792673238236 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.807 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: XGLGQ5YHHSZROVXP53URSKHTXSMKTVU4 X-Message-ID-Hash: XGLGQ5YHHSZROVXP53URSKHTXSMKTVU4 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 'delete'. 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 9ec3951a..fcfb5f95 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -2196,6 +2196,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')], hamigrate: ['HA', gettext('Migrate')], 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