feat(ui): workflow logs

This commit is contained in:
Fu Diwei
2025-03-18 20:02:39 +08:00
parent af5d7465a1
commit fd6e41c566
16 changed files with 173 additions and 63 deletions

View File

@@ -0,0 +1,7 @@
export interface WorkflowLogModel extends Omit<BaseModel, "updated"> {
nodeId: string;
nodeName: string;
level: "DEBUG" | "INFO" | "WARN" | "ERROR";
message: string;
data: Record<string, any>;
}

View File

@@ -6,27 +6,12 @@ export interface WorkflowRunModel extends BaseModel {
trigger: string;
startedAt: ISO8601String;
endedAt: ISO8601String;
logs?: WorkflowRunLog[];
error?: string;
expand?: {
workflowId?: WorkflowModel;
workflowId?: WorkflowModel; // TODO: ugly, maybe to use an alias?
};
}
export type WorkflowRunLog = {
nodeId: string;
nodeName: string;
records?: WorkflowRunLogRecord[];
error?: string;
};
export type WorkflowRunLogRecord = {
time: ISO8601String;
level: string;
content: string;
error?: string;
};
export const WORKFLOW_RUN_STATUSES = Object.freeze({
PENDING: "pending",
RUNNING: "running",