utils: xtermjs: allow to pass a 'cmd' parameter to the terminal

also, as we already touch this:
Ext.urlEncode is deprecated, use Ext.Object.toQueryString instead

Signed-off-by: Tim Marx <t.marx@proxmox.com>
This commit is contained in:
Tim Marx 2019-02-27 15:01:17 +01:00 committed by Thomas Lamprecht
parent 9bf01f76c7
commit f80f1f94d3

View File

@ -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) {