From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 8BEF61FF13C for ; Thu, 11 Jun 2026 17:00:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0644BFD67; Thu, 11 Jun 2026 17:00:39 +0200 (CEST) From: David Riley To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager 3/9] fix #7294: ui: pool: add SDN VNets as pool members Date: Thu, 11 Jun 2026 16:59:29 +0200 Message-ID: <20260611145935.147788-4-d.riley@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260611145935.147788-1-d.riley@proxmox.com> References: <20260611145935.147788-1-d.riley@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1781189940242 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.193 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: PVI5AXBXMSWD6W7NCPLRSA66PJ5ATSTY X-Message-ID-Hash: PVI5AXBXMSWD6W7NCPLRSA66PJ5ATSTY X-MailFrom: d.riley@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: Add user interface to manage SDN VNets inside resource pools. In the dialog window users can select an SDN zone, pick an associated VNet, and optionally specify a VLAN tag. The VNet selector only shows VNets of the selected zone to prevent invalid configurations. Link: https://bugzilla.proxmox.com/show_bug.cgi?id=7294 Signed-off-by: David Riley --- www/css/ext6-pve.css | 13 ++++ www/manager6/Utils.js | 1 + www/manager6/grid/PoolMembers.js | 102 +++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css index 27742a74..9ec2a3af 100644 --- a/www/css/ext6-pve.css +++ b/www/css/ext6-pve.css @@ -470,6 +470,19 @@ div.right-aligned { content: " "; } +.x-fa-pool-net:before { + width: 14px; + height: 14px; + position: absolute; + left: 1px; + top: 1px; +} + +.x-fa-pool-net-grid:before { + left: 14px; + top: 6px; +} + .x-fa-treepanel:before { width: 16px; height: 24px; diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index bbf59d8f..80331933 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -1320,6 +1320,7 @@ Ext.define('PVE.Utils', { const networkTypeMapping = { fabric: 'fa fa-road', zone: 'fa fa-th', + vnet: 'fa fa-network-wired x-fa-pool-net x-fa-pool-net-grid', }; return networkTypeMapping[record['network-type']] ?? ''; diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js index 69f50e30..3c902b67 100644 --- a/www/manager6/grid/PoolMembers.js +++ b/www/manager6/grid/PoolMembers.js @@ -158,6 +158,88 @@ Ext.define('PVE.pool.AddStorage', { }, }); +Ext.define('PVE.pool.AddVnet', { + extend: 'Proxmox.window.Edit', + + viewModel: { + data: { + zone: '', + }, + formulas: { + vnetDisabled: function (get) { + return !get('zone'); + }, + }, + }, + + initComponent: function () { + var me = this; + + if (!me.pool) { + throw 'no pool specified'; + } + + me.isCreate = true; + me.isAdd = true; + me.url = '/pools/'; + me.method = 'PUT'; + me.extraRequestParams.poolid = me.pool; + + Ext.apply(me, { + subject: gettext('VNet'), + width: 350, + items: [ + { + xtype: 'pveSDNZoneSelector', + fieldLabel: gettext('Zone'), + name: 'zone', + allowBlank: false, + bind: { + value: '{zone}', + }, + listeners: { + change: function (_f, _value) { + var vnetField = me.down('field[name=vnet]'); + if (vnetField) { + vnetField.setValue(''); + } + }, + }, + }, + { + xtype: 'pveSDNVnetSelector', + fieldLabel: gettext('VNet'), + name: 'vnet', + allowBlank: false, + bind: { + disabled: '{vnetDisabled}', + }, + listeners: { + beforequery: function (_queryPlan) { + var zone = me.getViewModel().get('zone'); + var store = this.getStore(); + store.clearFilter(); + store.filter('zone', zone); + return true; + }, + }, + }, + { + xtype: 'proxmoxintegerfield', + name: 'tag', + fieldLabel: gettext('VLAN Tag'), + minValue: 1, + maxValue: 4094, + allowBlank: true, + emptyText: gettext('All'), + }, + ], + }); + + me.callParent(); + }, +}); + Ext.define('PVE.grid.PoolMembers', { extend: 'Ext.grid.GridPanel', alias: ['widget.pvePoolMembers'], @@ -223,6 +305,17 @@ Ext.define('PVE.grid.PoolMembers', { rec.data.type === 'openvz' ) { params.vms = rec.data.vmid; + } else if (rec.data.type === 'network') { + if (rec.get('network-type') === 'vnet') { + let [_type, zone, vnet, tag] = rec.data.id.split('/'); + + params.zone = zone; + params.vnet = vnet; + + if (tag) { + params.tag = tag; + } + } } else { throw 'unknown resource type'; } @@ -268,6 +361,15 @@ Ext.define('PVE.grid.PoolMembers', { win.show(); }, }, + { + text: gettext('VNet'), + iconCls: 'fa fa-network-wired x-fa-pool-net', + handler: function () { + var win = Ext.create('PVE.pool.AddVnet', { pool: me.pool }); + win.on('destroy', reload); + win.show(); + }, + }, ], }), }, -- 2.47.3