Update weather_overlay with latest main.py and test_websocket.html (including timestamp and correct WS URL)

This commit is contained in:
Ramforth
2025-10-31 18:52:09 +01:00
parent 4c7fad61cc
commit 02290744b7

View File

@@ -5,15 +5,19 @@
</head>
<body>
<h1>WebSocket Test</h1>
<p style="font-size: 0.8em; color: #666;">
Last Modified: <script>document.write(document.lastModified);</script>
</p>
<input type="text" id="message" placeholder="Enter message">
<button onclick="sendMessage()">Send</button>
<ul id="messages"></ul>
<script>
const ws = new WebSocket("wss://overlays.ramforth.net/weather_ws");
const ws = new WebSocket("ws://localhost:8000/ws");
ws.onmessage = function(event) {
const messages = document.getElementById('messages');
const message = document.createElement('li');
const content = document.createTextNode(event.data);
const timestamp = new Date().toLocaleTimeString();
const content = document.createTextNode(`[${timestamp}] ${event.data}`);
message.appendChild(content);
messages.appendChild(message);
};