queue-manager/templates/index.html

39 lines
1.1 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Wywoływane numery</title>
<style>
body{font-family:Helvetica,Arial;margin:30px;text-align:center}
.num{display:inline-block;margin:10px;padding:20px 30px;font-size:72px;font-weight:700;border:2px solid #333;border-radius:8px}
</style>
<script>
async function fetchCurrent(){
try{
const r = await fetch('/current');
const j = await r.json();
const cont = document.getElementById('nums');
cont.innerHTML = '';
const list = j.current || [];
if(list.length === 0){
cont.textContent = '-';
return;
}
list.forEach(n => {
const el = document.createElement('div');
el.className = 'num';
el.textContent = n;
cont.appendChild(el);
});
}catch(e){}
}
setInterval(fetchCurrent, 2000);
window.addEventListener('load', fetchCurrent);
</script>
</head>
<body>
<h1>Zapraszamy do stanowiska osoby z numerem:</h1>
<div id="nums">-</div>
</body>
</html>