[PATCH pve-manager v5 39/46] ui: sdn: add route map selector

Stefan Hanreich
2026-05-05T15:44:04Z

A UI component that provides a dropdown for selecting route maps. This
will be used in various places that allow defining a route map, e.g.
in the EVPN / BGP controller or when configuring route
redistributions for fabrics.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
www/manager6/Makefile | 1 +
www/manager6/sdn/RouteMapSelector.js | 55 ++++++++++++++++++++++++++++
2 files changed, 56 insertions(+)
create mode 100644 www/manager6/sdn/RouteMapSelector.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index f63437d6f..ed380b632 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -309,6 +309,7 @@ JSSRC= \
sdn/ZoneView.js \
sdn/IpamEdit.js \
sdn/OptionsPanel.js \
+ sdn/RouteMapSelector.js \
sdn/controllers/Base.js \
sdn/controllers/EvpnEdit.js \
sdn/controllers/BgpEdit.js \
diff --git a/www/manager6/sdn/RouteMapSelector.js b/www/manager6/sdn/RouteMapSelector.js
new file mode 100644
index 000000000..3df65eb38
--- /dev/null
+++ b/www/manager6/sdn/RouteMapSelector.js
@@ -0,0 +1,55 @@
+Ext.define('PVE.sdn.RouteMap', {
+ extend: 'Ext.data.Model',
+ fields: ['id'],
+});
+
+Ext.define('PVE.sdn.RouteMapSelector', {
+ extend: 'Proxmox.form.ComboGrid',
+ alias: 'widget.pveSDNRouteMapSelector',
+
+ displayField: 'id',
+
+ deleteEmpty: true,
+ editable: false,
+ allowBlank: true,
+ autoSelect: false,
+
+ config: {
+ value: null,
+ },
+
+ store: {
+ autoLoad: true,
+ model: 'PVE.sdn.RouteMap',
+ proxy: {
+ type: 'proxmox',
+ url: '/api2/json/cluster/sdn/route-maps',
+ reader: {
+ transform: {
+ fn: function(response) {
+ return Object.values(response.data.reduce((accumulator, routeMapEntry) => {
+ let id = routeMapEntry['route-map-id'];
+
+ accumulator[id] ??= {
+ id,
+ };
+
+ return accumulator;
+ }, {}));
+ }
+ }
+ },
+ },
+ },
+ listConfig: {
+ columns: [
+ {
+ header: gettext('Name'),
+ dataIndex: 'id',
+ hideable: false,
+ flex: 1,
+ },
+ ],
+ },
+});
+
--
2.47.3