From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id DE0741FF14F for ; Wed, 17 Jun 2026 13:12:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D42D131712; Wed, 17 Jun 2026 13:11:15 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager 12/13] ui: fabric content: add wireguard protocol Date: Wed, 17 Jun 2026 13:10:09 +0200 Message-ID: <20260617111012.312710-13-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260617111012.312710-1-s.hanreich@proxmox.com> References: <20260617111012.312710-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: 1781694569103 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.596 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: RN7MYWNQGO2UWTZD35MFCRK2ZCW6RMQL X-Message-ID-Hash: RN7MYWNQGO2UWTZD35MFCRK2ZCW6RMQL 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 | 173 +++++++++++++++++++------ www/manager6/sdn/NetworkBrowser.js | 40 +++--- 2 files changed, 154 insertions(+), 59 deletions(-) diff --git a/www/manager6/sdn/FabricsContentView.js b/www/manager6/sdn/FabricsContentView.js index 47e8bce7f..ebed8eea5 100644 --- a/www/manager6/sdn/FabricsContentView.js +++ b/www/manager6/sdn/FabricsContentView.js @@ -28,50 +28,143 @@ 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('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 f94b27d35..edb00fb38 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