feat(api): add Grafana time range endpoint for scores

- Add /api/v2/server/scores/{server}/{mode} endpoint
- Support time range queries with from/to parameters
- Return data in Grafana table format for visualization
- Fix routing pattern to handle IP addresses correctly
- Add comprehensive parameter validation and error handling
This commit is contained in:
ask
2025-07-27 02:18:32 -07:00
parent d4bf8d9e16
commit 8262b1442f
5 changed files with 618 additions and 19 deletions
+1
View File
@@ -209,6 +209,7 @@ func (srv *Server) Run() error {
e.GET("/api/server/scores/:server/:mode", srv.history)
e.GET("/api/dns/counts", srv.dnsQueryCounts)
e.GET("/api/v2/test/grafana-table", srv.testGrafanaTable)
e.GET("/api/v2/server/scores/:server/:mode", srv.scoresTimeRange)
if len(ntpconf.WebHostname()) > 0 {
e.POST("/api/server/scores/:server/:mode", func(c echo.Context) error {