[pve-devel] [PATCH manager 1/3] ui: resource tree: fix nodes text moving in tree on update

Dominik Csapak d.csapak at proxmox.com
Thu Nov 23 09:25:40 CET 2023


when a node element was updated, it was put through the 'setText' method
which accidentally added a space before it's name.

Fix this by putting the space into the status variable

This could be observed when one node had guests on it but others had not.
The nodes would then be misaligned.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 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 acfa545a..7b2934ae 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -122,7 +122,7 @@ Ext.define('PVE.tree.ResourceTree', {
 		status = '<div class="usage-wrapper">';
 		status += `<div class="usage-negative" style="height: ${remainingHeight}%"></div>`;
 		status += `<div class="usage" style="height: ${barHeight}%"></div>`;
-		status += '</div>';
+		status += '</div> ';
 	    }
 	}
 	if (Ext.isNumeric(info.vmid) && info.vmid > 0) {
@@ -130,7 +130,7 @@ Ext.define('PVE.tree.ResourceTree', {
 		info.text = `${info.name} (${String(info.vmid)})`;
 	    }
 	}
-	info.text = `<span>${status} ${info.text}</span>`;
+	info.text = `<span>${status}${info.text}</span>`;
 	info.text += PVE.Utils.renderTags(info.tags, PVE.UIOptions.tagOverrides);
     },
 
-- 
2.30.2






More information about the pve-devel mailing list