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 D4EC01FF0A7 for ; Tue, 18 Aug 2026 15:35:14 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2E41B2164F; Tue, 18 Aug 2026 15:34:24 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v2 8/9] ui: firewall: ipset: add controls to update/delete references on edit Date: Tue, 18 Aug 2026 15:34:12 +0200 Message-ID: <20260818133413.450776-9-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260818133413.450776-1-a.bied-charreton@proxmox.com> References: <20260818133413.450776-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.619 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) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods 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_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: TBD3FSHBJDKJUA64TEZRX3XUPSOSXHTS X-Message-ID-Hash: TBD3FSHBJDKJUA64TEZRX3XUPSOSXHTS X-MailFrom: abied-charreton@jett.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 'update-references' selector to the update dialog, so a rename can (force-)update all references to the ipset, and replace the plain remove button with a confirmation dialog offering to delete referencing rules along with the ipset. StdRemoveButton cannot pass the extra 'delete-references' parameter, so the remove button is switched to a plain button that opens the shared FirewallDeleteReferences dialog. Signed-off-by: Arthur Bied-Charreton --- www/manager6/panel/IPSet.js | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/www/manager6/panel/IPSet.js b/www/manager6/panel/IPSet.js index 9e0203a0..5c7340a7 100644 --- a/www/manager6/panel/IPSet.js +++ b/www/manager6/panel/IPSet.js @@ -91,6 +91,16 @@ Ext.define('PVE.IPSetList', { value: rec.data.comment, fieldLabel: gettext('Comment'), }, + { + xtype: 'pveFirewallUpdateReferences', + noTip: gettext( + 'Do not update referencing rules when renaming this IPSet. Note that this will render any reference to this IPSet invalid.', + ), + yesTip: gettext('Update referencing rules to point to the new IPSet name.'), + forceTip: gettext( + 'Update referencing rules to point to the new IPSet name, overwriting any pre-existing IPSet with the target name. Can be used in case a failed rename left the cluster configuration in a partially-updated state.', + ), + }, ], }); win.show(); @@ -134,11 +144,26 @@ 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.FirewallDeleteReferences', { + 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, + ), + refsTip: gettext( + 'Delete all firewall rules referencing this IPSet. If left unchecked, some firewall configurations may end up with dangling references.', + ), + apiCallDone: reload, + }).show(); + }, }); Ext.apply(me, { -- 2.47.3