import { findAllDeployments, findAllRunsWithCounts, } from "../server/findAllRuns"; import { DeploymentDisplay } from "./DeploymentDisplay"; import { PaginationControl } from "./PaginationControl"; import { RunDisplay } from "./RunDisplay"; import { Table, TableBody, TableCaption, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { parseAsInteger } from "next-usequerystate"; const itemPerPage = 6; const pageParser = parseAsInteger.withDefault(1); export async function RunsTable(props: { workflow_id: string; searchParams: { [key: string]: string | string[] | undefined }; }) { // await new Promise((resolve) => setTimeout(resolve, 5000)); const page = pageParser.parseServerSide( props.searchParams?.page ?? undefined ); const { allRuns, total } = await findAllRunsWithCounts({ workflow_id: props.workflow_id, limit: itemPerPage, offset: (page - 1) * itemPerPage, }); return (
{allRuns.length == 0 && ( A list of your recent runs. )} Number Machine Time Version Live Status Status {allRuns.map((run) => ( ))}
{Math.ceil(total / itemPerPage) > 0 && ( )}
); } export async function DeploymentsTable(props: { workflow_id: string }) { const allRuns = await findAllDeployments(props.workflow_id); return (
A list of your deployments Environment Version Machine Updated At {allRuns.map((run) => ( ))}
); }