Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion admin_ui/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default createStore({
currentTableName: undefined,
darkMode: false,
filterParams: {} as { [key: string]: any },
pageSize: 15,
pageSize: 0,
rowCount: 0,
rows: [],
schema: undefined as i.Schema | undefined,
Expand Down Expand Up @@ -154,6 +154,11 @@ export default createStore({
)
const data = response.data as i.RowCountAPIResponse
context.commit("updateRowCount", data.count)

if (!context.state.pageSize) {
context.commit("updatePageSize", data.page_size)
}

return data
},
async fetchRows(context) {
Expand Down
2 changes: 1 addition & 1 deletion piccolo_admin/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ def create_admin(
session_expiry: timedelta = timedelta(hours=1),
max_session_expiry: timedelta = timedelta(days=7),
increase_expiry: t.Optional[timedelta] = timedelta(minutes=20),
page_size: int = 15,
page_size: t.Literal[5, 15, 30, 50, 100] = 15,
read_only: bool = False,
rate_limit_provider: t.Optional[RateLimitProvider] = None,
production: bool = False,
Expand Down
1 change: 1 addition & 0 deletions piccolo_admin/example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
secret_table=AuthenticatorSecret,
),
],
page_size=30,
)


Expand Down
Loading