]> git.proxmox.com Git - pve-manager.git/commitdiff
allow to open SPICE console with command menu
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Dec 2013 07:20:10 +0000 (08:20 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Dec 2013 07:20:10 +0000 (08:20 +0100)
www/manager/qemu/CmdMenu.js

index 4a5e605c3f28e7548e462053badaf76ddada8ff3..d5db5623e4d3b70c00304784b104b7d20655a53b 100644 (file)
@@ -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);
+                           }
+                       }
+                   });
                }
            }
        ];