1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-03 12:55:23 +02:00

feat(k8s): front end backport to CE

This commit is contained in:
Felix Han 2021-08-31 11:10:22 +12:00 committed by Dmitry Salakhov
parent b5c59c8982
commit a5058e8f1e
17 changed files with 159 additions and 69 deletions

View file

@ -7,7 +7,7 @@ import KubernetesApplicationHelper from 'Kubernetes/helpers/application';
class KubernetesApplicationsController {
/* @ngInject */
constructor($async, $state, Notifications, KubernetesApplicationService, Authentication, ModalService, LocalStorage) {
constructor($async, $state, Notifications, KubernetesApplicationService, Authentication, ModalService, LocalStorage, StackService) {
this.$async = $async;
this.$state = $state;
this.Notifications = Notifications;
@ -16,6 +16,7 @@ class KubernetesApplicationsController {
this.Authentication = Authentication;
this.ModalService = ModalService;
this.LocalStorage = LocalStorage;
this.StackService = StackService;
this.onInit = this.onInit.bind(this);
this.getApplications = this.getApplications.bind(this);
@ -66,6 +67,9 @@ class KubernetesApplicationsController {
for (const application of selectedItems) {
try {
await this.KubernetesApplicationService.delete(application);
if (application.StackId) {
await this.StackService.remove({ Id: application.StackId }, false, this.endpoint.Id);
}
this.Notifications.success('Application successfully removed', application.Name);
const index = this.applications.indexOf(application);
this.applications.splice(index, 1);