guest_worker/www/status.html
2019-10-30 15:19:32 +01:00

22 lines
No EOL
426 B
HTML

<html>
<head>
<title>Status</title>
</head>
<body>
Status!
websocket at /status/ws
<ol id='msgs'>
</ol>
<script>
let url = window.location.origin.replace('http', 'ws') +'/status/ws';
let el = document.getElementById("msgs")
let socket = new WebSocket(url);
socket.addEventListener('message', function(e){
let liEl = document.createElement('li');
liEl.innerHTML = e.data;
el.appendChild(liEl);
});
</script>
</body>
</html>