* [PATCH manager v2] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns
@ 2026-05-20 13:24 Dominik Csapak
2026-05-20 14:14 ` applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2026-05-20 13:24 UTC (permalink / raw)
To: pve-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* applied: [PATCH manager v2] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns
2026-05-20 13:24 [PATCH manager v2] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns Dominik Csapak
@ 2026-05-20 14:14 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-05-20 14:14 UTC (permalink / raw)
To: pve-devel, Dominik Csapak
On Wed, 20 May 2026 15:24:46 +0200, Dominik Csapak wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns
commit: 7ecaaa9953235d0cad0d64bb26da022e5330e034
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-20 14:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 13:24 [PATCH manager v2] ui: sdn: fabrics: node edit: prevent adding multiple ipv6 columns Dominik Csapak
2026-05-20 14:14 ` applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox