Skip to content

feat: add dashboard API v2 pagination endpoints#5351

Merged
fatedier merged 1 commit into
devfrom
discuss/api-pagination-design
Jun 1, 2026
Merged

feat: add dashboard API v2 pagination endpoints#5351
fatedier merged 1 commit into
devfrom
discuss/api-pagination-design

Conversation

@fatedier

@fatedier fatedier commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • add Dashboard HTTP API v2 routes under /api/v2 while keeping legacy /api behavior unchanged
  • add paginated list endpoints for users, clients, and proxies, plus detail endpoints for clients/proxies
  • support query filters: user for clients/proxies and clientID for proxies

Endpoints

  • GET /api/v2/users
  • GET /api/v2/clients
  • GET /api/v2/clients/{key}
  • GET /api/v2/proxies
  • GET /api/v2/proxies/{name}

Response shape

All v2 endpoints return the standard envelope:

{ "code": 200, "msg": "success", "data": {} }

List endpoints return paginated data:

{ "total": 123, "page": 1, "pageSize": 50, "items": [] }

Compatibility

  • legacy /api/... routes are unchanged
  • v2 uses camelCase JSON names while preserving frp-style initialisms such as clientID, runID, clientIP, and wireProtocol
  • proxy status uses phase in the v2 JSON response

Validation

  • go test ./server/http ./server/registry ./pkg/util/http
  • golangci-lint run --build-tags noweb

Note: direct full go test ./... / plain golangci-lint run require generated web dist and binary artifacts (web/frpc/dist, web/frps/dist, bin/frpc, bin/frps) in this worktree, so the noweb lint path was used for final validation.

Comment thread server/http/controller_v2.go
@kilo-code-bot

kilo-code-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • pkg/util/http/handler.go
  • server/api_router.go
  • server/http/controller_v2.go
  • server/http/controller_v2_test.go
  • server/http/model/v2.go

Reviewed by gpt-5.5-2026-04-23 · 251,564 tokens

@fatedier fatedier force-pushed the discuss/api-pagination-design branch from dd89ebc to 6d509cf Compare June 1, 2026 11:50
@fatedier fatedier merged commit f5defe7 into dev Jun 1, 2026
3 checks passed
@fatedier fatedier deleted the discuss/api-pagination-design branch June 1, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant