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

Dominik Csapak d.csapak at proxmox.com
Mon Dec 4 11:51:51 CET 2017


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
-- 
2.11.0





More information about the pve-devel mailing list