mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-11 12:54:59 +00:00
ui/vnc: reload IFrame-embedded noVNC on VM startup
Avoids having to do the 'Console' -> 'Summary' -> 'Console' dance everytime the VM is started and the Console window is currently open. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
78bfd48a92
commit
c17ecca28d
@ -57,6 +57,12 @@ Ext.define('PVE.noVncConsole', {
|
|||||||
me.on('afterrender', function() {
|
me.on('afterrender', function() {
|
||||||
me.focus();
|
me.focus();
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
reloadConsole: function() {
|
||||||
|
// reload IFrame content to forcibly reconnect VNC/xterm.js to VM
|
||||||
|
var box = this.down();
|
||||||
|
box.getWin().location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -365,6 +365,7 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
|
|
||||||
|
var prevQmpstatus = 'unknown';
|
||||||
me.mon(me.statusStore, 'load', function(s, records, success) {
|
me.mon(me.statusStore, 'load', function(s, records, success) {
|
||||||
var status;
|
var status;
|
||||||
var qmpstatus;
|
var qmpstatus;
|
||||||
@ -412,6 +413,16 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
||||||
me.down('#removeBtn').setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');
|
me.down('#removeBtn').setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');
|
||||||
consoleBtn.setDisabled(template);
|
consoleBtn.setDisabled(template);
|
||||||
|
|
||||||
|
if (['prelaunch', 'stopped', 'suspended'].indexOf(prevQmpstatus) !== -1
|
||||||
|
&& qmpstatus === 'running') {
|
||||||
|
var con = me.down('#console');
|
||||||
|
if (con) {
|
||||||
|
con.reloadConsole();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prevQmpstatus = qmpstatus;
|
||||||
});
|
});
|
||||||
|
|
||||||
me.on('afterrender', function() {
|
me.on('afterrender', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user