diff --git a/assets/index.js b/assets/index.js index 4b8be67..d8e1a51 100644 --- a/assets/index.js +++ b/assets/index.js @@ -68,6 +68,21 @@ function eraselabel(label) { label.setAttribute("data-animation-interval", eraseInterval); } +// we get the client info from the headers +// unclean but it works +function updateClientInfo() { + fetch(window.location.href) + .then((response) => { + const clientInfo = response.headers.get("X-Client-Info"); + if (clientInfo) { + document.querySelector(".location").textContent = clientInfo; + } + }) + .catch((error) => { + console.error("Error fetching X-Client-Info:", error); + }); +} + // updates the time display // probably updates too much but eh function updateTime() { @@ -291,6 +306,8 @@ document.addEventListener("DOMContentLoaded", () => { updateStatus(); setInterval(updateStatus, STATUS_UPDATE_INTERVAL); + updateClientInfo(); + const activeNavIcon = document.querySelector(".nav-icon.active"); if (activeNavIcon) { const label = activeNavIcon.querySelector(".nav-label");