const onlineSymbol = document.querySelector(".onlineSymbol");


async function updateStatus() {
    const res = await fetch("/status");
    const data = await res.json();

    if (data.online) {
        onlineSymbol.style.backgroundColor = "rgb(0, 181, 0)";
        onlineSymbol.textContent = "Online";
    } else {
        onlineSymbol.style.backgroundColor = "red";
        onlineSymbol.textContent = "Offline";
    }
}

setInterval(updateStatus, 3000);
updateStatus();
