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 42DD91FF0A7 for ; Tue, 18 Aug 2026 15:34:58 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1D63121605; Tue, 18 Aug 2026 15:34:21 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v2 9/9] ui: firewall: aliases: add controls to update/delete references on edit Date: Tue, 18 Aug 2026 15:34:13 +0200 Message-ID: <20260818133413.450776-10-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.591 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: LMAG25SYME4VR4YY73K3F2RZHAKM2M7V X-Message-ID-Hash: LMAG25SYME4VR4YY73K3F2RZHAKM2M7V 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 alias, and replace the plain remove button with a confirmation dialog to delete referencing rules along with the alias. 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/grid/FirewallAliases.js | 74 +++++++++++++++++++--------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/www/manager6/grid/FirewallAliases.js b/www/manager6/grid/FirewallAliases.js index 06801d33..f3a20fc5 100644 --- a/www/manager6/grid/FirewallAliases.js +++ b/www/manager6/grid/FirewallAliases.js @@ -20,27 +20,43 @@ Ext.define('PVE.FirewallAliasEdit', { me.method = 'PUT'; } + let items = [ + { + xtype: 'textfield', + name: me.isCreate ? 'name' : 'rename', + fieldLabel: gettext('Name'), + allowBlank: false, + }, + { + xtype: 'textfield', + name: 'cidr', + fieldLabel: gettext('IP/CIDR'), + allowBlank: false, + }, + { + xtype: 'textfield', + name: 'comment', + fieldLabel: gettext('Comment'), + }, + ]; + if (!me.isCreate) { + items.push({ + xtype: 'pveFirewallUpdateReferences', + noTip: gettext( + 'Do not update referencing rules and IPSets when renaming this alias. Note that this will render any reference to this alias invalid.', + ), + yesTip: gettext( + 'Update referencing rules and IPSets to point to the new alias name.', + ), + forceTip: gettext( + 'Update referencing rules and IPSets to point to the new alias name, overwriting any pre-existing alias with the target name. Can be used in case a failed rename left the cluster configuration in a partially-updated state.', + ), + }); + } + let ipanel = Ext.create('Proxmox.panel.InputPanel', { isCreate: me.isCreate, - items: [ - { - xtype: 'textfield', - name: me.isCreate ? 'name' : 'rename', - fieldLabel: gettext('Name'), - allowBlank: false, - }, - { - xtype: 'textfield', - name: 'cidr', - fieldLabel: gettext('IP/CIDR'), - allowBlank: false, - }, - { - xtype: 'textfield', - name: 'comment', - fieldLabel: gettext('Comment'), - }, - ], + items, }); Ext.apply(me, { @@ -158,15 +174,29 @@ Ext.define('PVE.FirewallAliases', { }, }); - me.removeBtn = Ext.create('Proxmox.button.StdRemoveButton', { + me.removeBtn = Ext.create('Proxmox.button.Button', { + text: gettext('Remove'), disabled: true, + dangerous: true, selModel: sm, enableFn: (rec) => !!caps.vms['VM.Config.Network'] || !!caps.dc['Sys.Modify'] || !!caps.nodes['Sys.Modify'], - 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 alias '{0}'"), + rec.data.name, + ), + refsTip: gettext( + 'Delete all firewall rules and IPSets referencing this alias. If left unchecked, some firewall configurations may end with dangling references.', + ), + apiCallDone: reload, + }).show(); + }, }); Ext.apply(me, { -- 2.47.3