1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

fix(edge-stacks): add an endpoint to delete the status of an edge stack EE-2432 (#6551)

This commit is contained in:
andres-portainer 2022-04-28 16:50:23 -03:00 committed by GitHub
parent 61a3bfe994
commit 8a6024ce9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 124 additions and 4 deletions

View file

@ -1,4 +1,5 @@
import _ from 'lodash-es';
import { confirmAsync } from '@/portainer/services/modal.service/confirm';
export class EdgeGroupFormController {
/* @ngInject */
@ -17,6 +18,7 @@ export class EdgeGroupFormController {
};
this.associateEndpoint = this.associateEndpoint.bind(this);
this.dissociateEndpointAsync = this.dissociateEndpointAsync.bind(this);
this.dissociateEndpoint = this.dissociateEndpoint.bind(this);
this.getDynamicEndpointsAsync = this.getDynamicEndpointsAsync.bind(this);
this.getDynamicEndpoints = this.getDynamicEndpoints.bind(this);
@ -39,6 +41,29 @@ export class EdgeGroupFormController {
}
dissociateEndpoint(endpoint) {
return this.$async(this.dissociateEndpointAsync, endpoint);
}
async dissociateEndpointAsync(endpoint) {
const confirmed = await confirmAsync({
title: 'Confirm action',
message: 'Removing the environment from this group will remove its corresponding edge stacks',
buttons: {
cancel: {
label: 'Cancel',
className: 'btn-default',
},
confirm: {
label: 'Confirm',
className: 'btn-primary',
},
},
});
if (!confirmed) {
return;
}
this.model.Endpoints = _.filter(this.model.Endpoints, (id) => id !== endpoint.Id);
}