postgrest-logs.tsx38 lines · main
| 1 | import { useParams } from 'common' |
| 2 | import { parseAsString, useQueryState } from 'nuqs' |
| 3 | |
| 4 | import { LogsTableName } from '@/components/interfaces/Settings/Logs/Logs.constants' |
| 5 | import { LogsPreviewer } from '@/components/interfaces/Settings/Logs/LogsPreviewer' |
| 6 | import { LogsTableEmptyState } from '@/components/interfaces/Settings/Logs/LogsTableEmptyState' |
| 7 | import DefaultLayout from '@/components/layouts/DefaultLayout' |
| 8 | import LogsLayout from '@/components/layouts/LogsLayout/LogsLayout' |
| 9 | import type { NextPageWithLayout } from '@/types' |
| 10 | |
| 11 | export const LogPage: NextPageWithLayout = () => { |
| 12 | const { ref } = useParams() |
| 13 | const [identifier] = useQueryState('db', parseAsString) |
| 14 | |
| 15 | return ( |
| 16 | <LogsPreviewer |
| 17 | condensedLayout |
| 18 | queryType="postgrest" |
| 19 | projectRef={ref as string} |
| 20 | tableName={LogsTableName.POSTGREST} |
| 21 | EmptyState={ |
| 22 | <LogsTableEmptyState |
| 23 | title="No results found" |
| 24 | description="Only errors are captured into PostgREST logs by default. Check the API Gateway logs for HTTP requests." |
| 25 | /> |
| 26 | } |
| 27 | filterOverride={!!identifier ? { identifier } : undefined} |
| 28 | /> |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | LogPage.getLayout = (page) => ( |
| 33 | <DefaultLayout> |
| 34 | <LogsLayout title="Postgrest Logs">{page}</LogsLayout> |
| 35 | </DefaultLayout> |
| 36 | ) |
| 37 | |
| 38 | export default LogPage |