feat: rename , executionMethod/type to trigger, crontab to triggerCron

This commit is contained in:
Fu Diwei
2025-01-04 13:29:03 +08:00
parent 2213399f5e
commit da76d1065e
11 changed files with 206 additions and 85 deletions

View File

@@ -25,7 +25,7 @@ import {
import dayjs from "dayjs";
import { ClientResponseError } from "pocketbase";
import { type WorkflowModel, isAllNodesValidated } from "@/domain/workflow";
import { WORKFLOW_TRIGGERS, type WorkflowModel, isAllNodesValidated } from "@/domain/workflow";
import { list as listWorkflow, remove as removeWorkflow, save as saveWorkflow } from "@/repository/workflow";
import { getErrMsg } from "@/utils/error";
@@ -67,16 +67,16 @@ const WorkflowList = () => {
title: t("workflow.props.trigger"),
ellipsis: true,
render: (_, record) => {
const trigger = record.type;
const trigger = record.trigger;
if (!trigger) {
return "-";
} else if (trigger === "manual") {
} else if (trigger === WORKFLOW_TRIGGERS.MANUAL) {
return <Typography.Text>{t("workflow.props.trigger.manual")}</Typography.Text>;
} else if (trigger === "auto") {
} else if (trigger === WORKFLOW_TRIGGERS.AUTO) {
return (
<Space className="max-w-full" direction="vertical" size={4}>
<Typography.Text>{t("workflow.props.trigger.auto")}</Typography.Text>
<Typography.Text type="secondary">{record.crontab ?? ""}</Typography.Text>
<Typography.Text type="secondary">{record.triggerCron ?? ""}</Typography.Text>
</Space>
);
}