diff --git a/www/manager/Utils.js b/www/manager/Utils.js index 93c5e6a9..884381f8 100644 --- a/www/manager/Utils.js +++ b/www/manager/Utils.js @@ -422,11 +422,13 @@ Ext.define('PVE.Utils', { statics: { render_console_viewer: function(value) { if (!value) { - return PVE.Utils.defaultText + ' (Java VNC Applet)'; + return PVE.Utils.defaultText + ' (HTML5)'; } else if (value === 'applet') { return 'Java VNC Applet'; } else if (value === 'vv') { return 'SPICE (remote-viewer)'; + } else if (value === 'html5') { + return 'HTML5 (noVNC)'; } else { return value; } @@ -1101,10 +1103,15 @@ Ext.define('PVE.Utils', { statics: { nw.focus(); }, - defaultViewer: function(){ - return PVE.VersionInfo.console || 'applet'; - }, + defaultViewer: function(allowSpice) { + var vncdefault = 'html5'; + var dv = PVE.VersionInfo.console || vncdefault; + if (dv === 'vv' && !allowSpice) { + dv = vncdefault; + } + return dv; + }, openSpiceViewer: function(url, params){ diff --git a/www/manager/button/ConsoleButton.js b/www/manager/button/ConsoleButton.js index 04331e28..d33cd692 100644 --- a/www/manager/button/ConsoleButton.js +++ b/www/manager/button/ConsoleButton.js @@ -6,7 +6,7 @@ Ext.define('PVE.button.ConsoleButton', { consoleName: undefined, - enableSpice: undefined, + enableSpice: true, nodename: undefined, @@ -19,20 +19,6 @@ Ext.define('PVE.button.ConsoleButton', { me.spiceMenu.setDisabled(!enable); }, - getEnableSpice: function() { - var me = this; - - if (me.enableSpice === undefined) { - if (PVE.VersionInfo.console && PVE.VersionInfo.console === 'vv') { - return true; - } else { - return false; - } - } else { - return me.enableSpice; - } - }, - initComponent: function() { var me = this; @@ -107,11 +93,15 @@ Ext.define('PVE.button.ConsoleButton', { Ext.apply(me, { handler: function() { - if (!me.getEnableSpice() || - (PVE.VersionInfo.console && PVE.VersionInfo.console === 'applet')) { - create_vnc_console(); - } else { + var dv = PVE.Utils.defaultViewer(me.enableSpice); + if (dv === 'vv') { create_spice_console(); + } else if (dv === 'applet') { + create_vnc_console(0); + } else if (dv === 'html5') { + create_vnc_console(1); + } else { + throw "unknown defaultViewer"; } }, menu: new Ext.menu.Menu({ diff --git a/www/manager/dc/OptionView.js b/www/manager/dc/OptionView.js index ed426fae..f58c9dbf 100644 --- a/www/manager/dc/OptionView.js +++ b/www/manager/dc/OptionView.js @@ -53,7 +53,7 @@ Ext.define('PVE.dc.ConsoleViewerEdit', { var data = []; - Ext.Array.each(['', 'applet', 'vv'], function(value) { + Ext.Array.each(['', 'applet', 'vv', 'html5'], function(value) { data.push([value, PVE.Utils.render_console_viewer(value)]); });