feat: add timeout and run_log

This commit is contained in:
bennykok
2024-01-30 21:42:30 +08:00
parent 2193dd287d
commit b0d1bcc303
11 changed files with 1506 additions and 78 deletions
+4 -2
View File
@@ -16,7 +16,7 @@ export function LiveStatus({
(state) =>
state.data
.filter((x) => x.id === run.id)
.sort((a, b) => b.timestamp - a.timestamp)?.[0]
.sort((a, b) => b.timestamp - a.timestamp)?.[0],
);
let status = run.status;
@@ -51,7 +51,9 @@ export function LiveStatus({
<>
<TableCell>
{data && status != "success"
? `${data.json.event} - ${data.json.data.node}`
? `${data.json.event}${
data.json.data.node ? " - " + data.json.data.node : ""
}`
: "-"}
</TableCell>
<TableCell className="truncate text-right">
+4
View File
@@ -19,6 +19,7 @@ import { getDuration, getRelativeTime } from "@/lib/getRelativeTime";
import { type findAllRuns } from "@/server/findAllRuns";
import { Suspense } from "react";
import { LiveStatus } from "./LiveStatus";
import { LogsType, LogsViewer } from "@/components/LogsViewer";
export async function RunDisplay({
run,
@@ -75,6 +76,9 @@ export async function RunDisplay({
<RunInputs run={run} />
<Suspense>
<RunOutputs run_id={run.id} />
{run.run_log && (
<LogsViewer logs={JSON.parse(run.run_log) as LogsType} />
)}
</Suspense>
</div>
{/* <div className="max-h-96 overflow-y-scroll">{view}</div> */}
+2
View File
@@ -17,6 +17,8 @@ export function StatusBadge({
);
case "success":
return <Badge variant="success">{status}</Badge>;
case "timeout":
return <Badge variant="amber">{status}</Badge>;
case "failed":
return <Badge variant="destructive">{status}</Badge>;
}