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

@ -7,7 +7,7 @@ import { ExpiringBaseGrantModel, Oauth2Api } 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 "../forms/DeleteBulkForm";
import { Table, TableColumn } from "../table/Table";
@ -16,12 +16,12 @@ export class UserOAuthCodeList extends Table<ExpiringBaseGrantModel> {
@property({ type: Number })
userId?: number;
apiEndpoint(page: number): Promise<AKResponse<ExpiringBaseGrantModel>> {
async apiEndpoint(page: number): Promise<AKResponse<ExpiringBaseGrantModel>> {
return new Oauth2Api(DEFAULT_CONFIG).oauth2AuthorizationCodesList({
user: this.userId,
ordering: "expires",
page: page,
pageSize: PAGE_SIZE,
pageSize: (await uiConfig()).pagination.perPage,
});
}