]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/VNCConsole.js
1 Ext
.define('PVE.noVncConsole', {
2 extend
: 'Ext.panel.Panel',
3 alias
: 'widget.pveNoVncConsole',
9 consoleType
: undefined, // lxc, kvm, shell, cmd
15 initComponent: function() {
19 throw "no node name specified";
22 if (!me
.consoleType
) {
23 throw "no console type specified";
26 if (!me
.vmid
&& me
.consoleType
!== 'shell' && me
.consoleType
!== 'cmd') {
27 throw "no VM ID specified";
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" });
34 var type
= me
.xtermjs
? 'xtermjs' : 'novnc';
38 activate: function() {
39 let sp
= Ext
.state
.Manager
.getProvider();
40 if (Ext
.isFunction(me
.beforeLoad
)) {
44 console
: me
.consoleType
, // kvm, lxc, upgrade or shell
48 'cmd-opts': me
.cmdOpts
,
49 resize
: sp
.get('novnc-scaling', 'scale'),
52 PVE
.Utils
.cleanEmptyObjectKeys(queryDict
);
53 var url
= '/?' + Ext
.Object
.toQueryString(queryDict
);
61 me
.on('afterrender', function() {
67 // reload IFrame content to forcibly reconnect VNC/xterm.js to VM
68 var box
= this.down('[itemid=vncconsole]');
69 box
.getWin().location
.reload();