[pve-devel] [PATCH manager] ui: resourcetree: move guest position on template creation

Dominik Csapak d.csapak at proxmox.com
Fri Oct 1 14:37:09 CEST 2021


we sort templates at the end normally, but if we convert a guest to a
template, it was not moved in the tree

this marks the guest to be moved if the template status changes

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/tree/ResourceTree.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 3b883d23..2bbaca00 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -262,6 +262,10 @@ Ext.define('PVE.tree.ResourceTree', {
 			moved = true;
 		    }
 
+		    if (!moved && item.data.template !== olditem.data.node) {
+			moved = true;
+		    }
+
 		    // tree item has been updated
 		    for (const field of ['text', 'running', 'template', 'status', 'qmpstatus', 'hastate', 'lock']) {
 			if (item.data[field] !== olditem.data[field]) {
-- 
2.30.2






More information about the pve-devel mailing list