From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 3B94B1FF0AA for ; Tue, 17 Nov 2026 19:36:00 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E2F4E2168A; Tue, 17 Nov 2026 19:35:26 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v2 10/11] ui: fabric content: add wireguard protocol Date: Tue, 17 Nov 2026 19:34:57 +0100 Message-ID: <20261117183500.750636-11-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261117183500.750636-1-s.hanreich@proxmox.com> References: <20261117183500.750636-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794940507737 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.258 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) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: NVMDEKAPOUJM3CEUUCWW3UE4N3F4FIGB X-Message-ID-Hash: NVMDEKAPOUJM3CEUUCWW3UE4N3F4FIGB X-MailFrom: s.hanreich@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: WireGuard returns a lot of additional options compared to the other, FRR-based, fabric types. Hide the routes panel completely and change the neighbor / interface panel to add the additional columns if the fabric has the type wireguard. Signed-off-by: Stefan Hanreich --- www/manager6/sdn/FabricsContentView.js | 179 +++++++++++++++++++------ www/manager6/sdn/NetworkBrowser.js | 40 +++--- 2 files changed, 160 insertions(+), 59 deletions(-) diff --git a/www/manager6/sdn/FabricsContentView.js b/www/manager6/sdn/FabricsContentView.js index 47e8bce7..bbe4b77e 100644 --- a/www/manager6/sdn/FabricsContentView.js +++ b/www/manager6/sdn/FabricsContentView.js @@ -28,50 +28,149 @@ Ext.define('PVE.sdn.FabricNeighborsContentView', { extend: 'Ext.grid.GridPanel', alias: 'widget.pveSDNFabricNeighborsContentView', - columns: [ - { - header: gettext('Neighbor'), - sortable: true, - dataIndex: 'neighbor', - flex: 1, - }, - { - header: gettext('Status'), - sortable: true, - dataIndex: 'status', - flex: 0.5, - }, - { - header: gettext('Uptime'), - sortable: true, - dataIndex: 'uptime', - flex: 0.5, - }, - ], + protocol: null, + + initComponent: function () { + let me = this; + + me.columns = [ + { + header: gettext('Neighbor'), + sortable: true, + dataIndex: 'neighbor', + flex: 1, + }, + ]; + + if (me.protocol === 'wireguard') { + me.columns.unshift({ + header: gettext('Name'), + sortable: true, + dataIndex: 'name', + flex: 1, + }); + + me.columns = me.columns.concat([ + { + header: gettext('Interface'), + sortable: true, + dataIndex: 'interface', + flex: 0.5, + }, + { + header: gettext('Status'), + sortable: true, + dataIndex: 'status', + flex: 0.5, + }, + { + header: gettext('Public Key'), + sortable: true, + dataIndex: 'public-key', + flex: 1, + }, + { + header: gettext('Allowed IPs'), + sortable: true, + dataIndex: 'allowed-ips', + flex: 1, + }, + { + header: gettext('Latest Handshake'), + sortable: true, + dataIndex: 'latest-handshake', + flex: 1, + renderer: function (value) { + if (!value) { + return '-'; + } + + return Proxmox.Utils.render_timestamp(value); + }, + }, + { + header: gettext('Bytes transmitted'), + sortable: true, + dataIndex: 'bytes-tx', + flex: 0.5, + renderer: Proxmox.Utils.render_size, + }, + { + header: gettext('Bytes received'), + sortable: true, + dataIndex: 'bytes-rx', + flex: 0.5, + renderer: Proxmox.Utils.render_size, + }, + ]); + } else { + me.columns = me.columns.concat([ + { + header: gettext('Status'), + sortable: true, + dataIndex: 'status', + flex: 0.5, + }, + { + header: gettext('Uptime'), + sortable: true, + dataIndex: 'uptime', + flex: 0.5, + }, + ]); + } + + me.callParent(); + }, }); Ext.define('PVE.sdn.FabricInterfacesContentView', { extend: 'Ext.grid.GridPanel', alias: 'widget.pveSDNFabricInterfacesContentView', - columns: [ - { - header: gettext('Name'), - sortable: true, - dataIndex: 'name', - flex: 1, - }, - { - header: gettext('Type'), - sortable: true, - dataIndex: 'type', - flex: 1, - }, - { - header: gettext('State'), - sortable: true, - dataIndex: 'state', - flex: 1, - }, - ], + protocol: null, + + initComponent: function () { + let me = this; + + me.columns = [ + { + header: gettext('Name'), + sortable: true, + dataIndex: 'name', + flex: 1, + }, + { + header: gettext('Type'), + sortable: true, + dataIndex: 'type', + flex: 1, + }, + { + header: gettext('State'), + sortable: true, + dataIndex: 'state', + flex: 1, + }, + ]; + + if (me.protocol === 'wireguard') { + me.columns = me.columns.concat([ + { + header: gettext('Public Key'), + sortable: true, + dataIndex: 'public-key', + flex: 1, + }, + { + header: gettext('Listen Port'), + sortable: true, + dataIndex: 'listen-port', + flex: 1, + }, + ]); + } + + me.callParent(); + }, }); diff --git a/www/manager6/sdn/NetworkBrowser.js b/www/manager6/sdn/NetworkBrowser.js index f94b27d3..edb00fb3 100644 --- a/www/manager6/sdn/NetworkBrowser.js +++ b/www/manager6/sdn/NetworkBrowser.js @@ -26,27 +26,29 @@ Ext.define('PVE.network.Browser', { if (networkType === 'fabric') { me.onlineHelp = 'pvesdn_config_fabrics'; - me.items.push({ - nodename: node, - fabricId: name, - protocol: me.pveSelNode.data.protocol, - xtype: 'pveSDNFabricRoutesContentView', - title: gettext('Routes'), - iconCls: 'fa fa-exchange', - itemId: 'routes', - width: '100%', - store: { - proxy: { - type: 'proxmox', - url: `/api2/json/nodes/${node}/sdn/fabrics/${name}/routes`, - reader: { - type: 'json', - rootProperty: 'data', + if (me.pveSelNode.data.protocol !== 'wireguard') { + me.items.push({ + nodename: node, + fabricId: name, + protocol: me.pveSelNode.data.protocol, + xtype: 'pveSDNFabricRoutesContentView', + title: gettext('Routes'), + iconCls: 'fa fa-exchange', + itemId: 'routes', + width: '100%', + store: { + proxy: { + type: 'proxmox', + url: `/api2/json/nodes/${node}/sdn/fabrics/${name}/routes`, + reader: { + type: 'json', + rootProperty: 'data', + }, }, + autoLoad: true, }, - autoLoad: true, - }, - }); + }); + } me.items.push({ nodename: node, -- 2.47.3