[pve-devel] [PATCH pve-manager] defaultViewer: prefer xtermjs
Dominik Csapak
d.csapak at proxmox.com
Tue May 8 14:46:27 CEST 2018
why not try to determine from the 'console' parameter if we can give
xtermjs (if no default is set) instead of passing a new argument?
if there is a good reason (i cant think of at the moment), it looks good
On 05/08/2018 01:35 PM, Dietmar Maurer wrote:
> 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;
>
More information about the pve-devel
mailing list