import type { Metadata } from "next"; import { OnlineList } from "@/components/online-list"; import { PageHeader } from "@/components/status"; import { DateTime } from "@/components/time"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { api, unwrap, type AuditEntry } from "@/lib/api"; import { ConsoleNav, requireModerator } from "./console-nav"; export const metadata: Metadata = { title: "Console" }; export default async function Console() { await requireModerator("/console"); const data = unwrap(await api.console.get()); const stats = [ { label: "People", value: data.counts.people, note: "accounts" }, { label: "IMVU accounts", value: data.counts.links, note: "linked" }, { label: "Computers", value: data.counts.computers, note: "signed in" }, ]; return ( <> Moderation.
{stats.map((s) => ( {s.label} {s.value} {s.note} ))}
Online now {data.connections} {data.connections === 1 ? "connection" : "connections"} when the page loaded Audit log The latest 50 changes.
); } function AuditLog({ entries }: { entries: AuditEntry[] }) { if (entries.length === 0) return

Nothing yet.

; return ( When Who What Target Detail {entries.map((e, i) => ( {e.actor || hub} {e.action} {e.target} {Object.entries((e.detail ?? {}) as Record) .map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`) .join(", ")} ))}
); }