From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id A22E11FF0DF for ; Thu, 19 Nov 2026 10:31:54 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0A5542193B; Thu, 19 Nov 2026 10:29:47 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v6 20/21] ui: lxc: resources: integrate network view Date: Thu, 19 Nov 2026 10:28:33 +0100 Message-ID: <20261119092930.830046-21-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119092930.830046-1-d.csapak@proxmox.com> References: <20261119092930.830046-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.279 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: RKM3ZGHKQFSQ6TVLPYQ4IDONIJE6UCZ6 X-Message-ID-Hash: RKM3ZGHKQFSQ6TVLPYQ4IDONIJE6UCZ6 X-MailFrom: d.csapak@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: and remove it as separate panel, so the nics are shown below the volumes, like in the hardware view of qemu. Since the pending store only contains keys that are defined in 'rows', add the nics and the digest there, so that the network view can use the store too. The network view handles its buttons and reloading after changes by itself. Only the load on activate and on a reload of the resource view has to be triggered from here, since it's not a direct child of the config panel anymore. Signed-off-by: Dominik Csapak --- www/manager6/lxc/Config.js | 6 ------ www/manager6/lxc/Resources.js | 36 ++++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js index 3a99d6a7..4019b81d 100644 --- a/www/manager6/lxc/Config.js +++ b/www/manager6/lxc/Config.js @@ -271,12 +271,6 @@ Ext.define('PVE.lxc.Config', { iconCls: 'fa fa-cube', xtype: 'pveLxcRessourceView', }, - { - title: gettext('Network'), - iconCls: 'fa fa-exchange', - itemId: 'network', - xtype: 'pveLxcNetworkView', - }, { title: gettext('DNS'), iconCls: 'fa fa-globe', diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js index 944c0356..e29eca55 100644 --- a/www/manager6/lxc/Resources.js +++ b/www/manager6/lxc/Resources.js @@ -21,8 +21,10 @@ Ext.define('PVE.lxc.RessourceView', { return resourceGrid.getObjectValue(...arguments); }, + // also reloads the interfaces of the network view, their addresses could have changed reload: function () { let me = this; + me.down('pveLxcNetworkView').load(); return me.rstore.load(); }, @@ -113,6 +115,10 @@ Ext.define('PVE.lxc.RessourceView', { unprivileged: { visible: false, }, + // only needed for the network view + digest: { + visible: false, + }, }; PVE.Utils.forEachLxcMP(function (bus, i, confid) { @@ -137,6 +143,11 @@ Ext.define('PVE.lxc.RessourceView', { } }, true); + // not shown in the general grid, but the network view needs them in the store + for (let i = 0; i < PVE.Utils.hardware_counts.net; i++) { + rows[`net${i}`] = { visible: false }; + } + let deveditor = Proxmox.UserName === 'root@pam' ? 'PVE.lxc.DeviceEdit' : undefined; PVE.Utils.forEachLxcDev(function (i, confid) { @@ -236,7 +247,7 @@ Ext.define('PVE.lxc.RessourceView', { url: `/api2/json/nodes/${nodename}/lxc/${vmid}/pending`, interval: 2000, rows, - filters: [(rec) => !volumeGridFilter(rec)], + filters: [(rec) => !volumeGridFilter(rec), (rec) => !PVE.Utils.keyIsNic(rec.data.key)], }); let onSelectionChange = function (sm, selected) { @@ -453,20 +464,39 @@ Ext.define('PVE.lxc.RessourceView', { }, ], }, + // spacer with bottom border + { + xtype: 'panel', + border: true, + height: 1, + margin: '20 0 0 0', + }, + { + xtype: 'pveLxcNetworkView', + title: gettext('Network Interfaces'), + border: false, + pveSelNode: me.pveSelNode, + rstore: me.rstore, + }, ], }); me.callParent(); + // it sets its own listeners, so add it afterwards + let networkView = me.down('pveLxcNetworkView'); + networkView.on('selectionchange', onSelectionChange); + me.on('activate', me.rstore.startUpdate, me.rstore); + me.on('activate', () => networkView.load()); me.on('destroy', me.rstore.stopUpdate, me.rstore); me.on('deactivate', me.rstore.stopUpdate, me.rstore); let volumeGrid = me.down('pveLxcResourceVolumeGrid'); // the buttons only evaluate their enableFn on selection changes, but the data of a - // selected record can change on a reload too - for (const grid of me.query('grid')) { + // selected record can change on a reload too (the network view handles that itself) + for (const grid of [me.lookup('resourceGrid'), volumeGrid]) { me.mon(grid.getStore(), 'refresh', function () { let selModel = grid.getSelectionModel(); let selection = selModel.getSelection(); -- 2.47.3