mirror of https://github.com/portainer/portainer
fix(deletion): delete registries batch by batch EE-7084 (#11856)
parent
ccb6dd7f1a
commit
11404aaecb
|
@ -1,6 +1,7 @@
|
||||||
import _ from 'lodash-es';
|
import _ from 'lodash-es';
|
||||||
import { confirmDelete } from '@@/modals/confirm';
|
import { confirmDelete } from '@@/modals/confirm';
|
||||||
import { RegistryTypes } from 'Portainer/models/registryTypes';
|
import { RegistryTypes } from 'Portainer/models/registryTypes';
|
||||||
|
import { processItemsInBatches } from '@/react/common/processItemsInBatches';
|
||||||
|
|
||||||
angular.module('portainer.app').controller('RegistriesController', [
|
angular.module('portainer.app').controller('RegistriesController', [
|
||||||
'$q',
|
'$q',
|
||||||
|
@ -32,10 +33,9 @@ angular.module('portainer.app').controller('RegistriesController', [
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function deleteSelectedRegistries(selectedItems) {
|
async function deleteSelectedRegistries(selectedItems) {
|
||||||
var actionCount = selectedItems.length;
|
async function doRemove(registry) {
|
||||||
angular.forEach(selectedItems, function (registry) {
|
return RegistryService.deleteRegistry(registry.Id)
|
||||||
RegistryService.deleteRegistry(registry.Id)
|
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
Notifications.success('Registry successfully removed', registry.Name);
|
Notifications.success('Registry successfully removed', registry.Name);
|
||||||
var index = $scope.registries.indexOf(registry);
|
var index = $scope.registries.indexOf(registry);
|
||||||
|
@ -43,14 +43,11 @@ angular.module('portainer.app').controller('RegistriesController', [
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
Notifications.error('Failure', err, 'Unable to remove registry');
|
Notifications.error('Failure', err, 'Unable to remove registry');
|
||||||
})
|
});
|
||||||
.finally(function final() {
|
|
||||||
--actionCount;
|
|
||||||
if (actionCount === 0) {
|
|
||||||
$state.reload();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
await processItemsInBatches(selectedItems, doRemove);
|
||||||
|
$state.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
|
|
Loading…
Reference in New Issue