diff --git a/src/app/services/processmanager.service.ts b/src/app/services/processmanager.service.ts index 677119f..3e948a6 100644 --- a/src/app/services/processmanager.service.ts +++ b/src/app/services/processmanager.service.ts @@ -21,22 +21,19 @@ export class ProcessManagerService { .pipe(filter(message => message.data.process_name === process_name)).subscribe(callback); } - sendCommand(command: string, process_name: string, callback?: (event: any) => void) { - if (callback) { - this.subscribeCallback(process_name, callback); - } + sendCommand(command: string, process_name: string) { this.webSocketService.send(this.key, {'command': command, 'process_name': process_name}); } - startProcess(process_name: string, callback?: (event: any) => void) { - this.sendCommand('start', process_name, callback); + startProcess(process_name: string) { + this.sendCommand('start', process_name); } - stopProcess(process_name: string, callback?: (event: any) => void) { - this.sendCommand('stop', process_name, callback); + stopProcess(process_name: string) { + this.sendCommand('stop', process_name); } - restartProcess(process_name: string, callback?: (event: any) => void) { - this.sendCommand('restart', process_name, callback); + restartProcess(process_name: string) { + this.sendCommand('restart', process_name); } } diff --git a/src/app/webide/webide.component.ts b/src/app/webide/webide.component.ts index 41aee77..53bfd05 100644 --- a/src/app/webide/webide.component.ts +++ b/src/app/webide/webide.component.ts @@ -47,6 +47,7 @@ export class WebideComponent implements OnInit { this.subscribeWS(); this.requestCode(); this.processManagerService.init(); + this.processManagerService.subscribeCallback('login', (event) => { console.log('CICÁK!!'); }); } subscribeWS() { @@ -89,7 +90,7 @@ export class WebideComponent implements OnInit { 'content': this.code }); this.saveButtonState = 'SAVING'; - this.processManagerService.restartProcess('login', (event) => { console.log('CICÁK!!'); }); + this.processManagerService.restartProcess('login'); } requestCode() {