public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: resource tree: fix rendering of guest text when sorted by name
@ 2025-11-17 13:18 Dominik Csapak
  2025-11-18 14:14 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-11-17 13:18 UTC (permalink / raw)
  To: pve-devel

In a recent commit, we changed how we render the text for element in the
resource tree, namely by not overwriting the original data in the store.

During that code move & change, a bug slipped in, where we correctly
detected that we're sorting by name and set the text to the correct
format, but ultimately discarded that value and overwrote it with the
original one from the store.

Fix this by first extracting the original text from the record, and the
use the text like we did the record field before

This was reported in the forum:
https://forum.proxmox.com/threads/176021/

Fixes: 83783c3b (ui: resource tree: prevent overwriting of 'text' property)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
i hope this is the last fix i have to do for the tree rendering in a
long time ;)

 www/manager6/tree/ResourceTree.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 770f7555..29e098d8 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -54,7 +54,7 @@ Ext.define('PVE.tree.ResourceTree', {
             renderer: function (val, meta, rec) {
                 let info = rec.data;
 
-                let text = '';
+                let text = info.text;
                 let status = '';
                 if (info.type === 'storage') {
                     let usage = info.disk / info.maxdisk;
@@ -72,7 +72,7 @@ Ext.define('PVE.tree.ResourceTree', {
                         text = `${info.name} (${String(info.vmid)})`;
                     }
                 }
-                text = `<span>${status}${info.text}</span>`;
+                text = `<span>${status}${text}</span>`;
                 text += PVE.Utils.renderTags(info.tags, PVE.UIOptions.tagOverrides);
                 return (info.renderedText = text);
             },
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-18 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 13:18 [pve-devel] [PATCH manager] ui: resource tree: fix rendering of guest text when sorted by name Dominik Csapak
2025-11-18 14:14 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal