mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 16:31:09 +00:00
ui: resourcetree: move guest position on template creation
we sort templates at the end normally, but if we convert a guest to a template, it was not moved in the tree add it to the list of attributes that are checked for a move Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
parent
e8c41dc561
commit
d8da55382a
@ -239,6 +239,8 @@ Ext.define('PVE.tree.ResourceTree', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let groups = me.viewFilter.groups || [];
|
let groups = me.viewFilter.groups || [];
|
||||||
|
// explicitly check for node/template, as those are not always grouping attributes
|
||||||
|
let moveCheckAttrs = groups.concat(['node', 'template']);
|
||||||
let filterfn = me.viewFilter.filterfn;
|
let filterfn = me.viewFilter.filterfn;
|
||||||
|
|
||||||
let reselect = false; // for disappeared nodes
|
let reselect = false; // for disappeared nodes
|
||||||
@ -251,16 +253,12 @@ Ext.define('PVE.tree.ResourceTree', {
|
|||||||
let changed = false, moved = false;
|
let changed = false, moved = false;
|
||||||
if (item) {
|
if (item) {
|
||||||
// test if any grouping attributes changed, catches migrated tree-nodes in server view too
|
// test if any grouping attributes changed, catches migrated tree-nodes in server view too
|
||||||
for (const attr of groups) {
|
for (const attr of moveCheckAttrs) {
|
||||||
if (item.data[attr] !== olditem.data[attr]) {
|
if (item.data[attr] !== olditem.data[attr]) {
|
||||||
moved = true;
|
moved = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// explicitly check for node, as node is not a grouping attribute in some views
|
|
||||||
if (!moved && item.data.node !== olditem.data.node) {
|
|
||||||
moved = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// tree item has been updated
|
// tree item has been updated
|
||||||
for (const field of ['text', 'running', 'template', 'status', 'qmpstatus', 'hastate', 'lock']) {
|
for (const field of ['text', 'running', 'template', 'status', 'qmpstatus', 'hastate', 'lock']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user