[pve-devel] [PATCH pve-manager] defaultViewer: prefer xtermjs

Dietmar Maurer dietmar at proxmox.com
Tue May 8 13:35:05 CEST 2018


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 www/manager6/Utils.js | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 5a8f7427..d6aed5a2 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -748,7 +748,7 @@ Ext.define('PVE.Utils', { utilities: {
     },
 
     openDefaultConsoleWindow: function(consoles, vmtype, vmid, nodename, vmname) {
-	var dv = PVE.Utils.defaultViewer(consoles);
+	var dv = PVE.Utils.defaultViewer(consoles, vmtype);
 	PVE.Utils.openConsoleWindow(dv, vmtype, vmid, nodename, vmname);
     },
 
@@ -789,7 +789,7 @@ Ext.define('PVE.Utils', { utilities: {
 	}
     },
 
-    defaultViewer: function(consoles) {
+    defaultViewer: function(consoles, vmtype) {
 
 	var allowSpice, allowXtermjs;
 
@@ -800,10 +800,13 @@ Ext.define('PVE.Utils', { utilities: {
 	    allowSpice = consoles.spice;
 	    allowXtermjs = !!consoles.xtermjs;
 	}
-	var vncdefault = 'html5';
-	var dv = PVE.VersionInfo.console || vncdefault;
-	if ((dv === 'vv' && !allowSpice) || (dv === 'xtermjs' && !allowXtermjs)) {
-	    dv = vncdefault;
+
+	var dv = PVE.VersionInfo.console;
+	if ((dv === undefined) && (vmtype === 'shell' || vmtype === 'lxc' || vmtype === 'upgrade')) {
+	    dv = 'xtermjs';
+	}
+	if ((dv === undefined) || (dv === 'vv' && !allowSpice) || (dv === 'xtermjs' && !allowXtermjs)) {
+	    dv = 'html5';
 	}
 
 	return dv;
-- 
2.11.0



More information about the pve-devel mailing list