Implement daily stats

This commit is contained in:
Pijus Kamandulis
2025-06-23 21:35:16 +03:00
parent 4ddd9abd2e
commit b89a1a2a7e
8 changed files with 318 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ func NewWebServer(db *clover.DB, port int) *WebServer {
"add": func(a, b int) int { return a + b },
"sub": func(a, b int) int { return a - b },
"humanDiff": helpers.HumanDiff,
"formatHashrate": helpers.FormatHashrate,
"formatCreateDate": helpers.FormatCreateDate,
})
@@ -39,6 +40,7 @@ func (ws *WebServer) Start() error {
http.HandleFunc("/", ws.IndexHandler)
http.HandleFunc("/shares", ws.SharesHandler)
http.HandleFunc("/top-shares", ws.TopSharesHandler)
http.HandleFunc("/daily-stats", ws.DailyStatsHandler)
address := ":" + fmt.Sprint(ws.port)
println("Listening on", address)