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 F38611FF0C2 for ; Thu, 22 Oct 2026 14:49:30 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2097B21874; Thu, 22 Oct 2026 14:48:32 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v4 21/27] ui: firewall: ipset: add controls for dangling references Date: Thu, 22 Oct 2026 14:47:02 +0200 Message-ID: <20261022124708.429069-22-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: 1792673237891 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.870 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: AMN3ELYULYGEIGIM5JZZAS5FAEPMZHF3 X-Message-ID-Hash: AMN3ELYULYGEIGIM5JZZAS5FAEPMZHF3 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 shared dangling-references action selector to the update dialog and replace the plain remove button with a confirmation dialog carrying the same selector to let users choose how to handle dangling references on config changes. 'force-rename' is not offered. It is meant as an escape hatch to recover from a partially applied rename, putting it next to the normal actions makes it too easy to select. StdRemoveButton cannot pass the extra 'dangling-references' parameter, so the remove button is switched to a plain button that opens the shared FirewallObjectRemove dialog. Signed-off-by: Arthur Bied-Charreton --- www/manager6/panel/IPSet.js | 80 +++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/www/manager6/panel/IPSet.js b/www/manager6/panel/IPSet.js index d510ae6d..40c1ef4b 100644 --- a/www/manager6/panel/IPSet.js +++ b/www/manager6/panel/IPSet.js @@ -67,11 +67,7 @@ Ext.define('PVE.IPSetList', { if (!rec || !canEdit) { return; } - var win = Ext.create('Proxmox.window.Edit', { - subject: "IPSet '" + rec.data.name + "'", - url: me.base_url, - method: 'POST', - digest: rec.data.digest, + var ipanel = Ext.create('Proxmox.panel.InputPanel', { items: [ { xtype: 'hiddenfield', @@ -92,6 +88,45 @@ Ext.define('PVE.IPSetList', { fieldLabel: gettext('Comment'), }, ], + advancedItems: [ + { + xtype: 'pveFirewallReferenceAction', + preferredValue: 'rename', + referenceActions: [ + { + text: gettext('Keep'), + value: 'keep', + description: gettext('Do not touch firewall rules referencing this IPSet.'), + }, + { + text: gettext('Disable'), + value: 'disable', + description: gettext('Disable firewall rules referencing this IPSet.'), + }, + { + text: gettext('Delete'), + value: 'drop', + description: gettext('Delete firewall rules referencing this IPSet.'), + }, + { + text: gettext('Rename'), + value: 'rename', + description: gettext( + 'Rewrite references to this IPSet to point to the new name.', + ), + }, + ], + }, + ], + }); + + var win = Ext.create('Proxmox.window.Edit', { + subject: "IPSet '" + rec.data.name + "'", + url: me.base_url, + method: 'POST', + digest: rec.data.digest, + onlineHelp: 'pve_firewall_dangling_references', + items: [ipanel], }); win.show(); win.on('destroy', reload); @@ -134,11 +169,40 @@ Ext.define('PVE.IPSetList', { }, }); - me.removeBtn = Ext.create('Proxmox.button.StdRemoveButton', { + me.removeBtn = Ext.create('Proxmox.button.Button', { + text: gettext('Remove'), + disabled: true, + dangerous: true, enableFn: (rec) => canEdit, selModel: sm, - baseurl: me.base_url + '/', - callback: reload, + handler: function (btn, event, rec) { + Ext.create('PVE.window.FirewallObjectRemove', { + item: { id: rec.data.name }, + url: me.base_url + '/' + rec.data.name, + text: Ext.String.format( + gettext("Are you sure you want to remove IPSet '{0}'"), + rec.data.name, + ), + referenceActions: [ + { + text: gettext('Keep'), + value: 'keep', + description: gettext('Do not touch firewall rules referencing this IPSet.'), + }, + { + text: gettext('Disable'), + value: 'disable', + description: gettext('Disable firewall rules referencing this IPSet.'), + }, + { + text: gettext('Delete'), + value: 'drop', + description: gettext('Delete firewall rules referencing this IPSet.'), + }, + ], + apiCallDone: reload, + }).show(); + }, }); Ext.apply(me, { -- 2.47.3