From: Dominik Csapak <d.csapak@proxmox.com>
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 [thread overview]
Message-ID: <20260520132533.3060077-1-d.csapak@proxmox.com> (raw)
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 <d.csapak@proxmox.com>
---
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
next reply other threads:[~2026-05-20 13:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 13:24 Dominik Csapak [this message]
2026-05-20 14:14 ` applied: [PATCH manager v2] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260520132533.3060077-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.