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: {
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){
......
......@@ -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({
......
......@@ -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)]);
});
......
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