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

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Feb 28 10:59:35 CET 2019


On 2/27/19 3:01 PM, Tim Marx wrote:
> Signed-off-by: Tim Marx <t.marx at proxmox.com>
> ---
>  src/www/main.js | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/www/main.js b/src/www/main.js
> index 26213a3..6a1dba3 100644
> --- a/src/www/main.js
> +++ b/src/www/main.js
> @@ -23,6 +23,7 @@ var type = getQueryParameter('console');
>  var vmid = getQueryParameter('vmid');
>  var vmname = getQueryParameter('vmname');
>  var nodename = getQueryParameter('node');
> +var cmd = getQueryParameter('cmd');
>  
>  function updateState(newState, msg) {
>      var timeout, severity, message;
> @@ -111,6 +112,9 @@ function createTerminal() {
>  	case 'upgrade':
>  	    params.upgrade = 1;
>  	    break;
> +	case 'cmd':
> +	    params.cmd = decodeURI(cmd);
> +	    break;
>      }
>      API2Request({
>  	method: 'POST',
> @@ -273,7 +277,7 @@ function checkMigration() {
>  function tryReconnect() {
>      var time_since_started = new Date() - starttime;
>      var type = getQueryParameter('console');
> -    if (time_since_started < 5*1000 || type === 'shell') { // 5 seconds
> +    if (time_since_started < 5*1000 || type === 'shell' || type === 'cmd') { // 5 seconds
>  	stopTerminal();
>  	return;
>      }
> 

applied, with reworked commit message:

> support new 'cmd' parameter
> 
> We want to deprecate the 'upgrade' parameter in favor of a more
> general 'cmd' parameter, which is easier to extend, e.g., for
> installing pveceph through the WebUI.



More information about the pve-devel mailing list