add embedded qemu novnc console

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2015-06-26 11:25:09 +02:00 committed by Dietmar Maurer
parent a7bafc3d08
commit 740110393b
3 changed files with 47 additions and 0 deletions

View File

@ -115,6 +115,7 @@ JSSRC= \
window/Migrate.js \
window/MigrateAll.js \
qemu/Monitor.js \
qemu/Console.js \
qemu/Summary.js \
qemu/OSTypeEdit.js \
qemu/ProcessorEdit.js \

View File

@ -177,6 +177,14 @@ Ext.define('PVE.qemu.Config', {
});
}
if (caps.vms['VM.Console']) {
me.items.push({
title: gettext('Console'),
itemId: 'console',
xtype: 'pveQemuConsole'
});
}
if (caps.vms['VM.Console']) {
me.items.push([
{

View File

@ -0,0 +1,38 @@
Ext.define('PVE.qemu.Console', {
extend: 'Ext.panel.Panel',
alias: 'widget.pveQemuConsole',
initComponent : function() {
var me = this;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
throw "no node name specified";
}
var vmid = me.pveSelNode.data.vmid;
if (!vmid) {
throw "no VM ID specified";
}
var myid = "vncconsole";
var box = Ext.create('widget.uxiframe', {
id: myid
});
Ext.apply(me, {
layout: { type: 'fit' },
border: false,
items: box,
listeners: {
show: function() {
box.load('/?console=kvm&novnc=1&vmid='+ vmid + '&node=' + nodename + '&resize=scale');
}
}
});
me.callParent();
}
});