109 lines
3.7 KiB
HTML
109 lines
3.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="stylesheet" href="styles.css" />
|
|
<title>status.gractwo.pl</title>
|
|
</head>
|
|
<body class="min-h-screen w-full bg-zinc-950 text-zinc-50 flex flex-col">
|
|
<div class="mx-auto max-w-4xl w-full p-4">
|
|
<div
|
|
class="flex flex-col max-[369px]:gap-4 max-[369px]:text-center min-[370px]:flex-row justify-between items-center bg-zinc-900 p-4 rounded border border-zinc-800"
|
|
>
|
|
<div class="z-20">
|
|
<h1 class="font-extralight text-2xl">Gractwo Status</h1>
|
|
<p class="text-zinc-400 font-extralight text-xs">
|
|
is everything alright?
|
|
</p>
|
|
</div>
|
|
<p class="text-zinc-400 font-extralight z-20">
|
|
Refreshing in <span id="secondsleft">30</span>s.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- -->
|
|
|
|
<div
|
|
class="max-w-4xl w-full mx-auto p-4 gap-4 grid grid-cols-1 sm:grid-cols-2"
|
|
>
|
|
<div
|
|
class="bg-zinc-900 p-4 rounded border border-zinc-800 flex flex-row justify-between"
|
|
>
|
|
<h2 class="font-extralight">gractwo.pl</h2>
|
|
<p id="status-gractwo" class="text-yellow-400">...</p>
|
|
</div>
|
|
<div
|
|
class="bg-zinc-900 p-4 rounded border border-zinc-800 flex flex-row justify-between"
|
|
>
|
|
<h2 class="font-extralight">arche.gractwo.pl</h2>
|
|
<p id="status-arche" class="text-yellow-400">...</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- -->
|
|
|
|
<div class="opacity-0 text-emerald-400"></div>
|
|
<div class="opacity-0 text-yellow-400"></div>
|
|
<div class="opacity-0 text-red-400"></div>
|
|
|
|
<!-- -->
|
|
|
|
<div class="mx-auto p-4 mt-auto">
|
|
<p class="text-zinc-400 text-sm">
|
|
Hosted independently of all mentioned infrastructure -
|
|
statically via GitHub Pages.
|
|
</p>
|
|
</div>
|
|
|
|
<script defer>
|
|
const services = [
|
|
{
|
|
name: "gractwo",
|
|
url: "https://gractwo.pl",
|
|
elementId: "status-gractwo",
|
|
},
|
|
{
|
|
name: "arche",
|
|
url: "https://arche.gractwo.pl",
|
|
elementId: "status-arche",
|
|
},
|
|
];
|
|
|
|
function updateStatus(el, status, colorClass) {
|
|
el.textContent = status;
|
|
el.className = colorClass;
|
|
}
|
|
|
|
async function checkService(service) {
|
|
const el = document.getElementById(service.elementId);
|
|
try {
|
|
await fetch(service.url, {
|
|
method: "HEAD",
|
|
mode: "no-cors",
|
|
});
|
|
updateStatus(el, "¯\\_(ツ)_/¯", "text-emerald-400");
|
|
} catch {
|
|
updateStatus(el, "Unreachable", "text-red-400");
|
|
}
|
|
}
|
|
|
|
function refreshStatuses() {
|
|
services.forEach(checkService);
|
|
}
|
|
refreshStatuses();
|
|
|
|
let seconds = 30;
|
|
const secondsLeft = document.getElementById("secondsleft");
|
|
setInterval(() => {
|
|
seconds--;
|
|
if (seconds <= 0) seconds = 30;
|
|
secondsLeft.textContent = seconds;
|
|
|
|
if (seconds == 30) refreshStatuses();
|
|
}, 1000);
|
|
</script>
|
|
</body>
|
|
</html>
|