feat(ui): new WorkflowRuns using antd

This commit is contained in:
Fu Diwei
2024-12-24 22:00:17 +08:00
parent 4e5373de73
commit 401fa3dcdd
21 changed files with 340 additions and 458 deletions

View File

@@ -1,22 +1,22 @@
import { type WorkflowRunLog } from "@/domain/workflow";
import { type WorkflowRunModel } from "@/domain/workflowRun";
import { getPocketBase } from "./pocketbase";
const COLLECTION_NAME = "workflow_run_log";
export type ListWorkflowLogsRequest = {
id: string;
export type ListWorkflowRunsRequest = {
workflowId: string;
page?: number;
perPage?: number;
};
export const list = async (request: ListWorkflowLogsRequest) => {
export const list = async (request: ListWorkflowRunsRequest) => {
const page = request.page || 1;
const perPage = request.perPage || 10;
return await getPocketBase()
.collection(COLLECTION_NAME)
.getList<WorkflowRunLog>(page, perPage, {
filter: getPocketBase().filter("workflow={:workflowId}", { workflowId: request.id }),
.getList<WorkflowRunModel>(page, perPage, {
filter: getPocketBase().filter("workflow={:workflowId}", { workflowId: request.workflowId }),
sort: "-created",
requestKey: null,
});