-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.html
More file actions
320 lines (294 loc) · 11.6 KB
/
status.html
File metadata and controls
320 lines (294 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=1440">
<title>Data Pipeline Status – ARC</title>
<link rel="icon" type="image/png" sizes="any" href="assets/images/favicon.png">
<link href="assets/images/favicon.png" rel="icon" media="(prefers-color-scheme: light)">
<link href="assets/images/favicon.png" rel="icon" media="(prefers-color-scheme: dark)">
<link rel="apple-touch-icon" href="assets/images/favicon.png">
<link rel="manifest" href="/site.webmanifest">
<meta name="theme-color" content="#333333">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;1,400&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; background: url('assets/images/support-page-background.webp') center / cover no-repeat fixed; }
body {
font-family: "Ubuntu", sans-serif;
background: transparent;
color: #222;
min-height: 100%;
-webkit-font-smoothing: antialiased;
}
/* ── header (matches contact page exactly) ─────────────────────────────── */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 36px 72px 0;
}
.page-header .logo img { height: 54px; width: auto; }
.page-header nav { display: flex; align-items: center; gap: 24px; }
.page-header nav a {
font-size: 14px;
font-weight: 400;
color: #888;
text-decoration: none;
transition: color 0.2s;
}
.page-header nav a:hover { color: #222; }
.linkedin-icon {
display: inline-flex;
align-items: center;
justify-content: center;
opacity: 0.45;
transition: opacity 0.2s;
}
.linkedin-icon:hover { opacity: 0.8; }
.linkedin-icon svg { width: 22px; height: 22px; fill: #222; }
/* ── hero ──────────────────────────────────────────────────────────────── */
.page-hero {
text-align: center;
padding: 48px 80px 16px;
}
.page-hero h1 {
font-size: 46px;
font-weight: 500;
color: #111;
margin-bottom: 12px;
letter-spacing: -0.5px;
}
.page-hero .tagline {
font-size: 18px;
font-weight: 300;
color: #666;
max-width: 680px;
margin: 0 auto;
line-height: 1.5;
}
/* ── body layout ───────────────────────────────────────────────────────── */
.page-body {
max-width: 960px;
margin: 0 auto;
padding: 32px 72px 80px;
}
/* ── overall badge ─────────────────────────────────────────────────────── */
.overall-badge {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 8px 18px;
border-radius: 999px;
font-size: 15px;
font-weight: 400;
margin-bottom: 8px;
}
.overall-badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.overall-badge.ok { background: rgba(34,197,94,0.12); color: #15803d; }
.overall-badge.ok .dot { background: #22c55e; }
.overall-badge.stale { background: rgba(239,68,68,0.1); color: #b91c1c; }
.overall-badge.stale .dot { background: #ef4444; }
.overall-badge.unknown { background: rgba(0,0,0,0.06); color: #888; }
.overall-badge.unknown .dot { background: #bbb; }
.meta-line {
font-size: 13px;
font-weight: 300;
color: #888;
margin-bottom: 28px;
display: flex;
align-items: center;
gap: 4px;
}
/* ── card (matches contact-form-card) ──────────────────────────────────── */
.status-card {
background: rgba(255,255,255,0.75);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(0,0,0,0.08);
border-radius: 16px;
padding: 36px;
}
/* ── section heading (matches contact-info h2) ─────────────────────────── */
.section-heading {
font-size: 17px;
font-weight: 500;
color: #111;
letter-spacing: 0.2px;
margin-bottom: 20px;
}
.section-heading::before {
content: "";
display: inline-block;
width: 3px;
height: 15px;
background: #ccc;
border-radius: 2px;
margin-right: 10px;
vertical-align: middle;
position: relative;
top: -1px;
}
/* ── table ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
font-size: 11px;
font-weight: 500;
color: #bbb;
text-transform: uppercase;
letter-spacing: 0.08em;
padding: 0 16px 10px 0;
text-align: left;
border-bottom: 1px solid rgba(0,0,0,0.07);
}
tbody tr { border-bottom: 1px solid rgba(0,0,0,0.05); }
tbody tr:last-child { border-bottom: none; }
tbody td {
padding: 13px 16px 13px 0;
font-size: 14px;
font-weight: 300;
color: #444;
vertical-align: top;
}
.source-name { font-weight: 400; color: #111; margin-bottom: 2px; }
.source-note { font-size: 12px; color: #bbb; }
/* ── status pill ───────────────────────────────────────────────────────── */
.pill {
display: inline-block;
padding: 2px 10px;
border-radius: 999px;
font-size: 11.5px;
font-weight: 500;
letter-spacing: 0.03em;
white-space: nowrap;
}
.pill.ok { background: rgba(34,197,94,0.12); color: #15803d; }
.pill.stale { background: rgba(239,68,68,0.10); color: #b91c1c; }
.pill.unknown { background: rgba(0,0,0,0.06); color: #888; }
/* ── refresh button ────────────────────────────────────────────────────── */
.refresh-btn {
font-family: "Ubuntu", sans-serif;
font-size: 13px;
font-weight: 300;
color: #888;
background: none;
border: 1px solid rgba(0,0,0,0.12);
border-radius: 8px;
padding: 4px 12px;
cursor: pointer;
transition: color 0.2s, border-color 0.2s;
}
.refresh-btn:hover { color: #222; border-color: rgba(0,0,0,0.3); }
/* ── footer (matches site) ─────────────────────────────────────────────── */
#site-footer {
position: fixed;
bottom: 6px;
right: 10px;
z-index: 10;
font-family: "Ubuntu", sans-serif;
font-size: 10px;
font-weight: 300;
color: rgba(0,0,0,0.4);
pointer-events: auto;
}
#site-footer a { color: rgba(0,0,0,0.4); text-decoration: none; }
#site-footer a:hover { color: rgba(0,0,0,0.6); }
</style>
</head>
<body>
<div id="main">
<div class="page-header">
<a href="/" class="logo"><img src="assets/images/arc-logo.png" alt="ARC" decoding="auto"></a>
<nav>
<a href="/about">About</a>
<a href="/contact">Contact</a>
<a href="/privacy">Privacy</a>
<a href="https://www.linkedin.com/company/arc-cool-buildings" target="_blank" rel="noopener" class="linkedin-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
</a>
</nav>
</div>
<div class="page-hero">
<h1>Data Pipeline Status</h1>
<p class="tagline">Live monitoring of ARC ecovillage data sources near Mkuranga, Tanzania</p>
</div>
<div class="page-body">
<div id="overall-badge" class="overall-badge unknown">
<span class="dot"></span>
<span id="overall-text">Loading…</span>
</div>
<div class="meta-line">
<span id="meta">Fetching status…</span>
<button class="refresh-btn" onclick="load()" style="margin-left:10px">↻ Refresh</button>
</div>
<div class="status-card">
<h2 class="section-heading">Data sources</h2>
<table>
<thead>
<tr>
<th>Source</th>
<th>Status</th>
<th>Last fetched</th>
<th>Latest data</th>
</tr>
</thead>
<tbody id="rows">
<tr><td colspan="4" style="color:#bbb;padding:20px 0">Loading…</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="site-footer">
© 2026 ARC · <a href="/privacy">Privacy</a>
</div>
<script>
const JSON_URL = "status.json";
const REFRESH_MS = 5 * 60 * 1000;
function fmtAge(h) {
if (h === null || h === undefined) return null;
if (h < 1) return Math.round(h * 60) + " min ago";
if (h < 48) return h.toFixed(1) + "h ago";
return (h / 24).toFixed(1) + "d ago";
}
function fmtCell(date, age_h) {
if (!date) return "<span style='color:#ddd'>—</span>";
const age = fmtAge(age_h);
return date + (age ? "<br><span style='color:#bbb;font-size:12px'>" + age + "</span>" : "");
}
function load() {
fetch(JSON_URL + "?t=" + Date.now())
.then(r => { if (!r.ok) throw new Error("HTTP " + r.status); return r.json(); })
.then(render)
.catch(err => { document.getElementById("meta").textContent = "Could not load status.json: " + err; });
}
function render(data) {
const overall = data.overall || "unknown";
const badge = document.getElementById("overall-badge");
badge.className = "overall-badge " + overall;
document.getElementById("overall-text").textContent =
overall === "ok" ? "All systems operational" : "⚠️ Data source issue detected";
document.getElementById("meta").innerHTML =
"Last checked: <strong style='font-weight:400;color:#555'>" + (data.checked_at || "unknown") + "</strong>";
const tbody = document.getElementById("rows");
tbody.innerHTML = "";
(data.sources || []).forEach(s => {
const tr = document.createElement("tr");
tr.innerHTML =
"<td><div class='source-name'>" + s.label + "</div>" +
(s.note ? "<div class='source-note'>" + s.note + "</div>" : "") + "</td>" +
"<td><span class='pill " + (s.status || "unknown") + "'>" + (s.status || "unknown") + "</span></td>" +
"<td>" + fmtCell(s.fetch_date, s.fetch_age_hours) + "</td>" +
"<td>" + fmtCell(s.data_date, s.data_age_hours) + "</td>";
tbody.appendChild(tr);
});
}
let nextRefresh = Date.now() + REFRESH_MS;
setInterval(() => {
if (Date.now() >= nextRefresh) { nextRefresh = Date.now() + REFRESH_MS; load(); }
}, 10000);
load();
</script>
</body>
</html>