* [PATCH manager v2] fix #7136: ui: tree: harmonize folder view resource ordering
@ 2026-08-18 11:52 Elias Huhsovitz
2026-08-18 13:45 ` applied: " Dominik Csapak
0 siblings, 1 reply; 2+ messages in thread
From: Elias Huhsovitz @ 2026-08-18 11:52 UTC (permalink / raw)
To: pve-devel; +Cc: Elias Huhsovitz
Resources in the Folder View are ordered lexicographically, whereas the
Server View uses the `getTypeOrder` function for ordering.
This happens because grouping nodes in the Folder View have their `type`
property set to the literal string 'type', causing `getTypeOrder` to
return the same default value for all groups.
Fix this by resolving the actual resource type from the `groupbyid`
field in `nodeSortFn` when `type === 'type'`. This applies the defined
sort order (LXC, QEMU, Node, SDN, Network, Storage).
Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
Changes v1->v2:
---------------
* preserve the type: 'type' semantic marker used by other UI
components
* resolve the actual resource type from groupbyid in nodeSortFn
when type === 'type'
* do not refactor bug-irrelevant variables from `let` to `const`
* run `make tidy`
* update commit message
(Thanks @Dominik for the review)
v1: https://lore.proxmox.com/pve-devel/20260818083110.15786-1-e.huhsovitz@proxmox.com/
www/manager6/tree/ResourceTree.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 6ea28919..e2acc431 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -121,7 +121,9 @@ Ext.define('PVE.tree.ResourceTree', {
let n2IsGuest = n2.type === 'qemu' || n2.type === 'lxc';
if (me['group-guest-types'] || !n1IsGuest || !n2IsGuest) {
// first sort (group) by type
- let res = me.getTypeOrder(n1.type) - me.getTypeOrder(n2.type);
+ const type1 = n1.type === 'type' ? n1.groupbyid : n1.type;
+ const type2 = n2.type === 'type' ? n2.groupbyid : n2.type;
+ const res = me.getTypeOrder(type1) - me.getTypeOrder(type2);
if (res !== 0) {
return res;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-18 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 11:52 [PATCH manager v2] fix #7136: ui: tree: harmonize folder view resource ordering Elias Huhsovitz
2026-08-18 13:45 ` applied: " Dominik Csapak
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.