Files
daynivo-kiosk-os/www/kiosk.js
T
rothmanandClaude Opus 5.5 19595aaf39
CI / test-bookworm (push) Failing after 2s
CI / test-latest (push) Successful in 31s
Kiosk start, offline and setup pages in the InfoFlow display style
Dark grey background, name top left, date and clock top right, a flat
panel with a blue top edge. The pages show the kiosk link (token masked)
and the management address; the clock code is shared in kiosk.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 23:13:03 +01:00

26 lines
1.0 KiB
JavaScript

// Shared by the local kiosk pages: device name, clock/date, kiosk link and admin address.
const params = new URLSearchParams(location.search);
const fmtTime = new Intl.DateTimeFormat("nl-NL", { hour: "2-digit", minute: "2-digit" });
const fmtDate = new Intl.DateTimeFormat("nl-NL", { weekday: "long", day: "numeric", month: "long" });
function setText(id, text) {
const el = document.getElementById(id);
if (el) el.textContent = text;
}
setText("name", params.get("name") || "VoxIP Kiosk");
// The link arrives with its token already masked (…abcd).
const link = (params.get("url") || "").replace(/^https:\/\//, "");
if (link) setText("link-url", link);
else document.getElementById("link")?.setAttribute("hidden", "");
setText("admin", params.get("admin") ? "Beheer: " + params.get("admin") : "");
function tickClock() {
const now = new Date();
setText("clock", fmtTime.format(now));
const date = fmtDate.format(now);
setText("date", date.charAt(0).toUpperCase() + date.slice(1));
}
tickClock();
setInterval(tickClock, 1000);