'use client'; import { useEffect, useState } from 'react'; import { apiFetch } from '@/lib/api'; import { StatusPill } from '@/components/status-pill'; interface Row { build: { id: string; version: number; prompt: string; status: string; errorMessage: string | null; startedAt: string | null; finishedAt: string | null; createdAt: string; }; server: { id: string; name: string; slug: string }; org: { id: string; name: string }; } const STATUS_FILTERS = ['', 'success', 'failed', 'queued', 'generating', 'building', 'deploying', 'cancelled']; export default function AdminBuildsPage() { const [rows, setRows] = useState(null); const [status, setStatus] = useState(''); useEffect(() => { apiFetch<{ builds: Row[] }>(`/v1/admin/builds${status ? `?status=${status}` : ''}`) .then((r) => setRows(r.builds)) .catch(() => setRows([])); }, [status]); return (

Builds

Every spec → image → deploy run across the fleet.

{rows === null && (

Loading…

)} {rows && rows.length === 0 && (

No builds.

)} {rows && rows.length > 0 && ( {rows.map((r) => ( ))}
When Server Org Status Prompt / Error
{new Date(r.build.createdAt).toLocaleString()}
v{r.build.version}
{r.server.name}
{r.server.slug}
{r.org.name} {r.build.errorMessage ? (
{r.build.errorMessage}
) : (
{r.build.prompt}
)}
)}
); }