[pve-devel] [PATCH v6 widget 1/1] widget: added new parameter to pass a command to the newly opened terminal

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Feb 28 10:54:05 CET 2019


On 2/27/19 3:01 PM, Tim Marx wrote:
> Signed-off-by: Tim Marx <t.marx at proxmox.com>
> ---
>  Utils.js | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/Utils.js b/Utils.js
> index db55996..1b6dc5f 100644
> --- 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');
>  	nw.focus();
> 

applied, but reworked commit message: removed the "widget" tag from the subject
line, the one from format.subjectprefix is enough to know where to apply this,
once applied you already know that you're in said repo, so this is useless.
You also did not mention anything about the switch from "Ext.urlEncode" to
"Ext.Object.toQueryString", which may confuse reviewers if they do not know from
top of their head, that the former is now deprecated.

Also, as an additional nit: the tense for things you do in the commit the commit
message is for is normally the present, not a past one, past commits are past,
future ones are future, this is now :-)



More information about the pve-devel mailing list