From 6ed92d313341a1ff2b1dfc822f6a02eee0b3854a Mon Sep 17 00:00:00 2001 From: arf20 Date: Tue, 21 Oct 2025 17:46:26 +0200 Subject: wip: incidents and uptime --- README.md | 10 +++++----- index.htm.tmpl | 32 ++++++++++++++++++++++++++++---- main.c | 4 +++- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6745dbf..456aedf 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ make ## Features (TODO) - - Current service status table - - Outage events table - - Uptime counter (total, month) - - Alerts - - Centralised config + [X] Current service status table + [ ] Outage events table + [ ] Uptime counter (total, month) + [ ] Alerts + [ ] Centralised config diff --git a/index.htm.tmpl b/index.htm.tmpl index e545845..0372cc7 100644 --- a/index.htm.tmpl +++ b/index.htm.tmpl @@ -16,6 +16,15 @@ table, th, td { .down { background-color: red; } + +.row { + +} + +.col { + float: left; + width: 50%; +} @@ -27,10 +36,25 @@ table, th, td {

Status Monitor

This webapp monitors the status of the main ARFNET services from outside the ARFNET network

- - - %s -
TypeServiceStatus
+
+ Services + + + %s +
TypeServiceStatus
+
+
+ Uptime + + + +
Week %%upMonth %%upTotal %%up since %s
%s%s%s
+ Incidents + + + %s +
ResolvedStartedDuration
+
diff --git a/main.c b/main.c index 15379b3..05925fd 100644 --- a/main.c +++ b/main.c @@ -50,7 +50,9 @@ enum MHD_Result answer_to_connection( if (strcmp(method, "GET") == 0 && strcmp(url, "/") == 0) { snprintf(buff, RES_BUFF, - index_format_template, monitor_generate_status_html()); + index_format_template, + monitor_generate_status_html(), "(since)", "(week %up)", + "(month %up)", "(total %up)", "(incidents)"); response = MHD_create_response_from_buffer(strlen(buff), (void*)buff, MHD_RESPMEM_PERSISTENT); -- cgit v1.2.3