From: Thomas Lamprecht Date: Wed, 23 Jun 2021 17:40:54 +0000 (+0200) Subject: apt repos: make add-repo a checked command X-Git-Url: https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff_plain;h=0e79ce21c1d4e1819602349a0221a6b70628568c;hp=994fe897b7673b661b438ec4fd56c90fb9762711 apt repos: make add-repo a checked command Signed-off-by: Thomas Lamprecht --- diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js index 944f3bd..7cacd78 100644 --- a/src/node/APTRepositories.js +++ b/src/node/APTRepositories.js @@ -438,25 +438,27 @@ Ext.define('Proxmox.node.APTRepositories', { disabled: status !== undefined && status !== null, repoHandle: handle, handler: function(menuItem) { - let params = { - handle: menuItem.repoHandle, - }; - - if (me.digest !== undefined) { - params.digest = me.digest; - } - - Proxmox.Utils.API2Request({ - url: `/nodes/${me.nodename}/apt/repositories`, - method: 'PUT', - params: params, - failure: function(response, opts) { - Ext.Msg.alert(gettext('Error'), response.htmlStatus); - me.reload(); - }, - success: function(response, opts) { - me.reload(); - }, + Proxmox.Utils.checked_command(() => { + let params = { + handle: menuItem.repoHandle, + }; + + if (me.digest !== undefined) { + params.digest = me.digest; + } + + Proxmox.Utils.API2Request({ + url: `/nodes/${me.nodename}/apt/repositories`, + method: 'PUT', + params: params, + failure: function(response, opts) { + Ext.Msg.alert(gettext('Error'), response.htmlStatus); + me.reload(); + }, + success: function(response, opts) { + me.reload(); + }, + }); }); }, });