[pve-devel] [PATCH storage v3] Fix #582: Add delay to remove button

Dominik Csapak d.csapak at proxmox.com
Thu Jul 4 13:54:12 CEST 2019


On 7/4/19 12:54 PM, Dominic Jäger wrote:
> Using the standard remove button on the GUI now passes a delay of 5 to
> to the API. Advanced users can still set the delay on the CLI themselves while
> beginners are offered a default that should work for many cases.

like we discussed off-list, it does not really make sense to
set the default to 'delay: 5' but let the user of the stdremovebutton decide

also, the subjectprefix should be the name of the repository
in this case 'widget-toolkit' or 'proxmox-widget-toolkit'

one comment inline:

> 
> Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
> ---
>   button/Button.js | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/button/Button.js b/button/Button.js
> index dade477..f5ff2b9 100644
> --- a/button/Button.js
> +++ b/button/Button.js
> @@ -104,6 +104,8 @@ Ext.define('Proxmox.button.StdRemoveButton', {
>   
>       disabled: true,
>   
> +    delay: 5,
> +
>       config: {
>   	baseurl: undefined
>       },
> @@ -132,7 +134,7 @@ Ext.define('Proxmox.button.StdRemoveButton', {
>   	var me = this;
>   
>   	Proxmox.Utils.API2Request({
> -	    url: me.getUrl(rec),
> +	    url: me.getUrl(rec) + "?delay="+me.delay,

we should check here if delay is undefined, and only
add it if it is not, else we get

?delay=undefined, which would trigger an parameter exception

>   	    method: 'DELETE',
>   	    waitMsgTarget: me.waitMsgTarget,
>   	    callback: function(options, success, response) {
> 




More information about the pve-devel mailing list