[pve-devel] [PATCH proxmox-widget-toolkit v4 1/1] network selector: add type parameter

Gabriel Goller g.goller at proxmox.com
Wed Jul 2 16:50:42 CEST 2025


From: Stefan Hanreich <s.hanreich at proxmox.com>

The network endpoint of the PVE API allows selecting interfaces by
type, but the network selector widget currently does not support
passing the type to the API call.

This is required for the SDN fabrics, which introduced a new special
type to this endpoint that additionally selects all SDN interfaces.
This can then be used to make SDN fabrics show up in the Migration
Settings dialog or in the Ceph Installation Wizards.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 src/form/NetworkSelector.js | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/form/NetworkSelector.js b/src/form/NetworkSelector.js
index 7f96f05217f3..a19ca3671055 100644
--- a/src/form/NetworkSelector.js
+++ b/src/form/NetworkSelector.js
@@ -6,11 +6,12 @@ Ext.define('Proxmox.form.NetworkSelectorController', {
         let _me = this;
 
         if (!view.nodename) {
-            throw 'missing custom view config: nodename';
+            throw "missing custom view config: nodename";
         }
-        view.getStore()
+        view
+            .getStore()
             .getProxy()
-            .setUrl('/api2/json/nodes/' + view.nodename + '/network');
+            .setUrl(`/api2/json/nodes/${view.nodename}/network${view.getQueryString()}`);
     },
 });
 
@@ -35,15 +36,22 @@ Ext.define('Proxmox.form.NetworkSelector', {
 
     controller: 'proxmoxNetworkSelectorController',
 
+    type: undefined,
+    getQueryString: function() {
+	return this.type ? `?type=${this.type}` : '';
+    },
+
     nodename: 'localhost',
-    setNodename: function (nodename) {
+    setNodename: function(nodename) {
         this.nodename = nodename;
         let networkSelectorStore = this.getStore();
         networkSelectorStore.removeAll();
         // because of manual local copy of data for ip4/6
         this.getPicker().refresh();
         if (networkSelectorStore && typeof networkSelectorStore.getProxy === 'function') {
-            networkSelectorStore.getProxy().setUrl('/api2/json/nodes/' + nodename + '/network');
+            networkSelectorStore
+                .getProxy()
+                .setUrl(`/api2/json/nodes/${nodename}/network${this.getQueryString()}`);
             networkSelectorStore.load();
         }
     },
-- 
2.39.5





More information about the pve-devel mailing list