]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
utils: xtermjs: allow to pass a 'cmd' parameter to the terminal
authorTim Marx <t.marx@proxmox.com>
Wed, 27 Feb 2019 14:01:17 +0000 (15:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 28 Feb 2019 09:39:40 +0000 (10:39 +0100)
also, as we already touch this:
Ext.urlEncode is deprecated, use Ext.Object.toQueryString instead

Signed-off-by: Tim Marx <t.marx@proxmox.com>
Utils.js

index dac5fb1774e3d7b385a3c8f6026ea12899b2b450..ef4aa5ece3474cf9da699d9c9bd5aa5b1feba828 100644 (file)
--- a/Utils.js
+++ b/Utils.js
@@ -577,13 +577,15 @@ Ext.define('Proxmox.Utils', { utilities: {
        return Ext.Date.format(servertime, 'Y-m-d H:i:s');
     },
 
-    openXtermJsViewer: function(vmtype, vmid, nodename, vmname) {
-       var url = Ext.urlEncode({
+    openXtermJsViewer: function(vmtype, vmid, nodename, vmname, cmd) {
+       var url = Ext.Object.toQueryString({
            console: vmtype, // kvm, lxc, upgrade or shell
            xtermjs: 1,
            vmid: vmid,
            vmname: vmname,
-           node: nodename
+           node: nodename,
+           cmd: cmd,
+
        });
        var nw = window.open("?" + url, '_blank', 'toolbar=no,location=no,status=no,menubar=no,resizable=yes,width=800,height=420');
        if (nw) {