web: make table pagination size user-configurable

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-10-14 12:48:52 +02:00
parent 8eddb4b95b
commit f341479732
39 changed files with 122 additions and 114 deletions

View File

@ -9,7 +9,7 @@ import { CoreApi, IntentEnum, Token } from "@goauthentik/api";
import { AKResponse } from "../../../api/Client";
import { DEFAULT_CONFIG } from "../../../api/Config";
import { PAGE_SIZE } from "../../../constants";
import { uiConfig } from "../../../common/config";
import "../../../elements/buttons/Dropdown";
import "../../../elements/buttons/ModalButton";
import "../../../elements/buttons/TokenCopyButton";
@ -31,11 +31,11 @@ export class UserTokenList extends Table<Token> {
@property()
order = "expires";
apiEndpoint(page: number): Promise<AKResponse<Token>> {
async apiEndpoint(page: number): Promise<AKResponse<Token>> {
return new CoreApi(DEFAULT_CONFIG).coreTokensList({
ordering: this.order,
page: page,
pageSize: PAGE_SIZE,
pageSize: (await uiConfig()).pagination.perPage,
search: this.search || "",
managed: "",
});