]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
apt repos: make add-repo a checked command
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 17:40:54 +0000 (19:40 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 17:40:54 +0000 (19:40 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/node/APTRepositories.js

index 944f3bd61abd0ec3fea051a7c1d421fc370c6f82..7cacd78161bb7daade22a66266eb41809cd79b8b 100644 (file)
@@ -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();
+                           },
+                       });
                    });
                },
            });