mirror of https://github.com/portainer/portainer
fix(docker): comfirm modal for removing secrets/networks/configs [EE-4211] (#7882)
* fix(ui): comfirm modal for removing secrets/networks/configs [EE-4211] * fix(ui): comfirm modal for removing secrets/networks/configs [EE-4211] * fix(ui): comfirm modal for removing secrets/networks/configs [EE-4211]pull/7917/head
parent
7624ff10ee
commit
0365ed8e70
|
@ -1,4 +1,5 @@
|
|||
import angular from 'angular';
|
||||
import { confirmDeletionAsync } from 'Portainer/services/modal.service/confirm';
|
||||
|
||||
class ConfigsController {
|
||||
/* @ngInject */
|
||||
|
@ -31,7 +32,11 @@ class ConfigsController {
|
|||
this.getConfigs();
|
||||
}
|
||||
|
||||
removeAction(selectedItems) {
|
||||
async removeAction(selectedItems) {
|
||||
const confirmed = await confirmDeletionAsync('Do you want to remove the selected config(s)?');
|
||||
if (!confirmed) {
|
||||
return null;
|
||||
}
|
||||
return this.$async(this.removeActionAsync, selectedItems);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import _ from 'lodash-es';
|
||||
import DockerNetworkHelper from 'Docker/helpers/networkHelper';
|
||||
import { isOfflineEndpoint } from '@/portainer/helpers/endpointHelper';
|
||||
import { confirmDeletionAsync } from 'Portainer/services/modal.service/confirm';
|
||||
|
||||
angular.module('portainer.docker').controller('NetworksController', [
|
||||
'$q',
|
||||
|
@ -12,7 +13,11 @@ angular.module('portainer.docker').controller('NetworksController', [
|
|||
'endpoint',
|
||||
'AgentService',
|
||||
function ($q, $scope, $state, NetworkService, Notifications, HttpRequestHelper, endpoint, AgentService) {
|
||||
$scope.removeAction = function (selectedItems) {
|
||||
$scope.removeAction = async function (selectedItems) {
|
||||
const confirmed = await confirmDeletionAsync('Do you want to remove the selected network(s)?');
|
||||
if (!confirmed) {
|
||||
return null;
|
||||
}
|
||||
var actionCount = selectedItems.length;
|
||||
angular.forEach(selectedItems, function (network) {
|
||||
HttpRequestHelper.setPortainerAgentTargetHeader(network.NodeName);
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
import { confirmDeletionAsync } from 'Portainer/services/modal.service/confirm';
|
||||
angular.module('portainer.docker').controller('SecretsController', [
|
||||
'$scope',
|
||||
'$state',
|
||||
'SecretService',
|
||||
'Notifications',
|
||||
function ($scope, $state, SecretService, Notifications) {
|
||||
$scope.removeAction = function (selectedItems) {
|
||||
$scope.removeAction = async function (selectedItems) {
|
||||
const confirmed = await confirmDeletionAsync('Do you want to remove the selected secret(s)?');
|
||||
if (!confirmed) {
|
||||
return null;
|
||||
}
|
||||
var actionCount = selectedItems.length;
|
||||
angular.forEach(selectedItems, function (secret) {
|
||||
SecretService.remove(secret.Id)
|
||||
|
|
Loading…
Reference in New Issue