From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 390341FF0A7 for ; Tue, 18 Aug 2026 10:31:36 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0824721588; Tue, 18 Aug 2026 10:31:27 +0200 (CEST) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH manager 1/2] fix #7136: ui: tree: harmonize folder view resource ordering Date: Tue, 18 Aug 2026 10:31:09 +0200 Message-ID: <20260818083110.15786-2-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260818083110.15786-1-e.huhsovitz@proxmox.com> References: <20260818083110.15786-1-e.huhsovitz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787041860774 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.770 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: CNLG5F7GXRR2ENFLT5PWKRIYYM4UQ4EA X-Message-ID-Hash: CNLG5F7GXRR2ENFLT5PWKRIYYM4UQ4EA X-MailFrom: e.huhsovitz@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 CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Grouping nodes in the Folder view are assigned the literal type: 'type' instead of their actual type. This causes `getTypeOrder` to return a default value for all groups. This causes Resources in the Folder View to be ordered lexicographically, whereas the Server View correctly relies on the `getTypeOrder` function. Match the Server View ordering by setting the grouping node's `type` to the actual resource type when grouping by `type`. This way `getTypeOrder` receives the correct type for sorting. Simplify the text resolution logic in `addChildSorted`. Propagate `iconCls` from `typeDefaults` to ensure grouping nodes display the correct icons. Signed-off-by: Elias Huhsovitz --- www/manager6/tree/ResourceTree.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js index 6ea28919..a7723095 100644 --- a/www/manager6/tree/ResourceTree.js +++ b/www/manager6/tree/ResourceTree.js @@ -232,13 +232,13 @@ Ext.define('PVE.tree.ResourceTree', { if (info.groupbyid) { if (me.viewFilter.groupRenderer) { info.text = me.viewFilter.groupRenderer(info); - } else if (info.type === 'type') { + } else { let defaults = PVE.tree.ResourceTree.typeDefaults[info.groupbyid]; if (defaults && defaults.text) { info.text = defaults.text; + } else { + info.text = info.groupbyid; } - } else { - info.text = info.groupbyid; } } let child = Ext.create('PVETree', info); @@ -267,11 +267,17 @@ Ext.define('PVE.tree.ResourceTree', { if (info.type === groupBy) { groupinfo = info; } else { + const type = groupBy === 'type' ? v : groupBy; groupinfo = { - type: groupBy, + type: type, id: groupBy + '/' + v, }; - if (groupBy !== 'type') { + if (groupBy === 'type') { + let defaults = PVE.tree.ResourceTree.typeDefaults[v]; + if (defaults && defaults.iconCls) { + groupinfo.iconCls = defaults.iconCls; + } + } else { groupinfo[groupBy] = v; } } -- 2.47.3