[pve-devel] [PATCH 2/2] ui/vnc: reload IFrame-embedded xtermjs on LXC startup

Stefan Reiter s.reiter at proxmox.com
Thu Dec 19 12:17:49 CET 2019


Same as with previous QEMU patch, avoids manual reload after starting a
container while the "Console" window is open.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 www/manager6/lxc/Config.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 773be1a4..e14b5ad2 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -333,6 +333,7 @@ Ext.define('PVE.lxc.Config', {
 
 	me.callParent();
 
+	var prevStatus = 'unknown';
 	me.mon(me.statusStore, 'load', function(s, records, success) {
 	    var status;
 	    var lock;
@@ -353,6 +354,15 @@ Ext.define('PVE.lxc.Config', {
 	    shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
 	    me.down('#removeBtn').setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');
 	    consoleBtn.setDisabled(template);
+
+	    if (prevStatus === 'stopped' && status === 'running') {
+		let con = me.down('#consolejs');
+		if (con) {
+		    con.reload();
+		}
+	    }
+
+	    prevStatus = status;
 	});
 
 	me.on('afterrender', function() {
-- 
2.20.1




More information about the pve-devel mailing list