public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: resource tree: fix rendering of guest text when sorted by name
Date: Mon, 17 Nov 2025 14:18:50 +0100	[thread overview]
Message-ID: <20251117131945.2148025-1-d.csapak@proxmox.com> (raw)

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


             reply	other threads:[~2025-11-17 13:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 13:18 Dominik Csapak [this message]
2025-11-18 14:14 ` [pve-devel] applied: " Thomas Lamprecht

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=20251117131945.2148025-1-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 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