feat: implement /api/usage/clients endpoint
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Build (push) Has been cancelled

Added client-specific usage aggregation for the analytics dashboard.
This commit is contained in:
2026-03-19 12:31:11 -04:00
parent 1f3adceda4
commit 26d8431998
2 changed files with 28 additions and 2 deletions

View File

@@ -74,8 +74,7 @@ func NewServer(cfg *config.Config, database *db.DB) *Server {
}
func (s *Server) setupRoutes() {
// Global middleware should only be for logging/recovery
// Auth is specific to groups
s.router.Use(middleware.AuthMiddleware(s.database))
// Static files
s.router.StaticFile("/", "./static/index.html")
@@ -110,6 +109,7 @@ func (s *Server) setupRoutes() {
admin.GET("/usage/summary", s.handleUsageSummary)
admin.GET("/usage/time-series", s.handleTimeSeries)
admin.GET("/usage/providers", s.handleProvidersUsage)
admin.GET("/usage/clients", s.handleClientsUsage)
admin.GET("/usage/detailed", s.handleDetailedUsage)
admin.GET("/analytics/breakdown", s.handleAnalyticsBreakdown)