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 DFEEF1FF13C for ; Thu, 19 Feb 2026 15:58:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5613A19B75; Thu, 19 Feb 2026 15:57:44 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager 05/11] ui: fabrics: edit: make ipv4/6 support generic over fabric panels Date: Thu, 19 Feb 2026 15:56:38 +0100 Message-ID: <20260219145649.441418-22-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260219145649.441418-1-s.hanreich@proxmox.com> References: <20260219145649.441418-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.176 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 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: VJYBEVMQCYJUDXURSBXCWRVDT7QVL22D X-Message-ID-Hash: VJYBEVMQCYJUDXURSBXCWRVDT7QVL22D X-MailFrom: hoan@cray.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: From: Christoph Heiss This allows selectively enabling IPv4/6 in the child components, without having to re-define the respective fields in every child component. A later commit will introduce the Wireguard fabric, which will have neither a IPv4 nor IPv6 prefix for now, so the option to exclude those fields will be used there as well. Co-authored-by: Stefan Hanreich Signed-off-by: Christoph Heiss --- www/manager6/sdn/fabrics/FabricEdit.js | 68 +++++++++++++++---- .../sdn/fabrics/openfabric/FabricEdit.js | 32 --------- www/manager6/sdn/fabrics/ospf/FabricEdit.js | 2 + 3 files changed, 58 insertions(+), 44 deletions(-) diff --git a/www/manager6/sdn/fabrics/FabricEdit.js b/www/manager6/sdn/fabrics/FabricEdit.js index 07d169287..6111bbb51 100644 --- a/www/manager6/sdn/fabrics/FabricEdit.js +++ b/www/manager6/sdn/fabrics/FabricEdit.js @@ -5,8 +5,18 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', { width: 400, fabricId: undefined, + + hasIpv4Support: true, + hasIpv6Support: true, + baseUrl: '/cluster/sdn/fabrics/fabric', + viewModel: { + data: { + showIpv6ForwardingHint: false, + }, + }, + items: [ { xtype: 'textfield', @@ -24,18 +34,6 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', { disabled: '{!isCreate}', }, }, - { - xtype: 'proxmoxtextfield', - fieldLabel: gettext('IPv4 Prefix'), - labelWidth: 120, - name: 'ip_prefix', - allowBlank: true, - skipEmptyText: true, - cbind: { - disabled: '{!isCreate}', - deleteEmpty: '{!isCreate}', - }, - }, ], additionalItems: [], @@ -53,6 +51,52 @@ Ext.define('PVE.sdn.Fabric.Fabric.Edit', { me.url = me.baseUrl; } + if (me.hasIpv4Support) { + me.items.push({ + xtype: 'proxmoxtextfield', + fieldLabel: gettext('IPv4 Prefix'), + labelWidth: 120, + name: 'ip_prefix', + allowBlank: true, + skipEmptyText: true, + cbind: { + disabled: '{!isCreate}', + deleteEmpty: '{!isCreate}', + }, + }); + } + + if (me.hasIpv6Support) { + me.items.push( + { + xtype: 'displayfield', + value: 'To make IPv6 fabrics work, enable global IPv6 forwarding on all nodes. Click on the Help button for more details.', + bind: { + hidden: '{!showIpv6ForwardingHint}', + }, + userCls: 'pmx-hint', + }, + { + xtype: 'proxmoxtextfield', + fieldLabel: gettext('IPv6 Prefix'), + labelWidth: 120, + name: 'ip6_prefix', + allowBlank: true, + skipEmptyText: true, + cbind: { + disabled: '{!isCreate}', + deleteEmpty: '{!isCreate}', + }, + listeners: { + change: function (textbox, value) { + let vm = textbox.up('window').getViewModel(); + vm.set('showIpv6ForwardingHint', !!value); + }, + }, + }, + ); + } + me.items.push(...me.additionalItems); me.callParent(); diff --git a/www/manager6/sdn/fabrics/openfabric/FabricEdit.js b/www/manager6/sdn/fabrics/openfabric/FabricEdit.js index 14b71fae2..b89764293 100644 --- a/www/manager6/sdn/fabrics/openfabric/FabricEdit.js +++ b/www/manager6/sdn/fabrics/openfabric/FabricEdit.js @@ -4,43 +4,11 @@ Ext.define('PVE.sdn.Fabric.OpenFabric.Fabric.Edit', { subject: 'OpenFabric', onlineHelp: 'pvesdn_openfabric_fabric', - viewModel: { - data: { - showIpv6ForwardingHint: false, - }, - }, - extraRequestParams: { protocol: 'openfabric', }, additionalItems: [ - { - xtype: 'displayfield', - value: 'To make IPv6 fabrics work, enable global IPv6 forwarding on all nodes. Click on the Help button for more details.', - bind: { - hidden: '{!showIpv6ForwardingHint}', - }, - userCls: 'pmx-hint', - }, - { - xtype: 'proxmoxtextfield', - fieldLabel: gettext('IPv6 Prefix'), - labelWidth: 120, - name: 'ip6_prefix', - allowBlank: true, - skipEmptyText: true, - cbind: { - disabled: '{!isCreate}', - deleteEmpty: '{!isCreate}', - }, - listeners: { - change: function (textbox, value) { - let vm = textbox.up('window').getViewModel(); - vm.set('showIpv6ForwardingHint', !!value); - }, - }, - }, { xtype: 'proxmoxintegerfield', // TRANSLATORS: See https://en.wikipedia.org/wiki/IS-IS#Packet_types diff --git a/www/manager6/sdn/fabrics/ospf/FabricEdit.js b/www/manager6/sdn/fabrics/ospf/FabricEdit.js index 4c4e17c99..cbbe8c9c8 100644 --- a/www/manager6/sdn/fabrics/ospf/FabricEdit.js +++ b/www/manager6/sdn/fabrics/ospf/FabricEdit.js @@ -4,6 +4,8 @@ Ext.define('PVE.sdn.Fabric.Ospf.Fabric.Edit', { subject: 'OSPF', onlineHelp: 'pvesdn_ospf_fabric', + hasIpv6Support: false, + extraRequestParams: { protocol: 'ospf', }, -- 2.47.3