allow to open SPICE console with command menu

This commit is contained in:
Dietmar Maurer 2013-12-11 08:20:10 +01:00
parent 3fa0b22266
commit 5ebcf7511f

View File

@ -112,7 +112,22 @@ Ext.define('PVE.qemu.CmdMenu', {
text: gettext('Console'), text: gettext('Console'),
icon: '/pve2/images/display.png', icon: '/pve2/images/display.png',
handler: function() { handler: function() {
PVE.Utils.openConoleWindow('kvm', vmid, nodename, vmname); PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/qemu/' + vmid + '/status/current',
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
},
success: function(response, opts) {
var spice = response.result.data.spice;
if (PVE.VersionInfo.console === 'applet' || !spice) {
PVE.Utils.openConoleWindow('kvm', vmid, nodename, vmname);
} else {
var url = '/nodes/' + nodename + '/qemu/' + vmid + '/spiceproxy';
var params = { proxy: window.location.hostname };
PVE.Utils.openSpiceViewer(url, params);
}
}
});
} }
} }
]; ];