apt repos: make add-repo a checked command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-23 19:40:54 +02:00
parent 994fe897b7
commit 0e79ce21c1

View 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,
};
Proxmox.Utils.checked_command(() => {
let params = {
handle: menuItem.repoHandle,
};
if (me.digest !== undefined) {
params.digest = me.digest;
}
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.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();
},
});
});
},
});