|
|
|
@ -140,6 +140,10 @@ export class EditorComponent {
|
|
|
|
|
private client: WebSocket | undefined;
|
|
|
|
|
@Input()
|
|
|
|
|
set idRoom(idRoom: string) {
|
|
|
|
|
if( idRoom === undefined){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.client = new WebSocket(`ws://127.0.0.1:3000/live/${idRoom}`);
|
|
|
|
|
this.client.addEventListener('open', async () => {
|
|
|
|
|
let conn = new Connection(this.client!);
|
|
|
|
@ -162,11 +166,14 @@ export class EditorComponent {
|
|
|
|
|
private router: Router,
|
|
|
|
|
private backendService: BackendService
|
|
|
|
|
) {
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
backendService.getResult().subscribe((msg) => {
|
|
|
|
|
if (msg.type === 'stdout' || msg.type === 'stderr') {
|
|
|
|
|
this.resultContent += msg.text;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> 5f66c6e (lien editor -> live editor)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Efface le contenu de l'éditeur
|
|
|
|
@ -175,7 +182,7 @@ export class EditorComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async onCreateRoomButtonClicked() {
|
|
|
|
|
const idRoom = await this.backendService.createRoom();
|
|
|
|
|
const idRoom = await this.backendService.createRoom(this.editorContent);
|
|
|
|
|
await this.router.navigate([`./editor-live/${idRoom}`]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|