From def80333da1a52c415b0e3cf510c37ea9531257f Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Tue, 16 Dec 2025 22:34:34 +0000 Subject: [PATCH] feat: page style changes - use CSS variables for colors - attempt to fix mobile support (tooltips are still kinda broken) - use 1 decimal place for uptime percentages --- .gitattributes | 2 +- internal/database.go | 2 +- www/error.html | 16 ++ www/index.html | 309 ++++++++++++++++++++++------------- www/offline.html | 18 +- www/styles.css | 19 --- www/themes/color-dark.css | 168 ++++--------------- www/themes/color.css | 164 ++++--------------- www/themes/ctp-frappe.css | 173 ++++---------------- www/themes/ctp-latte.css | 173 ++++---------------- www/themes/ctp-macchiato.css | 173 ++++---------------- www/themes/ctp-mocha.css | 173 ++++---------------- www/themes/monochrome.css | 156 ++++-------------- 13 files changed, 449 insertions(+), 1097 deletions(-) diff --git a/.gitattributes b/.gitattributes index 3f03919..cfb68b3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -themes/*.css linguist-detectable=false \ No newline at end of file +www/themes/*.css linguist-detectable=false \ No newline at end of file diff --git a/internal/database.go b/internal/database.go index 95eae4f..88efda1 100644 --- a/internal/database.go +++ b/internal/database.go @@ -238,7 +238,7 @@ func calculateUptimePercentages(serviceIndex int) { return 0.0 } - return math.Floor(float64(online)/float64(total)*100*100) / 100 + return math.Floor(float64(online)/float64(total)*100*10) / 10 } service.MinuteUptime = calculateUptime(service.MinuteTimeline) diff --git a/www/error.html b/www/error.html index 4d2a9ef..30419b0 100644 --- a/www/error.html +++ b/www/error.html @@ -9,9 +9,25 @@ @@ -535,6 +598,8 @@
{{ if eq $.View "minutes" }}
+
+ {{ range $timelineIndex, $timelineStatus := $serviceStatus.MinuteTimeline }}
{{ else if eq $.View "hours" }}
+
+ {{ range $timelineIndex, $timelineStatus := $serviceStatus.HourTimeline }}