[pve-devel] [PATCH 1/2] spice : add button

Alexandre Derumier aderumier at odiso.com
Wed Apr 10 13:10:54 CEST 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager/qemu/Config.js |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/www/manager/qemu/Config.js b/www/manager/qemu/Config.js
index efa4de5..56fe289 100644
--- a/www/manager/qemu/Config.js
+++ b/www/manager/qemu/Config.js
@@ -118,13 +118,28 @@ Ext.define('PVE.qemu.Config', {
 	    }
 	});
 
+	var spiceconsoleBtn = Ext.create('Ext.Button', {
+	    text: gettext('Spice Console'),
+	    handler: function() {
+		Ext.core.DomHelper.append(document.body, {
+		    tag : 'iframe',
+		    id : 'downloadIframe',
+		    frameBorder : 0,
+		    width : 0,
+		    height : 0,
+		    css : 'display:none;visibility:hidden;height:0px;',
+		    src : '/api2/spiceconfig/nodes/' + nodename + '/qemu/' + vmid + '/spiceproxy'
+		});
+	    }
+	});
+
 	var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'VM " + vmid + "'") + ")";
 
 	Ext.apply(me, {
 	    title: Ext.String.format(gettext("Virtual Machine {0} on node {1}"), descr, "'" + nodename + "'"),
 	    hstateid: 'kvmtab',
 	    tbar: [ resumeBtn, startBtn, shutdownBtn, stopBtn, resetBtn, 
-		    removeBtn, migrateBtn, consoleBtn ],
+		    removeBtn, migrateBtn, consoleBtn, spiceconsoleBtn ],
 	    defaults: { statusStore: me.statusStore },
 	    items: [
 		{
-- 
1.7.10.4




More information about the pve-devel mailing list