jerdev38282 commited on
Commit
09f0702
·
verified ·
1 Parent(s): bc92698

Create public/index.html

Browse files
Files changed (1) hide show
  1. public/index.html +73 -0
public/index.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Uptime Performance Monitor</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
8
+ <style>
9
+ body {
10
+ background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
11
+ color: #fff;
12
+ min-height: 100vh;
13
+ font-family: "Segoe UI", sans-serif;
14
+ }
15
+ .glass {
16
+ background: rgba(255,255,255,0.08);
17
+ backdrop-filter: blur(12px);
18
+ border-radius: 16px;
19
+ padding: 20px;
20
+ box-shadow: 0 8px 32px rgba(0,0,0,0.4);
21
+ }
22
+ .badge-online { background: #00ff9d; color: #000; }
23
+ .badge-offline { background: #ff4d4d; }
24
+ h1 span { color: #00ff9d; }
25
+ </style>
26
+ </head>
27
+ <body>
28
+
29
+ <div class="container py-5">
30
+ <h1 class="text-center mb-4">⚡ <span>Uptime Performance</span> Monitor</h1>
31
+
32
+ <div id="uptime" class="text-center mb-3"></div>
33
+
34
+ <div class="row" id="cards"></div>
35
+ </div>
36
+
37
+ <script>
38
+ async function loadStatus() {
39
+ const res = await fetch("/status");
40
+ const data = await res.json();
41
+
42
+ document.getElementById("uptime").innerHTML =
43
+ `⏱ Server Uptime: <b>${data.uptimeSeconds}s</b> | 🕒 ${data.serverTime}`;
44
+
45
+ const cards = document.getElementById("cards");
46
+ cards.innerHTML = "";
47
+
48
+ Object.values(data.targets).forEach(t => {
49
+ const badge = t.lastStatus === "online"
50
+ ? "badge-online"
51
+ : "badge-offline";
52
+
53
+ cards.innerHTML += `
54
+ <div class="col-md-4 mb-4">
55
+ <div class="glass">
56
+ <h5>${t.url}</h5>
57
+ <span class="badge ${badge}">${t.lastStatus}</span>
58
+ <hr>
59
+ <p>✅ Success: ${t.success}</p>
60
+ <p>❌ Fail: ${t.fail}</p>
61
+ <small>Last Ping: ${t.lastPing || "N/A"}</small>
62
+ </div>
63
+ </div>
64
+ `;
65
+ });
66
+ }
67
+
68
+ loadStatus();
69
+ setInterval(loadStatus, 5000);
70
+ </script>
71
+
72
+ </body>
73
+ </html>