[pve-devel] [PATCH] add node embedded vnc console
Alexandre Derumier
aderumier at odiso.com
Mon Jun 29 14:46:38 CEST 2015
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
www/manager/VNCConsole.js | 15 +++++++++------
www/manager/node/Config.js | 7 +++++++
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/www/manager/VNCConsole.js b/www/manager/VNCConsole.js
index 4dd983c..db90388 100644
--- a/www/manager/VNCConsole.js
+++ b/www/manager/VNCConsole.js
@@ -15,14 +15,14 @@ Ext.define('PVE.noVncConsole', {
throw "no node name specified";
}
- if (!me.vmid) {
- throw "no VM ID specified";
- }
-
if (!me.consoleType) {
throw "no console type specified";
}
+ if (!me.vmid && me.consoleType !== 'shell') {
+ throw "no VM ID 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" });
@@ -33,8 +33,11 @@ Ext.define('PVE.noVncConsole', {
items: box,
listeners: {
show: function() {
- box.load('/?console=' + me.consoleType + '&novnc=1&vmid='+ me.vmid +
- '&node=' + me.nodename + '&resize=scale');
+ var url = '/?console=' + me.consoleType + '&novnc=1&node=' + me.nodename + '&resize=scale';
+ if (me.vmid) {
+ url += '&vmid='+ me.vmid;
+ }
+ box.load(url);
}
}
});
diff --git a/www/manager/node/Config.js b/www/manager/node/Config.js
index 0f5e75a..ff6d225 100644
--- a/www/manager/node/Config.js
+++ b/www/manager/node/Config.js
@@ -197,6 +197,13 @@ Ext.define('PVE.node.Config', {
itemId: 'apt',
xtype: 'pveNodeAPT',
nodename: nodename
+ },
+ {
+ title: gettext('Console'),
+ itemId: 'console',
+ xtype: 'pveNoVncConsole',
+ consoleType: 'shell',
+ nodename: nodename
}
]);
me.items.push([{
--
2.1.4
More information about the pve-devel
mailing list