frc_timecards/app/static/js/kiosk.js
QTech Servers 67bc482155 Fuck
2024-10-03 22:05:46 -04:00

22 lines
666 B
JavaScript

function update() {
fetch('https://time.qtechofficial.com/kiosk/data')
.then(response => response.json())
.then(data => {
let tbody = document.getElementById('tbody');
tbody.innerHTML = "";
console.log(data);
data.forEach(person => {
let tr = document.createElement('tr');
tbody.appendChild(tr);
let td_name = document.createElement('td');
td_name.innerHTML = person.first_name + " " + person.last_name;
tr.appendChild(td_name);
let td_time_here = document.createElement('td');
td_time_here.textContent = person.time_here;
tr.appendChild(td_time_here);
})
})
.catch(error => console.error(error))
}
setInterval(update, 1000);