feat(dashboard): add admin user analytics and fix chart labels
- Add GET /api/data/users endpoint for user-grouped quota data (admin only) - Add user consumption ranking (horizontal bar, top 10) and user consumption trend (area chart) tabs visible only to admin users - Fix mislabeled "消耗趋势" tab to "调用趋势" (shows call counts, not quota) - Add processUserData helper for user ranking and trend data extraction - Add i18n keys for new tabs across all 7 locales
This commit is contained in:
@@ -293,6 +293,7 @@ func SetApiRouter(router *gin.Engine) {
|
||||
|
||||
dataRoute := apiRouter.Group("/data")
|
||||
dataRoute.GET("/", middleware.AdminAuth(), controller.GetAllQuotaDates)
|
||||
dataRoute.GET("/users", middleware.AdminAuth(), controller.GetQuotaDatesByUser)
|
||||
dataRoute.GET("/self", middleware.UserAuth(), controller.GetUserQuotaDates)
|
||||
|
||||
logRoute.Use(middleware.CORS(), middleware.CriticalRateLimit())
|
||||
|
||||
Reference in New Issue
Block a user