diff --git a/web/src/components/RunDisplay.tsx b/web/src/components/RunDisplay.tsx index b44815b..c82e1ab 100644 --- a/web/src/components/RunDisplay.tsx +++ b/web/src/components/RunDisplay.tsx @@ -1,3 +1,4 @@ +import { RunInputs } from "@/components/RunInputs"; import { LiveStatus } from "./LiveStatus"; import { RunOutputs } from "@/components/RunOutputs"; import { @@ -18,17 +19,11 @@ export async function RunDisplay({ }: { run: Awaited>[0]; }) { - // const [view, setView] = useState(); return ( { - // if (view) return; - // const _view = await callServerPromise(getRunsOutputDisplay(run.id)); - // setView(_view); - // }} > {run.version?.version} @@ -45,6 +40,7 @@ export async function RunDisplay({
+ diff --git a/web/src/components/RunInputs.tsx b/web/src/components/RunInputs.tsx new file mode 100644 index 0000000..2b75f95 --- /dev/null +++ b/web/src/components/RunInputs.tsx @@ -0,0 +1,51 @@ +import { OutputRender } from "./RunDisplay"; +import { CodeBlock } from "@/components/CodeBlock"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { findAllRuns } from "@/server/findAllRuns"; +import { getRunsOutput } from "@/server/getRunsOutput"; + +export async function RunInputs({ + run, +}: { + run: Awaited>[0]; +}) { + return ( + <> + {run.workflow_inputs && ( + + + + File + Input + + + + {Object.entries(run.workflow_inputs).map(([key, data]) => { + let imageUrl; + try { + const url = new URL(data); + if (url.pathname.endsWith('.png')) { + imageUrl = data; + } + } catch (_) { + } + return ( + + {key} + {imageUrl ? : {data}} + + ); + })} + +
+ )} + + ); +} diff --git a/web/src/components/RunOutputs.tsx b/web/src/components/RunOutputs.tsx index 7b9418a..2c78d35 100644 --- a/web/src/components/RunOutputs.tsx +++ b/web/src/components/RunOutputs.tsx @@ -12,22 +12,8 @@ import { getRunsOutput } from "@/server/getRunsOutput"; export async function RunOutputs({ run_id }: { run_id: string }) { const outputs = await getRunsOutput(run_id); - // console.log("Getting runs out put"); - - // const [outputs, setOutputs] = - // useState>>(); - - // useEffect(() => { - // if (!run_id) return; - // // fetch(`/api/run?run_id=${run_id}`) - // // .then((x) => x.json()) - // // .then((x) => setOutputs(x)); - // callServerPromise(getRunsOutput(run_id).then((x) => setOutputs(x))); - // }, [run_id]); - return ( - {/* A list of your recent runs. */} File