mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #4500] [MERGED] Reduce list-page payloads with slim/paged endpoints #5710
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5710
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/4500
Author: @MHSanaei
Created: 5/23/2026
Status: ✅ Merged
Merged: 5/23/2026
Merged by: @MHSanaei
Base:
main← Head:feat/perf-list-pagination📝 Commits (6)
6279c6dperf(inbounds): slim list payload + lazy hydrate for row actionsb3db26cperf(clients): server-side pagination + slim row payloadb74465eperf(settings): use /inbounds/options for LDAP tag picker4242f8cperf(clients): de-duplicate options + paged list fetches8864284perf(inbounds): share nodes list with form modal instead of refetching7babfccdocs(api): register /clients/list/paged endpoint📊 Changes
11 files changed (+700 additions, -124 deletions)
View changed files
📝
frontend/src/hooks/useClients.ts(+108 -14)📝
frontend/src/pages/api-docs/endpoints.js(+23 -0)📝
frontend/src/pages/clients/ClientsPage.tsx(+62 -87)📝
frontend/src/pages/inbounds/InboundFormModal.tsx(+3 -2)📝
frontend/src/pages/inbounds/InboundsPage.tsx(+35 -18)📝
frontend/src/pages/inbounds/useInbounds.ts(+22 -1)📝
frontend/src/pages/settings/GeneralTab.tsx(+3 -1)📝
web/controller/client.go(+16 -0)📝
web/controller/inbound.go(+13 -0)📝
web/service/client.go(+346 -0)📝
web/service/inbound.go(+69 -1)📄 Description
Summary
Removes the heaviest load-time round-trips from the panel's three list
pages (inbounds, clients, settings) by reshaping the API responses to
ship only what each page actually renders, paginating the clients list
on the server, and de-duplicating fetches that were firing twice on
every page open.
On a panel managing thousands of clients the inbounds and clients
pages used to ship megabytes of JSON on every refresh — the page would
hang while the browser parsed and re-rendered a payload that the table
only ever showed 25 rows of. After this PR the same page-loads ship
tens of KB.
What's in here
Slim list endpoints
field besides email/enable/comment from `settings.clients[]` and skips
UUID/SubId enrichment on `ClientStats`. The inbounds page only reads
those three to roll up its client counts and badges
helper just-in-time before opening edit/info/qr/export/clone — slim
list never has to carry uuids/passwords/flows
Paginated clients endpoint
paginates server-side and returns a slim row shape (no uuid /
password / auth / flow / security / reverse / tgId per client).
Page size capped at 200
DB row set (`{ total, active, online[], depleted[], expiring[], deactive[] }`)
so the clients-page stat cards stay stable as the user paginates / filters
setQuery, summary, hydrate }`. ClientsPage feeds its filter / sort /
page state into `setQuery` via a single effect, debounces the search
box by 300ms, and hydrates the full record via `/get/:email` before
opening edit / info / qr modals
Settings-page picker
`/panel/api/inbounds/options` instead of `/list` for the LDAP
inbound-tag picker. Previously that one dropdown was the reason the
settings page pulled every inbound with all its embedded clients
De-duplication
reconstructs the params object every render, but identical values are
now a no-op instead of causing the hook's effect to refire and
re-fetch `/clients/list/paged`
effect (used to ride along with the clients fetch and got hit twice
before either response landed)
an `availableNodes` prop from the page so `/panel/api/nodes/list`
fires once per visit instead of twice (the modal is always mounted,
even when closed)
Test plan
row; opening edit / info / qr / export / clipboard / clone still
shows full client data
filter / protocol / sort all round-trip to server, pagination
controls reflect server `filtered` count
of current filter / page
password, flow, ...) — confirms hydrate fires
one `/clients/list/paged` on initial load
initial load
inbounds with `tag (protocol@port)` labels; the Network tab no
longer shows `/inbounds/list` for the settings page
paged clients page
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.