Update all files

This commit is contained in:
Mistral Vibe
2026-03-29 20:44:23 +02:00
parent 19a119ace2
commit f7a07ba05e
9 changed files with 2084 additions and 24 deletions

40
test_websocket.html Normal file
View File

@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>WebSocket Test</title>
</head>
<body>
<h1>WebSocket Test</h1>
<p id="status">Connecting...</p>
<script>
const versionId = "625b4a46-bb84-44c5-bfce-13f62b2b4dcf"; // Use the same ID from the error
const ws = new WebSocket(`ws://${window.location.host}/ws/versions/${versionId}`);
ws.onopen = () => {
document.getElementById("status").textContent = "Connected!";
document.getElementById("status").style.color = "green";
// Send a ping
ws.send(JSON.stringify({ event: "ping" }));
};
ws.onmessage = (event) => {
console.log("Message received:", event.data);
const data = JSON.parse(event.data);
if (data.event === "pong") {
document.getElementById("status").textContent += " Pong received!";
}
};
ws.onerror = (error) => {
document.getElementById("status").textContent = "Error: " + error.message;
document.getElementById("status").style.color = "red";
console.error("WebSocket error:", error);
};
ws.onclose = () => {
document.getElementById("status").textContent += " Connection closed";
};
</script>
</body>
</html>