Make table page size a configurable setting, not a hardcoded 20
Pagination just landed hardcoded to 20 rows everywhere; add a way to change that instead of leaving it fixed for every table in the app. pageSize joins dateFormat/timeFormat on the existing display settings object (server-side default 20, 5-500 range enforced by the PUT schema) rather than becoming its own settings section, since it's the same kind of thing -- an admin-configured, globally-applied display preference read by every signed-in role via the already-public GET /api/settings/display endpoint, same as the date/time format already works. Renamed the "Date & Time" settings tab/page/route to "Display" (still just one component, now covering both date/time format and table pagination) since its scope no longer matches the old name -- kept Settings.tsx's usual pattern of one page per concern rather than adding a second, oddly-scoped tab just for one number field. New web/src/utils/pageSize.ts mirrors utils/date.ts's existing module-level "set once at startup, read anywhere without prop- drilling" pattern; usePagination()'s pageSize parameter now defaults to getPageSize() instead of a literal 20, evaluated fresh on every call so it picks up a saved change without touching any of the ten pages already using the hook. Verified server-side against a temp SQLite DB: pageSize defaults to 20, a partial update sets it without disturbing dateFormat/timeFormat and vice versa, and it persists across a fresh settings read. Also checked the default-parameter mechanics directly (re-evaluates the global value on every call rather than capturing it once, and an explicit override still wins). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7bf9b03839
commit
b40234a557
10 files changed
+180
-123
No files matched your search
@@ -98,17 +98,18 @@ All modules from the original plan are built:
|
||||
and has an "Export CSV" button next to it that exports whatever's
|
||||
currently sorted/filtered. Tables that can realistically grow large
|
||||
(DNS zones/records, IP Addresses, Secrets, Servers, Audit Log, and each
|
||||
integration's device/container/guest/repo/template list) are paginated
|
||||
20 rows at a time — CSV export still covers every sorted/filtered row,
|
||||
not just the current page.
|
||||
integration's device/container/guest/repo/template list) are paginated,
|
||||
20 rows per page by default — adjustable under Settings → Display — and
|
||||
CSV export still covers every sorted/filtered row, not just the current
|
||||
page.
|
||||
- **Settings** (admin-only) — notification channels (Gotify, ntfy, SMTP,
|
||||
generic webhook) with per-channel test buttons, per-event toggles (DNS
|
||||
record added/updated/deleted, daily secret-expiry reminder and daily
|
||||
Tailscale key-expiry reminder — both sharing one configurable
|
||||
time/timezone), badge-color customization for both DNS
|
||||
providers and integration types, and a date/time display format
|
||||
(date order, 12/24-hour clock) applied consistently to every table in
|
||||
the app.
|
||||
providers and integration types, and a **Display** tab (date order,
|
||||
12/24-hour clock, and rows-per-page for every paginated table) applied
|
||||
consistently across the app.
|
||||
|
||||
All six integrations follow the same config-in-UI + encrypted-credentials
|
||||
pattern, added (and edited — e.g. to rotate an expired API token without
|
||||
|
||||
Reference in new issue
Block a user