diff --git a/web/src/app/app/admin/audit/page.tsx b/web/src/app/app/admin/audit/page.tsx index 88ad8e253..ab38a1ceb 100644 --- a/web/src/app/app/admin/audit/page.tsx +++ b/web/src/app/app/admin/audit/page.tsx @@ -2,6 +2,12 @@ import { useMemo, useState } from "react"; import { useQuery } from "@tanstack/react-query"; import { searchAdminAuditLogs } from "@/lib/api/client/app/admin/audit"; import type { AdminAuditLog, AdminAuditLogSearch } from "@/lib/api/models/app/admin/Audit"; +import { SelectMenu, type SelectOption } from "@/components/ui/select-menu"; + +const LIMIT_OPTIONS: SelectOption[] = [25, 50, 100].map((n) => ({ + value: String(n), + label: String(n), +})); // Free-form action / target_type strings used by handlers across the app. // These are populated dynamically from the result set too — anything new the @@ -87,6 +93,22 @@ export default function AdminAuditPage() { return Array.from(set).sort(); }, [data]); + const actionOptions = useMemo( + () => [ + { value: "", label: "(any)" }, + ...allActions.map((a) => ({ value: a, label: a })), + ], + [allActions], + ); + + const entityTypeOptions = useMemo( + () => [ + { value: "", label: "(any)" }, + ...allEntityTypes.map((t) => ({ value: t, label: t })), + ], + [allEntityTypes], + ); + return (
@@ -120,28 +142,22 @@ export default function AdminAuditPage() {
- + onChange={(v) => applyFilter({ action: v || undefined })} + options={actionOptions} + className="w-full" + aria-label="Action" + /> - + onChange={(v) => applyFilter({ target_type: v || undefined })} + options={entityTypeOptions} + className="w-full" + aria-label="Target type" + />
-
- Limit:{" "} - +
+ Limit: + applyFilter({ limit: parseInt(v, 10) })} + options={LIMIT_OPTIONS} + minWidth={80} + aria-label="Result limit" + />