feat(proxies): add account count column to proxy list

Display the number of accounts bound to each proxy in the admin proxy
management page, similar to the groups list view.
This commit is contained in:
Edric Li
2026-01-08 21:20:12 +08:00
parent 70fcbd7006
commit eb198e5969
7 changed files with 74 additions and 3 deletions

View File

@@ -52,15 +52,15 @@ func (h *ProxyHandler) List(c *gin.Context) {
status := c.Query("status")
search := c.Query("search")
proxies, total, err := h.adminService.ListProxies(c.Request.Context(), page, pageSize, protocol, status, search)
proxies, total, err := h.adminService.ListProxiesWithAccountCount(c.Request.Context(), page, pageSize, protocol, status, search)
if err != nil {
response.ErrorFrom(c, err)
return
}
out := make([]dto.Proxy, 0, len(proxies))
out := make([]dto.ProxyWithAccountCount, 0, len(proxies))
for i := range proxies {
out = append(out, *dto.ProxyFromService(&proxies[i]))
out = append(out, *dto.ProxyWithAccountCountFromService(&proxies[i]))
}
response.Paginated(c, out, total, page, pageSize)
}