Files
maze32/web/index.html
T

30 lines
1.1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>maze32</title>
<style>
:root { color-scheme: dark; font-family: system-ui, sans-serif; }
body { display: grid; min-height: 100vh; margin: 0; place-items: center; background: #10151d; color: #e7edf5; }
main { width: min(32rem, calc(100% - 3rem)); padding: 2rem; border: 1px solid #344255; border-radius: 1rem; background: #18212d; }
h1 { margin-top: 0; letter-spacing: .08em; }
output { color: #79dfa3; }
</style>
</head>
<body>
<main>
<h1>maze32</h1>
<p>The firmware and static application are running.</p>
<p>Device health: <output id="health">checking</output></p>
</main>
<script>
const output = document.querySelector('#health');
fetch('/health', { cache: 'no-store' })
.then(response => response.ok ? response.json() : Promise.reject(new Error('Health request failed')))
.then(health => { output.textContent = `${health.status} · version ${health.version}`; })
.catch(() => { output.textContent = 'unavailable'; });
</script>
</body>
</html>