Commit 2a0bc39f authored by Dietmar Maurer's avatar Dietmar Maurer

update tree node if node attribute changes (vm migration)

and cleanup code
parent 31cd039b
......@@ -188,10 +188,10 @@ Ext.define('PVE.StdWorkspace', {
tree.selectById(nodeid);
},
check_vm_migration: function(record) {
checkVmMigration: function(record) {
var me = this;
var tree = me.down('pveResourceTree');
tree.check_vm_migration(record);
tree.checkVmMigration(record);
},
onLogin: function(loginData) {
......
......@@ -69,7 +69,6 @@ Ext.define('PVE.qemu.Migrate', {
text: 'Migrate',
handler: function() {
var values = form.getValues();
console.log("STARTMIGRATE " + vmid + " " + values.target + " " + values.online);
me.migrate(vmid, nodename, values.target, values.online);
}
});
......
......@@ -143,7 +143,7 @@ Ext.define('PVE.qemu.Summary', {
me.mon(rstore, 'load', function(s, records, success) {
var status;
if (!success) {
me.workspace.check_vm_migration(me.pveSelNode);
me.workspace.checkVmMigration(me.pveSelNode);
status = 'unknown';
} else {
var rec = s.data.get('status');
......
......@@ -231,8 +231,9 @@ Ext.define('PVE.tree.ResourceTree', {
}
}
if ((item.data.text !== olditem.data.text) ||
(item.data.node !== olditem.data.node) ||
(item.data.running !== olditem.data.running)) {
//console.log("changed text/running");
//console.log("changed node/text/running " + olditem.data.id);
changed = true;
}
......@@ -355,7 +356,7 @@ Ext.define('PVE.tree.ResourceTree', {
me.selectExpand(node);
}
},
check_vm_migration: function(record) {
checkVmMigration: function(record) {
if (!(record.data.type === 'qemu' || record.data.type === 'openvz')) {
throw "not a vm type";
}
......@@ -366,7 +367,7 @@ Ext.define('PVE.tree.ResourceTree', {
if (node && node.data.type === record.data.type &&
node.data.node !== record.data.node) {
// defer select (else we get strange errors)
Ext.defer(function() { me.selectExpand(node)}, 100, me);
Ext.defer(function() { me.selectExpand(node) }, 100, me);
}
},
applyState : function(state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment