mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-15 21:29:28 +00:00
try to reconnect VNCConsole after migration
This commit is contained in:
parent
4380b8d9ce
commit
e43f02cc51
@ -1,22 +1,52 @@
|
|||||||
PVE_vnc_console_event = function(appletid, action, err) {
|
PVE_vnc_console_event = function(appletid, action, err) {
|
||||||
//console.log("TESTINIT param1 " + appletid + " action " + action);
|
//console.log("TESTINIT param1 " + appletid + " action " + action);
|
||||||
|
|
||||||
|
if (action === "error") {
|
||||||
|
var compid = appletid.replace("-vncapp", "");
|
||||||
|
var comp = Ext.getCmp(compid);
|
||||||
|
|
||||||
|
if (!comp || !comp.vmid || !comp.toplevel) {
|
||||||
return;
|
return;
|
||||||
/*
|
}
|
||||||
|
|
||||||
|
// try to detect migrated VM
|
||||||
|
PVE.Utils.API2Request({
|
||||||
|
url: '/cluster/resources',
|
||||||
|
method: 'GET',
|
||||||
|
success: function(response) {
|
||||||
|
var list = response.result.data;
|
||||||
|
Ext.Array.each(list, function(item) {
|
||||||
|
if (item.type === 'qemu' && item.vmid == comp.vmid) {
|
||||||
|
if (item.node !== comp.nodename) {
|
||||||
|
//console.log("MOVED VM to node " + item.node);
|
||||||
|
comp.nodename = item.node;
|
||||||
|
comp.url = "/nodes/" + comp.nodename + "/" + item.type + "/" + comp.vmid + "/vncproxy";
|
||||||
|
//console.log("NEW URL " + comp.url);
|
||||||
|
comp.reloadApplet();
|
||||||
|
}
|
||||||
|
return false; // break
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
/*
|
||||||
var el = Ext.get(appletid);
|
var el = Ext.get(appletid);
|
||||||
if (!el)
|
if (!el)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (action === "close") {
|
if (action === "close") {
|
||||||
// el.remove();
|
// el.remove();
|
||||||
} else if (action === "error") {
|
} else if (action === "error") {
|
||||||
// console.log("TESTERROR: " + err);
|
// console.log("TESTERROR: " + err);
|
||||||
// var compid = appletid.replace("-vncapp", "");
|
// var compid = appletid.replace("-vncapp", "");
|
||||||
// var comp = Ext.getCmp(compid);
|
// var comp = Ext.getCmp(compid);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ext.get('mytestid').remove();
|
//Ext.get('mytestid').remove();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user