Commit 251f2f6b authored by Dietmar Maurer's avatar Dietmar Maurer

use novnc as default viewer

parent cccb3b91
...@@ -422,11 +422,13 @@ Ext.define('PVE.Utils', { statics: { ...@@ -422,11 +422,13 @@ Ext.define('PVE.Utils', { statics: {
render_console_viewer: function(value) { render_console_viewer: function(value) {
if (!value) { if (!value) {
return PVE.Utils.defaultText + ' (Java VNC Applet)'; return PVE.Utils.defaultText + ' (HTML5)';
} else if (value === 'applet') { } else if (value === 'applet') {
return 'Java VNC Applet'; return 'Java VNC Applet';
} else if (value === 'vv') { } else if (value === 'vv') {
return 'SPICE (remote-viewer)'; return 'SPICE (remote-viewer)';
} else if (value === 'html5') {
return 'HTML5 (noVNC)';
} else { } else {
return value; return value;
} }
...@@ -1101,10 +1103,15 @@ Ext.define('PVE.Utils', { statics: { ...@@ -1101,10 +1103,15 @@ Ext.define('PVE.Utils', { statics: {
nw.focus(); nw.focus();
}, },
defaultViewer: function(){ defaultViewer: function(allowSpice) {
return PVE.VersionInfo.console || 'applet'; var vncdefault = 'html5';
}, var dv = PVE.VersionInfo.console || vncdefault;
if (dv === 'vv' && !allowSpice) {
dv = vncdefault;
}
return dv;
},
openSpiceViewer: function(url, params){ openSpiceViewer: function(url, params){
......
...@@ -6,7 +6,7 @@ Ext.define('PVE.button.ConsoleButton', { ...@@ -6,7 +6,7 @@ Ext.define('PVE.button.ConsoleButton', {
consoleName: undefined, consoleName: undefined,
enableSpice: undefined, enableSpice: true,
nodename: undefined, nodename: undefined,
...@@ -19,20 +19,6 @@ Ext.define('PVE.button.ConsoleButton', { ...@@ -19,20 +19,6 @@ Ext.define('PVE.button.ConsoleButton', {
me.spiceMenu.setDisabled(!enable); 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() { initComponent: function() {
var me = this; var me = this;
...@@ -107,11 +93,15 @@ Ext.define('PVE.button.ConsoleButton', { ...@@ -107,11 +93,15 @@ Ext.define('PVE.button.ConsoleButton', {
Ext.apply(me, { Ext.apply(me, {
handler: function() { handler: function() {
if (!me.getEnableSpice() || var dv = PVE.Utils.defaultViewer(me.enableSpice);
(PVE.VersionInfo.console && PVE.VersionInfo.console === 'applet')) { if (dv === 'vv') {
create_vnc_console();
} else {
create_spice_console(); 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({ menu: new Ext.menu.Menu({
......
...@@ -53,7 +53,7 @@ Ext.define('PVE.dc.ConsoleViewerEdit', { ...@@ -53,7 +53,7 @@ Ext.define('PVE.dc.ConsoleViewerEdit', {
var data = []; 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)]); data.push([value, PVE.Utils.render_console_viewer(value)]);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment