From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 3305F1FF13B for ; Wed, 20 May 2026 15:25:39 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5A3278812; Wed, 20 May 2026 15:25:37 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns Date: Wed, 20 May 2026 15:24:46 +0200 Message-ID: <20260520132533.3060077-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.050 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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: TWEGBNWDZSYJE4FWKROXZ57HGTURRBFA X-Message-ID-Hash: TWEGBNWDZSYJE4FWKROXZ57HGTURRBFA X-MailFrom: d.csapak@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: modifying a class member is always dangerous, since it modifies the object on the original class prototype, so pushing into it happens on every instance creation. This means every time 'Add Node' is clicked for a fabric with ipv6 support another ipv6 column is added. To prevent this, copy the list of common columns in initComponent and push into that instead. Slightly changes the handling of additionalColumns so we don't copy the common columns again with 'concat'. Signed-off-by: Dominik Csapak --- changes from v1: * don't move the commonColumns out of the class definition but only copy it in initComponent, don't modify the original. www/manager6/sdn/fabrics/InterfacePanel.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/manager6/sdn/fabrics/InterfacePanel.js b/www/manager6/sdn/fabrics/InterfacePanel.js index 5632104a..303376e4 100644 --- a/www/manager6/sdn/fabrics/InterfacePanel.js +++ b/www/manager6/sdn/fabrics/InterfacePanel.js @@ -110,8 +110,10 @@ Ext.define('PVE.sdn.Fabric.InterfacePanel', { initComponent: function () { let me = this; + let columns = [...me.commonColumns]; + if (me.hasIpv6Support) { - me.commonColumns.push({ + columns.push({ text: gettext('IPv6'), xtype: 'widgetcolumn', dataIndex: 'ip6', @@ -126,6 +128,10 @@ Ext.define('PVE.sdn.Fabric.InterfacePanel', { }); } + if (me.additionalColumns.length > 0) { + columns.push(...me.additionalColumns); + } + Ext.apply(me, { store: Ext.create('Ext.data.Store', { model: 'Pve.sdn.Interface', @@ -134,7 +140,7 @@ Ext.define('PVE.sdn.Fabric.InterfacePanel', { direction: 'ASC', }, }), - columns: me.commonColumns.concat(me.additionalColumns), + columns, }); me.callParent(); -- 2.47.3