guest_worker/www/backend.html
2019-11-04 09:24:37 +01:00

54 lines
1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="backend.css" />
<!-- <meta http-equiv="refresh" content="20">-->
</head>
<body>
<div id="wrapper">
<div id="header"><span id="aai">Artificial Artificial Intelligence</span> <img src="amazon.svg" /> </div>
<table>
<thead>
<tr>
<th></th>
<th>worker id</th>
<th>ip address</th>
<th>country</th>
<th>fee</th>
<th>task start time</th>
<th>task completion time</th>
<th></th>
</tr>
</thead>
<tbody>
{{TBODY}}
</tbody>
</table>
</div>
<script src='/worker_specs/reconnecting-websocket.min.js'></script>
<script type='text/javascript'>
let ws = new ReconnectingWebSocket('ws://localhost:8888/status/ws')
ws.addEventListener('open', () => {
// ws.send('hi server')
})
ws.addEventListener('message', (event) => {
console.log('message: ' + event.data)
let data = JSON.parse(event.data)
if(data.property === 'hit_id') {
window.location.reload();
}
})
</script>
</body>
</html>