Hopital en PLS
This commit is contained in:
@ -10,4 +10,4 @@ export default class {
|
||||
async getHtml() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ export default class extends AbstractView {
|
||||
</p>
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
22
frontend/static/js/views/GeneralChat.js
Normal file
22
frontend/static/js/views/GeneralChat.js
Normal file
@ -0,0 +1,22 @@
|
||||
import AbstractView from "./AbstractView.js";
|
||||
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.setTitle("General Chat");
|
||||
let url = `ws://${window.location.host}/ws/socket-server/`
|
||||
|
||||
const chatSocket = new WebSocket(url)
|
||||
chatSocket.onmessage = function(e) {
|
||||
let data = JSON.parse(e.data)
|
||||
console.log('Data:', data)
|
||||
}
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
return `
|
||||
<h1>General Chat</h1>
|
||||
|
||||
`;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user