This is an automated email from the ASF dual-hosted git repository. ankovalyshyn pushed a commit to branch DLAB-959 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 6d2aa2275262eaf1dad38cfa15492c0727a1d89c Author: Andriana Kovalyshyn <[email protected]> AuthorDate: Tue Aug 6 13:33:22 2019 +0300 [DLAB-959]: split action requests --- .../management/management.component.ts | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts index 28064cb..94a9ebb 100644 --- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts @@ -127,15 +127,20 @@ export class ManagementComponent implements OnInit { }, error => this.toastr.error(error.message, 'Oops!')); } - manageEnvironment(event: { action: string, user: string }) { - this.healthStatusService.manageEnvironment(event.action, event.user) - .subscribe(res => { - this.getActiveUsersList().subscribe(usersList => { - this.toastr.success(`Action ${event.action} is processing!`, 'Processing!'); - this.buildGrid(); - }); - }, - error => this.toastr.error(error.message, 'Oops!')); + manageEnvironment(event: { action: string, project: any }) { + if (event.action === 'stop') + this.projectService + .toggleProjectStatus(event.project, event.action) + .subscribe(() => + this.toastr.success(`Action ${event.action} is processing!`, 'Processing!') && + this.buildGrid(), error => this.toastr.error(error.message, 'Oops!')); + + if (event.action === 'terminate') + this.projectService.deleteProject(event.project.project_name) + .subscribe(() => + this.toastr.success(`Action ${event.action} is processing!`, 'Processing!') && + this.buildGrid(), error => this.toastr.error(error.message, 'Oops!')); + } get creatingBackup(): boolean { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
