diff --git a/src/app/vm/shared/vm-actions.service.ts b/src/app/vm/shared/vm-actions.service.ts index 2955251c57..1eb7c0e36e 100644 --- a/src/app/vm/shared/vm-actions.service.ts +++ b/src/app/vm/shared/vm-actions.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { VirtualMachineAction } from '../vm-actions/vm-action'; +import { VirtualMachineAction, VirtualMachineActionType, VmActions } from '../vm-actions/vm-action'; import { VirtualMachine } from './vm.model'; import { ActionsService } from '../../shared/interfaces/action-service.interface'; import { DialogService } from '../../dialog/dialog-module/dialog.service'; @@ -40,6 +40,29 @@ export class VmActionsService implements ActionsService { - // observables.forEach(observable => { - // observable.subscribe(job => { - // const action = this.vmActionsService.getAction(job.cmd); - // this.jobsNotificationService.finish({ - // message: action.tokens.successMessage - // }); - // }); - // }); - // }); + this.vmService.resubscribe() + .subscribe(observables => { + observables.forEach(observable => { + observable.subscribe(job => { + const action = this.vmActionsService.getActionByName(job.cmd as VirtualMachineActionType); + this.jobsNotificationService.finish({ + message: action.tokens.successMessage + }); + }); + }); + }); } private subscribeToVmDestroyed(): void {