From 2280ae09a947cf50e13035d38efb857bbd4863be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20J=C3=A4ger?= Date: Mon, 15 Jul 2019 12:28:19 +0200 Subject: [PATCH] Fix #582: Add delay to button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The StdRemoveButton can now pass a delay parameter to the API. It is set undefined as default so that users of the button can set the parameter themselves. Signed-off-by: Dominic Jäger --- button/Button.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/button/Button.js b/button/Button.js index dade477..266bb83 100644 --- a/button/Button.js +++ b/button/Button.js @@ -104,6 +104,9 @@ Ext.define('Proxmox.button.StdRemoveButton', { disabled: true, + // time to wait for removal task to finish + delay: undefined, + config: { baseurl: undefined }, @@ -130,9 +133,11 @@ Ext.define('Proxmox.button.StdRemoveButton', { handler: function(btn, event, rec) { var me = this; + var url = me.getUrl(rec); + if (typeof me.delay !== 'undefined') url += "?delay=" + me.delay; Proxmox.Utils.API2Request({ - url: me.getUrl(rec), + url: url, method: 'DELETE', waitMsgTarget: me.waitMsgTarget, callback: function(options, success, response) {