api: optimise pagination in API schema (#6478)
This commit is contained in:
@ -49,6 +49,8 @@ export class SystemTaskListPage extends TablePage<Task> {
|
||||
startIndex: 1,
|
||||
endIndex: tasks.length,
|
||||
current: page,
|
||||
next: 0,
|
||||
previous: 0,
|
||||
},
|
||||
results: tasks,
|
||||
};
|
||||
|
@ -47,6 +47,8 @@ export class DeleteObjectsTable<T> extends Table<T> {
|
||||
totalPages: 1,
|
||||
startIndex: 1,
|
||||
endIndex: this.objects.length,
|
||||
next: 0,
|
||||
previous: 0,
|
||||
},
|
||||
results: this.objects,
|
||||
});
|
||||
|
@ -7,7 +7,6 @@ import "@goauthentik/elements/chips/Chip";
|
||||
import "@goauthentik/elements/chips/ChipGroup";
|
||||
import { getURLParam, updateURLParams } from "@goauthentik/elements/router/RouteMatch";
|
||||
import "@goauthentik/elements/table/TablePagination";
|
||||
import { Pagination } from "@goauthentik/elements/table/TablePagination";
|
||||
import "@goauthentik/elements/table/TableSearch";
|
||||
|
||||
import { msg } from "@lit/localize";
|
||||
@ -24,6 +23,8 @@ import PFToolbar from "@patternfly/patternfly/components/Toolbar/toolbar.css";
|
||||
import PFBullseye from "@patternfly/patternfly/layouts/Bullseye/bullseye.css";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
|
||||
import { Pagination } from "@goauthentik/api";
|
||||
|
||||
export class TableColumn {
|
||||
title: string;
|
||||
orderBy?: string;
|
||||
|
@ -8,17 +8,7 @@ import PFButton from "@patternfly/patternfly/components/Button/button.css";
|
||||
import PFPagination from "@patternfly/patternfly/components/Pagination/pagination.css";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
|
||||
export interface Pagination {
|
||||
next?: number;
|
||||
previous?: number;
|
||||
|
||||
count: number;
|
||||
current: number;
|
||||
totalPages: number;
|
||||
|
||||
startIndex: number;
|
||||
endIndex: number;
|
||||
}
|
||||
import { Pagination } from "@goauthentik/api";
|
||||
|
||||
@customElement("ak-table-pagination")
|
||||
export class TablePagination extends AKElement {
|
||||
|
@ -28,6 +28,8 @@ export class UserDeviceList extends MFADevicesPage {
|
||||
totalPages: 1,
|
||||
startIndex: 1,
|
||||
endIndex: res.length,
|
||||
next: 0,
|
||||
previous: 0,
|
||||
},
|
||||
results: res,
|
||||
};
|
||||
|
@ -49,6 +49,8 @@ export class MFADevicesPage extends Table<Device> {
|
||||
totalPages: 1,
|
||||
startIndex: 1,
|
||||
endIndex: devices.length,
|
||||
next: 0,
|
||||
previous: 0,
|
||||
},
|
||||
results: devices,
|
||||
};
|
||||
|
Reference in New Issue
Block a user