feat(admin): paginate + search /api/admin/networks/{id}/members#69
Merged
Conversation
Production backbone has 218k members. Returning the full list as one
JSON payload was ~30 MB and would freeze the dashboard.
Three query params:
?limit=N cap on rows returned. Default 200, max 5000.
?offset=N skip the first N (page through).
?q=... case-insensitive substring filter against hostname OR
stringified node_id. Applied BEFORE limit/offset so
"first 200 matches for 'pilot-0001'" works as expected.
Response gains three fields so the UI can render pagination state:
total true total in the network
filtered_total rows after q (== total when q is empty)
offset echoed back
limit echoed back (after server cap)
Behaviour for non-paginated callers is unchanged: with no query params
they get the first 200 members and the count + filtered_total tell
them how much more is available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backbone has 218k members; returning the full list was a 30 MB payload that froze the dashboard. Adds limit/offset/q params with safe defaults (200, hard-cap 5000). Filters case-insensitive on hostname OR node_id. Response gains total / filtered_total so the UI can render pagination state. No regression for callers that don't use the new params — they get a fast 200-row first page.