guest_worker/www/backend.html

72 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2019-10-31 14:35:24 +01:00
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="backend.css" />
2019-11-04 09:24:37 +01:00
<!-- <meta http-equiv="refresh" content="20">-->
2019-10-31 14:35:24 +01:00
</head>
<body>
<div id="wrapper">
<div id="header"><span id="aai">Artificial Artificial Intelligence</span> <img src="amazon.svg" /> </div>
2019-10-31 14:35:24 +01:00
<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>
2019-11-04 09:24:37 +01:00
<script src='/worker_specs/reconnecting-websocket.min.js'></script>
<script type='text/javascript'>
let ws = new ReconnectingWebSocket('ws://localhost:8888/status/ws')
2019-11-04 11:34:10 +01:00
let justOpened = false;
2019-11-04 09:24:37 +01:00
ws.addEventListener('open', () => {
// ws.send('hi server')
2019-11-04 11:34:10 +01:00
justOpened = true;
2019-11-04 09:24:37 +01:00
})
2019-11-04 11:34:10 +01:00
2019-11-04 09:24:37 +01:00
ws.addEventListener('message', (event) => {
console.log('message: ' + event.data)
let data = JSON.parse(event.data)
2019-11-04 11:34:10 +01:00
if(data.property == 'hit_id') {
// on connect all
if(!justOpened){
setTimeout(function(){
window.location.reload();
console.log(justOpened + ' reloaded')
},20000)
}
justOpened = false;
2019-11-04 09:24:37 +01:00
}
})
2019-11-04 11:34:10 +01:00
2019-11-04 09:24:37 +01:00
</script>
2019-10-31 14:35:24 +01:00
</body>
</html>