Complete Task 1: Deploy and Monitoring

هذا الالتزام موجود في:
2026-07-27 16:54:24 +03:00
التزام dcc35d35bb
10 ملفات معدلة مع 259 إضافات و0 حذوفات

عرض الملف

@@ -0,0 +1,50 @@
async function loadStats() {
try {
const response = await fetch("/stats");
const data = await response.json();
// Service Status
const statusElement = document.getElementById("status");
if (data.status === "healthy") {
statusElement.textContent = "🟢 Healthy";
statusElement.style.color = "green";
} else {
statusElement.textContent = "🔴 Down";
statusElement.style.color = "red";
}
// Response Time
const responseElement = document.getElementById("response-time");
responseElement.textContent = data.response_time_ms + " ms";
if (data.response_time_ms < 100) {
responseElement.style.color = "green";
} else {
responseElement.style.color = "orange";
}
// Request Count
document.getElementById("requests").textContent = data.requests;
// Uptime
const minutes = Math.floor(data.uptime_seconds / 60);
const seconds = data.uptime_seconds % 60;
document.getElementById("uptime").textContent =
`${minutes} min ${seconds} sec`;
} catch (error) {
const statusElement = document.getElementById("status");
statusElement.textContent = "🔴 Down";
statusElement.style.color = "red";
document.getElementById("response-time").textContent = "--";
document.getElementById("requests").textContent = "--";
document.getElementById("uptime").textContent = "--";
}
}
loadStats();
setInterval(loadStats, 5000);

عرض الملف

@@ -0,0 +1,52 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f5f7fa;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
width: 90%;
max-width: 700px;
text-align: center;
}
h1 {
margin-bottom: 30px;
color: #333;
}
.card {
background-color: white;
margin: 15px 0;
padding: 20px;
border-radius: 10px;
border-left: 5px solid #007bff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.card h2 {
color: #555;
margin-bottom: 10px;
font-size: 26px;
}
.card p {
font-size: 32px;
font-weight: bold;
color: #007bff;
}
.refresh {
margin-top: 20px;
color: #777;
font-size: 15px;
}