From: Elias Huhsovitz <e.huhsovitz@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Elias Huhsovitz <e.huhsovitz@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 [thread overview]
Message-ID: <20260818083110.15786-2-e.huhsovitz@proxmox.com> (raw)
In-Reply-To: <20260818083110.15786-1-e.huhsovitz@proxmox.com>
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 <e.huhsovitz@proxmox.com>
---
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
next prev parent reply other threads:[~2026-08-18 8:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 8:31 [PATCH manager 0/2] fix #7136: ui: tree: harmonize folder view resource ordering Elias Huhsovitz
2026-08-18 8:31 ` Elias Huhsovitz [this message]
2026-08-18 9:15 ` [PATCH manager 1/2] " Dominik Csapak
2026-08-18 9:36 ` Elias Huhsovitz
2026-08-18 8:31 ` [PATCH manager 2/2] ui: tree: reduce reduce usage of `let` keyword Elias Huhsovitz
2026-08-18 9:15 ` Dominik Csapak
2026-08-18 12:09 ` superseded: [PATCH manager 0/2] fix #7136: ui: tree: harmonize folder view resource ordering Elias Huhsovitz
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=20260818083110.15786-2-e.huhsovitz@proxmox.com \
--to=e.huhsovitz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox