[pve-devel] [PATCH manager 3/5] add new xtermjs viewer window to Utils

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Dec 4 09:31:02 CET 2017


On 12/01/2017 09:29 AM, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/Utils.js | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index 3efe4e71..578ba81e 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -1156,6 +1156,8 @@ Ext.define('PVE.Utils', { utilities: {
>  
>  	if (viewer === 'html5') {
>  	    PVE.Utils.openVNCViewer(vmtype, vmid, nodename, vmname);
> +	} else if (viewer === 'xtermjs') {
> +	    PVE.Utils.openXtermJSviewer(vmtype, vmid, nodename, vmname);
>  	} else if (viewer === 'vv') {
>  	    var url;
>  	    var params = { proxy: PVE.Utils.windowHostname() };
> @@ -1188,6 +1190,18 @@ Ext.define('PVE.Utils', { utilities: {
>  	return dv;
>      },
>  
> +    openXtermJSviewer: function(vmtype, vmid, nodename, vmname) {
> +	var url = Ext.urlEncode({
> +	    console: vmtype, // kvm, lxc, upgrade or shell
> +	    xtermjs: 1,
> +	    vmid: vmid,
> +	    vmname: vmname,
> +	    node: nodename
> +	});
> +	var nw = window.open("?" + url, '_blank', 'toolbar=no,location=no,status=no,menubar=no,resizable=yes,width=800,height=420');
> +	nw.focus();
> +    },
> +
>      openVNCViewer: function(vmtype, vmid, nodename, vmname) {
>  	var url = Ext.urlEncode({
>  	    console: vmtype, // kvm, lxc, upgrade or shell
> 

Reviewed-by: Thomas Lamprecht <t.lamprecht at proxmox.com>




More information about the pve-devel mailing list