all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager v5 18/18] ui: lxc: resources: integrate network view
Date: Mon, 16 Nov 2026 17:30:43 +0100	[thread overview]
Message-ID: <20261116163138.343821-19-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261116163138.343821-1-d.csapak@proxmox.com>

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 <d.csapak@proxmox.com>
---
 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





  parent reply	other threads:[~2026-11-16 16:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:30 [PATCH pve-manager v5 00/18] ui: split out disks and nics into grids Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 01/18] ui: utils: factor out 'media=cdrom' check Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 02/18] ui: parser: qemu drive: allow '-' in key name Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 03/18] ui: factor out the guest key nic regex check Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 04/18] ui: add pending grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 05/18] ui: revert button: add parentXType and reloadCallback Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 06/18] ui: button: add config remove button Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 07/18] ui: qemu: hardware: wrap in container Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 08/18] ui: qemu: introduce hardware disk grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 09/18] ui: qemu: introduce hardware net grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 10/18] ui: qemu: hardware view: separate disks into own grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 11/18] ui: qemu: hardware view: separate nics " Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 12/18] ui: qemu: hardware view: inline edit/remove/revert button in general grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 13/18] ui: qemu: hardware view: inline 'add efi' menuitem Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 14/18] ui: utils: factor out volume size renderer Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 15/18] ui: lxc: network view: convert to pending grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 16/18] ui: lxc: introduce resource volume grid Dominik Csapak
2026-11-16 16:30 ` [PATCH pve-manager v5 17/18] ui: lxc: resources: separate volumes into own grid Dominik Csapak
2026-11-16 16:30 ` Dominik Csapak [this message]
2026-11-19 10:01 ` superseded: [PATCH pve-manager v5 00/18] ui: split out disks and nics into grids Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116163138.343821-19-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal