diff --git a/authentik/events/api/event.py b/authentik/events/api/event.py index 5cf5e7992..d0c4e396d 100644 --- a/authentik/events/api/event.py +++ b/authentik/events/api/event.py @@ -118,7 +118,7 @@ class EventViewSet(ReadOnlyModelViewSet): ) ], ) - @action(detail=False, methods=["GET"]) + @action(detail=False, methods=["GET"], pagination_class=None) def top_per_user(self, request: Request): """Get the top_n events grouped by user count""" filtered_action = request.query_params.get("action", EventAction.LOGIN) diff --git a/schema.yml b/schema.yml index 0d4e44d62..749e05217 100644 --- a/schema.yml +++ b/schema.yml @@ -2338,18 +2338,6 @@ paths: description: Which field to use when ordering the results. schema: type: string - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - name: search required: false in: query @@ -2375,7 +2363,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PaginatedEventTopPerUserList' + type: array + items: + $ref: '#/components/schemas/EventTopPerUser' description: '' /api/v2beta/events/notifications/: get: @@ -16760,41 +16750,6 @@ components: required: - pagination - results - PaginatedEventTopPerUserList: - type: object - properties: - pagination: - type: object - properties: - next: - type: number - previous: - type: number - count: - type: number - current: - type: number - total_pages: - type: number - start_index: - type: number - end_index: - type: number - required: - - next - - previous - - count - - current - - total_pages - - start_index - - end_index - results: - type: array - items: - $ref: '#/components/schemas/EventTopPerUser' - required: - - pagination - - results PaginatedExpiringBaseGrantModelList: type: object properties: diff --git a/web/src/pages/admin-overview/TopApplicationsTable.ts b/web/src/pages/admin-overview/TopApplicationsTable.ts index 9c42c8f9b..12e052ee6 100644 --- a/web/src/pages/admin-overview/TopApplicationsTable.ts +++ b/web/src/pages/admin-overview/TopApplicationsTable.ts @@ -18,7 +18,7 @@ export class TopApplicationsTable extends LitElement { } firstUpdated(): void { - new EventsApi(DEFAULT_CONFIG).eventsEventsTopPerUser({ + new EventsApi(DEFAULT_CONFIG).eventsEventsTopPerUserList({ action: "authorize_application", topN: 11, }).then((events) => { diff --git a/web/src/pages/applications/ApplicationForm.ts b/web/src/pages/applications/ApplicationForm.ts index 15dee4e2f..9070d20fd 100644 --- a/web/src/pages/applications/ApplicationForm.ts +++ b/web/src/pages/applications/ApplicationForm.ts @@ -115,7 +115,7 @@ export class ApplicationForm extends ModelForm {