page.tsx19 lines · main
| 1 | import { apiJson } from '@/lib/api'; |
| 2 | import { apiOrigin } from '@/lib/env'; |
| 3 | |
| 4 | import { OverviewDashboard, type Overview } from './overview-client'; |
| 5 | |
| 6 | export const metadata = { title: 'overview · admin' }; |
| 7 | export const dynamic = 'force-dynamic'; |
| 8 | |
| 9 | /** |
| 10 | * Admin overview — thin server shell. Fetches the first payload server-side |
| 11 | * (instant paint, cookies forwarded by apiFetch) and hands off to the |
| 12 | * client dashboard, which keeps it live by re-polling /v1/admin/overview |
| 13 | * every 10s with credentials — the same api-origin pattern the mcp page's |
| 14 | * client controls use. |
| 15 | */ |
| 16 | export default async function AdminOverviewPage() { |
| 17 | const initial = await apiJson<Overview>('/v1/admin/overview').catch(() => null); |
| 18 | return <OverviewDashboard apiOrigin={apiOrigin} initial={initial} />; |
| 19 | } |