mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:51:55 +00:00
Hook process restarting to 'Save' button click
This commit is contained in:
parent
052dbad0e4
commit
848c7ce71b
@ -14,6 +14,7 @@ import 'brace/mode/sql';
|
|||||||
import 'brace/theme/monokai';
|
import 'brace/theme/monokai';
|
||||||
import { SourceCode } from './source-code';
|
import { SourceCode } from './source-code';
|
||||||
import { WebSocketService } from '../services/websocket.service';
|
import { WebSocketService } from '../services/websocket.service';
|
||||||
|
import { ProcessManagerService } from '../services/processmanager.service';
|
||||||
|
|
||||||
const modelist = brace.acequire('ace/ext/modelist');
|
const modelist = brace.acequire('ace/ext/modelist');
|
||||||
|
|
||||||
@ -38,12 +39,14 @@ export class WebideComponent implements OnInit {
|
|||||||
'write': this.writeHandler.bind(this)};
|
'write': this.writeHandler.bind(this)};
|
||||||
|
|
||||||
constructor(private webSocketService: WebSocketService,
|
constructor(private webSocketService: WebSocketService,
|
||||||
private changeDetectorRef: ChangeDetectorRef) { }
|
private changeDetectorRef: ChangeDetectorRef,
|
||||||
|
private processManagerService: ProcessManagerService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.webSocketService.connect();
|
this.webSocketService.connect();
|
||||||
this.subscribeWS();
|
this.subscribeWS();
|
||||||
this.requestCode();
|
this.requestCode();
|
||||||
|
this.processManagerService.init('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribeWS() {
|
subscribeWS() {
|
||||||
@ -86,6 +89,7 @@ export class WebideComponent implements OnInit {
|
|||||||
'content': this.code
|
'content': this.code
|
||||||
});
|
});
|
||||||
this.saveButtonState = 'SAVING';
|
this.saveButtonState = 'SAVING';
|
||||||
|
this.processManagerService.restartProcess((event) => { console.log('CICÁK!!'); });
|
||||||
}
|
}
|
||||||
|
|
||||||
requestCode() {
|
requestCode() {
|
||||||
|
Loading…
Reference in New Issue
Block a user