diff --git a/websocket-chat/app/static/index.html b/websocket-chat/app/static/index.html index 2221754..eacff12 100644 --- a/websocket-chat/app/static/index.html +++ b/websocket-chat/app/static/index.html @@ -1,100 +1,118 @@ -
- -Your client ID is {{ CLIENT_ID }}
-Status: {{ status }}
-Messages:
-Your client ID is {{ CLIENT_ID }}
+Status: {{ status }}
- const app = { - data() { - return { - messages: [], - messageText: "", - ws: null, - status: "Disconnected", - WS_URL, - CLIENT_ID - } - }, - methods: { - makeMessage() { - return { - author: this.CLIENT_ID, - text: this.messageText, - timestamp: new Date().toISOString() - } - }, - submit() { - const message = this.makeMessage() - this.ws.send(JSON.stringify(message)) - this.messageText = "" - }, - connect(url) { - const ws = new WebSocket(url) +Messages:
+