iceyfox.xyz/dmu/mapqueue.html

106 lines
1.9 KiB
HTML

<html>
<head>
<title>dmu map queue</title>
<style>
html{
background-color: #000000;
color: #ffffff;
background: url('dmu map queue.png');
background-size: cover;
background-position: center center;
background-attachment: fixed;
}
.main-wrap{
background-color: #111111f0;
width: 80%;
min-height: 800px;
}
a{
color: #007fff;
}
p, td, a{
font-size: 20px;
}
td{
border: 2px solid white;
padding: 5px;
}
.warn{
color: #efef00;
}
</style>
</head>
<body>
<div align="center">
<div class="main-wrap">
<a href="http://iceyfox.x10host.com/" target="_BLANK">main page</a>
<br><br>
<p class="warn">this site updates by itself. do not spam refresh!</p>
<p>this shows what orders are in queue</p>
<br><br><br>
<h1>in queue</h1>
<table id="todo_queue"></table>
<br><br>
<h1>done maps</h1>
<table id="done_list"></table>
</div>
</div>
<script language="javascript">
function fetch_loop(){
fetch('map_queue.json')
.then(response => response.json())
.then(res=>{
update_list(res);
});
setTimeout(fetch_loop,3000);
}
fetch_loop();
function update_list(res){
let str="<tr><td>username</td><td>word(s)</td><td>color</td><td>status</td><td>comments</td><td>date</td></tr>"
res.todo.forEach(item=>{
let Scolor= item.status=="active" ? "#00ff5f" : "#d03f00";
console.log(item);
str+="<tr><td>"+item.name
+"</td><td>"+item.words
+"</td><td>"+item.color
+"</td><td style=\"color:"+Scolor+";\">"+item.status
+"</td><td>"+item.comments
+"</td><td>"+item.issue_date
+"</td></tr>"
});
todo_queue.innerHTML=str
str="<tr><td>username</td><td>word(s)</td><td>color</td><td>comments</td><td>issued date</td><td>finished date</td></tr>"
res.done.forEach(item=>{
console.log(item);
str+="<tr><td>"+item.name
+"</td><td>"+item.words
+"</td><td>"+item.color
+"</td><td>"+item.comments
+"</td><td>"+item.issue_date
+"</td><td>"+item.finished_date
+"</td></tr>"
});
done_list.innerHTML=str
}
</script>
</body>
</html>