Commit ab8c74aa authored by Dietmar Maurer's avatar Dietmar Maurer

cleanup embeded console code, add console for lxc containers

parent bdcabcca
...@@ -115,7 +115,6 @@ JSSRC= \ ...@@ -115,7 +115,6 @@ JSSRC= \
window/Migrate.js \ window/Migrate.js \
window/MigrateAll.js \ window/MigrateAll.js \
qemu/Monitor.js \ qemu/Monitor.js \
qemu/Console.js \
qemu/Summary.js \ qemu/Summary.js \
qemu/OSTypeEdit.js \ qemu/OSTypeEdit.js \
qemu/ProcessorEdit.js \ qemu/ProcessorEdit.js \
......
Ext.define('PVE.noVncConsole', {
extend: 'Ext.panel.Panel',
alias: 'widget.pveNoVncConsole',
nodename: undefined,
vmid: undefined,
consoleType: undefined, // lxc or kvm
initComponent : function() {
var me = this;
if (!me.nodename) {
throw "no node name specified";
}
if (!me.vmid) {
throw "no VM ID specified";
}
if (!me.consoleType) {
throw "no console type specified";
}
// always use same iframe, to avoid running several noVnc clients
// at same time (to avoid performance problems)
var box = Ext.create('widget.uxiframe', { id: "vncconsole" });
Ext.apply(me, {
layout: { type: 'fit' },
border: false,
items: box,
listeners: {
show: function() {
box.load('/?console=' + me.consoleType + '&novnc=1&vmid='+ me.vmid +
'&node=' + me.nodename + '&resize=scale');
}
}
});
me.callParent();
}
});
PVE_vnc_console_event = function(appletid, action, err) { PVE_vnc_console_event = function(appletid, action, err) {
//console.log("TESTINIT param1 " + appletid + " action " + action); //console.log("TESTINIT param1 " + appletid + " action " + action);
......
...@@ -162,6 +162,18 @@ Ext.define('PVE.lxc.Config', { ...@@ -162,6 +162,18 @@ Ext.define('PVE.lxc.Config', {
}); });
} }
if (caps.vms['VM.Console']) {
me.items.push({
title: gettext('Console'),
itemId: 'console',
xtype: 'pveNoVncConsole',
vmid: vmid,
consoleType: 'lxc',
nodename: nodename
});
}
if (caps.vms['VM.Console']) { if (caps.vms['VM.Console']) {
me.items.push([ me.items.push([
{ {
......
...@@ -181,7 +181,10 @@ Ext.define('PVE.qemu.Config', { ...@@ -181,7 +181,10 @@ Ext.define('PVE.qemu.Config', {
me.items.push({ me.items.push({
title: gettext('Console'), title: gettext('Console'),
itemId: 'console', itemId: 'console',
xtype: 'pveQemuConsole' xtype: 'pveNoVncConsole',
vmid: vmid,
consoleType: 'kvm',
nodename: nodename
}); });
} }
......
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();
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment