From 3c43bc90e166d4c688bae213c369d406e749fc5d Mon Sep 17 00:00:00 2001 From: 1e99 Date: Fri, 4 Jul 2025 17:40:16 +0200 Subject: [PATCH] add new time ranges --- routes/api.go | 8 ++++++++ static/index.html | 2 ++ 2 files changed, 10 insertions(+) diff --git a/routes/api.go b/routes/api.go index 3178a31..b195ac2 100644 --- a/routes/api.go +++ b/routes/api.go @@ -18,6 +18,14 @@ func GetPlayerCounts(db *sql.DB, logger *log.Logger) http.HandlerFunc { var now = time.Now().Unix() / 60 var timeRange, precision int64 switch query.Get("range") { + case "1h": + timeRange = 60 + precision = 1 + + case "6h": + timeRange = 6 * 60 + precision = 1 + case "1d": timeRange = 60 * 24 precision = 5 diff --git a/static/index.html b/static/index.html index eb7fbe3..77ce74b 100644 --- a/static/index.html +++ b/static/index.html @@ -20,6 +20,8 @@

2b2t's queue