diff --git a/components/AuditPage/AuditPage.tsx b/components/AuditPage/AuditPage.tsx index 3a8e4f5..3d8c10b 100644 --- a/components/AuditPage/AuditPage.tsx +++ b/components/AuditPage/AuditPage.tsx @@ -79,7 +79,7 @@ export const AuditLogs = ({}) => { const [types, setTypes] = useState([]); const [pageIndex, setPageIndex] = useState(1); const { data } = useSWR( - `/api/admin/audit?page=${pageIndex}&${searchParams.toString()}` + `/api/admin/audit?page=${pageIndex}&pageSize=26&${searchParams.toString()}` ); const filter = useSWR('/api/admin/audit/filter'); diff --git a/components/OAuth2Page/OAuth2Page.tsx b/components/OAuth2Page/OAuth2Page.tsx index bb10144..be6a2b6 100644 --- a/components/OAuth2Page/OAuth2Page.tsx +++ b/components/OAuth2Page/OAuth2Page.tsx @@ -390,24 +390,16 @@ const OAuth2ClientCard = ({ ); -const OAuth2ClientList = ({ - pageIndex, - searchTerm, - isAdmin, - setPage, -}: { - pageIndex: number; - searchTerm: string; - isAdmin: boolean; - setPage: (page: number) => void; -}) => { +const OAuth2ClientList = ({ isAdmin }: { isAdmin: boolean }) => { + const [pageIndex, setPageIndex] = useState(1); + const [searchTerm, setSearchTerm] = useState(''); const { data, mutate } = useSWR>( `/api/admin/oauth2/clients?page=${pageIndex}${ searchTerm ? `&q=${searchTerm}` : '' - }` + }&pageSize=8` ); - return data ? ( + return ( <>

OAuth2 clients

@@ -419,41 +411,49 @@ const OAuth2ClientList = ({ Create new
-
- {data.list.map((client) => ( - + + setSearchTerm(e.target.value)} + placeholder="Search titles, descriptions, IDs.." /> - ))} - {data?.pagination && ( - - )} -
+ + +
+ {data ? ( +
+ {data.list.map((client) => ( + + ))} + {data?.pagination && ( + + )} +
+ ) : ( + Nothing found + )} - ) : ( - Nothing found ); }; export const OAuth2Page = () => { const { user } = useUser({ redirectTo: '/login' }); const isAdmin = userHasPrivileges(user, 'admin:oauth2'); - const [pageIndex, setPageIndex] = useState(1); - const [searchTerm, setSearchTerm] = useState(''); return ( <>
- + ); diff --git a/components/UsersPage/UsersPage.tsx b/components/UsersPage/UsersPage.tsx index 5a68506..a2db5fa 100644 --- a/components/UsersPage/UsersPage.tsx +++ b/components/UsersPage/UsersPage.tsx @@ -407,6 +407,16 @@ export const UsersPage = () => {

Users

+ + + setSearchTerm(e.target.value)} + placeholder="Search usernames, display names, emails, UUIDs.." + /> + + +