diff --git a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx
index 17877007..5765df1c 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx
+++ b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/crud.tsx
@@ -31,14 +31,12 @@ export default function (certPluginGroup: PluginGroup, formWrapperRef: any): Cre
}
}
- console.log(inputs);
- debugger;
-
return {
crudOptions: {
form: {
wrapper: {
- width: "1150px"
+ width: "1150px",
+ saveRemind: false
}
},
columns: {
@@ -66,7 +64,40 @@ export default function (certPluginGroup: PluginGroup, formWrapperRef: any): Cre
}
}
},
- ...inputs
+ ...inputs,
+ triggerCron: {
+ title: "定时触发",
+ type: "text",
+ form: {
+ component: {
+ placeholder: "0 0 4 * * *"
+ },
+ helper: "请输入cron表达式, 例如:0 0 4 * * *,每天凌晨4点触发",
+ order: 100
+ }
+ },
+ emailNotify: {
+ title: "失败邮件通知",
+ type: "dict-switch",
+ dict: dict({
+ data: [
+ { value: true, label: "启用" },
+ { value: false, label: "不启用" }
+ ]
+ }),
+ form: {
+ order: 101,
+ helper: {
+ render: () => {
+ return (
+
+ 需要配置邮件服务器才能发送邮件
+
+ );
+ }
+ }
+ }
+ }
}
}
};
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx
index 522843bf..30e8665c 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx
+++ b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx
@@ -37,6 +37,21 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
function addCertdPipeline() {
certdFormRef.value.open(async ({ form }: any) => {
// 添加certd pipeline
+ const triggers = [];
+ if (form.triggerCron) {
+ triggers.push({ id: nanoid(), title: "定时触发", type: "timer", props: { cron: form.triggerCron } });
+ }
+ const notifications = [];
+ if (form.emailNotify) {
+ notifications.push({
+ id: nanoid(),
+ type: "email",
+ when: ["error", "turnToSuccess"],
+ options: {
+ receivers: [form.email]
+ }
+ });
+ }
const pipeline = {
title: form.domains[0] + "证书自动化",
stages: [
@@ -62,7 +77,9 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
}
]
}
- ]
+ ],
+ triggers,
+ notifications
}
]
};
diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue
index 50d199a3..64688b3c 100644
--- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue
+++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue
@@ -208,7 +208,6 @@ export default {
const changeCurrentPlugin = (step: any) => {
const stepType = step.type;
const pluginDefine = pluginGroups.get(stepType);
- debugger;
if (pluginDefine) {
step.type = stepType;
step._isAdd = false;