]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: improve console fallback logic if default is not available
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 12 Jul 2019 11:33:07 +0000 (13:33 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 12 Jul 2019 12:00:51 +0000 (14:00 +0200)
instead of instantly defaulting to novnc when the chosen
default is not available, try the other (better variant)
before falling back to novnc

e.g. having no default set is equivalent to having it set
to xtermjs, and having a vm with spice then previously
defaulted to novnc, now to spice (the reverse is also true)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Utils.js

index d72ba64f2bc0a1028422694adfa55611356547b6..95345be82e69077d3fbbb266afa6b5181009fc34 100644 (file)
@@ -946,8 +946,10 @@ Ext.define('PVE.Utils', { utilities: {
            allowXtermjs = !!consoles.xtermjs;
        }
        var dv = PVE.VersionInfo.console || 'xtermjs';
-       if ((dv === 'vv' && !allowSpice) || (dv === 'xtermjs' && !allowXtermjs)) {
-           dv = 'html5';
+       if (dv === 'vv' && !allowSpice) {
+           dv = (allowXtermjs) ? 'xtermjs' : 'html5';
+       } else if (dv === 'xtermjs' && !allowXtermjs) {
+           dv = (allowSpice) ? 'vv' : 'html5';
        }
 
        return dv;