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 792201FF17E for ; Thu, 30 Oct 2025 16:58:55 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C1CE44AB; Thu, 30 Oct 2025 16:59:27 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 30 Oct 2025 16:48:41 +0100 Message-ID: <20251030154851.540408-35-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251030154851.540408-1-s.hanreich@proxmox.com> References: <20251030154851.540408-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.184 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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 Subject: [pve-devel] [PATCH pve-manager 7/8] ui: sdn browser: add mac vrf panel X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" This panel shows the full state of the neighbor table of an EVPN vnet. It is integrated into the SDN browser and only shown for EVPN zones. Signed-off-by: Stefan Hanreich --- www/manager6/Makefile | 1 + www/manager6/sdn/Browser.js | 9 ++ www/manager6/sdn/EvpnZoneMacVrfPanel.js | 130 ++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 www/manager6/sdn/EvpnZoneMacVrfPanel.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 6abc77469..3f7125e1f 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -291,6 +291,7 @@ JSSRC= \ sdn/ZoneContentView.js \ sdn/ZoneContentPanel.js \ sdn/EvpnZoneIpVrfPanel.js \ + sdn/EvpnZoneMacVrfPanel.js \ sdn/FirewallPanel.js \ sdn/FirewallVnetView.js \ sdn/ZoneView.js \ diff --git a/www/manager6/sdn/Browser.js b/www/manager6/sdn/Browser.js index d2e70f32a..8960caf2d 100644 --- a/www/manager6/sdn/Browser.js +++ b/www/manager6/sdn/Browser.js @@ -57,6 +57,15 @@ Ext.define('PVE.sdn.Browser', { iconCls: 'fa fa-th-list', itemId: 'ip-vrf', }); + + me.items.push({ + nodename: nodename, + zone: sdnId, + xtype: 'pveSDNEvpnZoneMacVrfPanel', + title: gettext('MAC-VRFs'), + iconCls: 'fa fa-th-list', + itemId: 'mac-vrfs', + }); } me.callParent(); diff --git a/www/manager6/sdn/EvpnZoneMacVrfPanel.js b/www/manager6/sdn/EvpnZoneMacVrfPanel.js new file mode 100644 index 000000000..0984fdbdc --- /dev/null +++ b/www/manager6/sdn/EvpnZoneMacVrfPanel.js @@ -0,0 +1,130 @@ +Ext.define('PVE.sdn.EvpnZoneMacVrfPanel', { + extend: 'Ext.panel.Panel', + alias: 'widget.pveSDNEvpnZoneMacVrfPanel', + + title: 'MAC-VRFs', + onlineHelp: 'pvesdn_zone_plugin_evpn', + + initComponent: function () { + var me = this; + let nodename = me.nodename; + + var mac_vrf_panel = Ext.createWidget('pveSDNEvpnZoneMacVrfGridPanel', { + title: gettext('VNet MAC-VRF'), + region: 'center', + border: false, + }); + + var vnetview_panel = Ext.createWidget('pveSDNZoneContentView', { + title: gettext('VNets'), + region: 'west', + sub_panel: mac_vrf_panel, + nodename: me.nodename, + zone: me.zone, + + width: '50%', + border: false, + split: true, + + on_select: function (_sm, rec) { + mac_vrf_panel.setVnet(rec.data.vnet, nodename); + }, + + on_deselect: function () { + mac_vrf_panel.clearVnet(); + }, + }); + + Ext.apply(me, { + layout: 'border', + items: [vnetview_panel, mac_vrf_panel], + }); + + me.callParent(); + }, +}); + +Ext.define('MacVrfRoute', { + extend: 'Ext.data.Model', + fields: ['ip', 'metric', 'nexthops', 'protocol'], +}); + +Ext.define('PVE.sdn.EvpnZoneMacVrfGridPanel', { + extend: 'Ext.grid.GridPanel', + alias: 'widget.pveSDNEvpnZoneMacVrfGridPanel', + + title: gettext('MAC-VRF'), + + stateful: true, + stateId: 'grid-sdn-mac-vrf', + + columns: [ + { + text: gettext('IP'), + flex: 1, + sortable: true, + dataIndex: 'ip', + }, + { + text: gettext('MAC-Address'), + flex: 1, + sortable: true, + dataIndex: 'mac', + }, + { + text: gettext('Nexthop'), + flex: 1, + dataIndex: 'nexthop', + }, + ], + + clearVnet: function () { + let me = this; + + me.getStore().removeAll(); + }, + + setVnet: function (vnet, node) { + let me = this; + + let store = me.getStore(); + + store.getProxy().setUrl(`/api2/json/nodes/${node}/sdn/vnets/${vnet}/mac-vrf`); + store.load(); + }, + + initComponent: function () { + let me = this; + + let store = new Ext.data.Store({ + model: 'MacVrfRoute', + proxy: { + type: 'proxmox', + reader: { + type: 'json', + rootProperty: 'data', + }, + }, + sorters: [ + { + property: 'ip', + direction: 'ASC', + }, + { + property: 'mac', + direction: 'ASC', + }, + { + property: 'nexthop', + direction: 'ASC', + }, + ], + }); + + Ext.apply(me, { + store, + }); + + me.callParent(); + }, +}); -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel