93 أسطر
1.4 KiB
HTML
93 أسطر
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Ghaymah SRE Dashboard</title>
|
|
|
|
<style>
|
|
body{
|
|
font-family:Arial,sans-serif;
|
|
background:#f4f4f4;
|
|
margin:40px;
|
|
}
|
|
|
|
.container{
|
|
max-width:700px;
|
|
margin:auto;
|
|
background:white;
|
|
padding:20px;
|
|
border-radius:10px;
|
|
box-shadow:0 0 10px rgba(0,0,0,.1);
|
|
}
|
|
|
|
.card{
|
|
margin:15px 0;
|
|
padding:15px;
|
|
border-radius:8px;
|
|
background:#fafafa;
|
|
}
|
|
|
|
.value{
|
|
font-size:28px;
|
|
font-weight:bold;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="container">
|
|
|
|
<h2>Ghaymah API Monitoring Dashboard</h2>
|
|
|
|
<div class="card">
|
|
<h3>Status</h3>
|
|
<div id="status" class="value">Checking...</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h3>Latency</h3>
|
|
<div id="latency" class="value">-- ms</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h3>Total Requests</h3>
|
|
<div id="requests" class="value">0</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
async function update(){
|
|
|
|
const start=performance.now();
|
|
|
|
try{
|
|
|
|
const response=await fetch("/health");
|
|
const data=await response.json();
|
|
|
|
const latency=(performance.now()-start).toFixed(2);
|
|
|
|
document.getElementById("status").innerHTML="🟢 UP";
|
|
document.getElementById("latency").innerHTML=latency+" ms";
|
|
document.getElementById("requests").innerHTML=data.requests;
|
|
|
|
}catch(e){
|
|
|
|
document.getElementById("status").innerHTML="🔴 DOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
update();
|
|
|
|
setInterval(update,30000);
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|