fix: turn log type from text to jsonb

This commit is contained in:
bennykok
2024-01-31 00:31:00 +08:00
parent 4b37de9ec5
commit 7ae25aa162
6 changed files with 1326 additions and 4 deletions
@@ -35,6 +35,15 @@ export async function POST(request: Request) {
run_log: log_data,
})
.where(eq(workflowRunsTable.id, run_id));
return NextResponse.json(
{
message: "success",
},
{
status: 200,
},
);
}
if (status == "started" && time != undefined) {
+1 -3
View File
@@ -76,9 +76,7 @@ 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} />
)}
{run.run_log && <LogsViewer logs={run.run_log} />}
</Suspense>
</div>
{/* <div className="max-h-96 overflow-y-scroll">{view}</div> */}
+2 -1
View File
@@ -1,3 +1,4 @@
import { LogsType } from "@/components/LogsViewer";
import { CivitaiModelResponse } from "@/types/civitai";
import { type InferSelectModel, relations } from "drizzle-orm";
import {
@@ -173,7 +174,7 @@ export const workflowRunsTable = dbSchema.table("workflow_runs", {
machine_type: machinesType("machine_type"),
user_id: text("user_id"),
org_id: text("org_id"),
run_log: text("run_log"),
run_log: jsonb("run_log").$type<LogsType>(),
});
export const workflowRunRelations = relations(