accounts: pagination, server-side search

Pagination fully factored out, and both Activities and Accounts now use
a PaginatedList superclass. Server-side search is done by pressing enter
after typing a search, or by pressing the search button. Works on
accounts, soon will on activities if it doesn't already.
This commit is contained in:
Harvey Tindall
2025-05-20 18:57:16 +01:00
parent fb83094532
commit 94e076401e
13 changed files with 1577 additions and 1011 deletions

View File

@@ -168,14 +168,20 @@ type PaginatedDTO struct {
LastPage bool `json:"last_page"`
}
type PaginatedReqDTO struct {
Limit int `json:"limit"`
Page int `json:"page"` // zero-indexed
SortByField string `json:"sortByField"`
Ascending bool `json:"ascending"`
}
type getUsersReqDTO struct {
Limit int `json:"limit"`
Page int `json:"page"` // zero-indexed
ServerSearchReqDTO
}
type getUsersDTO struct {
UserList []respUser `json:"users"`
LastPage bool `json:"last_page"`
UserList []*respUser `json:"users"`
LastPage bool `json:"last_page"`
}
type ombiUser struct {
@@ -440,10 +446,9 @@ type ActivityDTO struct {
}
type GetActivitiesDTO struct {
Type []string `json:"type"` // Types of activity to get. Leave blank for all.
Limit int `json:"limit"`
Page int `json:"page"` // zero-indexed
Ascending bool `json:"ascending"`
// "SortByField" ignores, it's always time.
PaginatedReqDTO
Type []string `json:"type"` // Types of activity to get. Leave blank for all.
}
type GetActivitiesRespDTO struct {