From 5ebcf7511f8c1eefe01848d79896f9327b686f2b Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 11 Dec 2013 08:20:10 +0100 Subject: [PATCH] allow to open SPICE console with command menu --- www/manager/qemu/CmdMenu.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/www/manager/qemu/CmdMenu.js b/www/manager/qemu/CmdMenu.js index 4a5e605c..d5db5623 100644 --- a/www/manager/qemu/CmdMenu.js +++ b/www/manager/qemu/CmdMenu.js @@ -112,7 +112,22 @@ Ext.define('PVE.qemu.CmdMenu', { text: gettext('Console'), icon: '/pve2/images/display.png', 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); + } + } + }); } } ];