Go: fix missing route (#17094)

As title.

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-20 14:52:09 +08:00
committed by GitHub
parent 6b8a76c659
commit b2e88c9933
2 changed files with 7 additions and 2 deletions

View File

@@ -75,6 +75,11 @@ func RegisterEERouter(protected *gin.RouterGroup, r *Router) {
protected.POST("/license/config", r.handler.UpdateLicenseConfig)
protected.GET("/license", r.handler.ShowLicense)
// Token statistics
protected.GET("/stats/token", r.handler.GetTokenStats)
protected.GET("/stats/token/users", r.handler.GetTokenUsersStats)
protected.GET("/stats/token/summary", r.handler.GetTokenStatsSummary)
// Stats data info
protected.GET("/users/:username/activity", r.handler.ShowUserActivity)
protected.GET("/users/:username/dataset", r.handler.ShowUserDatasetSummary)

View File

@@ -1793,9 +1793,9 @@ func (c *CLI) AdminStatsUsersCommand(cmd *Command) (ResponseIf, error) {
q.Set("to", toTime)
}
url := fmt.Sprintf("/admin/stats/token/users?%s", q.Encode())
baseURL := fmt.Sprintf("/admin/stats/token/users?%s", q.Encode())
resp, err := c.AdminServerClient.Request("GET", url, "web", nil, nil)
resp, err := c.AdminServerClient.Request("GET", baseURL, "admin", nil, nil)
if err != nil {
return nil, fmt.Errorf("failed to get stats: %w", err)
}