]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/VNCConsole.js
remove not needed vnc code
[pve-manager.git] / www / manager6 / VNCConsole.js
1 Ext.define('PVE.noVncConsole', {
2 extend: 'Ext.panel.Panel',
3 alias: 'widget.pveNoVncConsole',
4
5 nodename: undefined,
6
7 vmid: undefined,
8
9 consoleType: undefined, // lxc or kvm
10
11 layout: 'fit',
12
13 border: false,
14
15 initComponent : function() {
16 var me = this;
17
18 if (!me.nodename) {
19 throw "no node name specified";
20 }
21
22 if (!me.consoleType) {
23 throw "no console type specified";
24 }
25
26 if (!me.vmid && me.consoleType !== 'shell') {
27 throw "no VM ID specified";
28 }
29
30 // always use same iframe, to avoid running several noVnc clients
31 // at same time (to avoid performance problems)
32 var box = Ext.create('Ext.ux.IFrame', { itemid : "vncconsole" });
33
34 Ext.apply(me, {
35 items: box,
36 listeners: {
37 activate: function() {
38 var url = '/?console=' + me.consoleType + '&novnc=1&node=' + me.nodename + '&resize=scale';
39 if (me.vmid) {
40 url += '&vmid='+ me.vmid;
41 }
42 box.load(url);
43 }
44 }
45 });
46
47 me.callParent();
48 }
49 });
50