From 642f57ff6d7152a9e14f59c7fc0e32a6b1751fb7 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Tue, 26 Nov 2024 15:13:57 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=80=9A=E7=9F=A5=E6=94=AF=E6=8C=81voc?= =?UTF-8?q?echat=E3=80=81bark=E3=80=81telegram=E3=80=81discord=E3=80=81sla?= =?UTF-8?q?ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/pipeline/src/core/executor.ts | 8 +- .../core/pipeline/src/notification/api.ts | 4 +- .../src/components/vip-button/index.vue | 6 +- .../ui/certd-client/src/style/common.less | 6 ++ .../views/certd/pipeline/pipeline/index.vue | 12 ++- .../plugin-notification/anpush/index.ts | 2 +- .../plugins/plugin-notification/bark/index.ts | 52 +++++++++++++ .../plugin-notification/discord/index.ts | 53 ++++++++++++++ .../plugin-notification/email/index.ts | 2 +- .../src/plugins/plugin-notification/index.ts | 4 + .../plugins/plugin-notification/iyuu/index.ts | 2 +- .../plugin-notification/serverchan/index.ts | 2 +- .../plugin-notification/slack/index.ts | 32 ++++++++ .../plugin-notification/telegram/index.ts | 51 +++++++++++++ .../plugin-notification/vocechat/index.ts | 73 +++++++++++++++++++ .../plugin-notification/webhook/index.ts | 25 ++++++- 16 files changed, 315 insertions(+), 19 deletions(-) create mode 100644 packages/ui/certd-server/src/plugins/plugin-notification/bark/index.ts create mode 100644 packages/ui/certd-server/src/plugins/plugin-notification/discord/index.ts create mode 100644 packages/ui/certd-server/src/plugins/plugin-notification/slack/index.ts create mode 100644 packages/ui/certd-server/src/plugins/plugin-notification/telegram/index.ts create mode 100644 packages/ui/certd-server/src/plugins/plugin-notification/vocechat/index.ts diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts index ffa38dc6..11de4eef 100644 --- a/packages/core/pipeline/src/core/executor.ts +++ b/packages/core/pipeline/src/core/executor.ts @@ -367,16 +367,16 @@ export class Executor { const errorMessage = error?.message; if (when === "start") { subject = `【Certd】开始执行,【${this.pipeline.id}】${this.pipeline.title}`; - content = `buildId:${this.runtime.id}\n查看详情:${url}`; + content = `buildId:${this.runtime.id}`; } else if (when === "success") { subject = `【Certd】执行成功,【${this.pipeline.id}】${this.pipeline.title}`; - content = `buildId:${this.runtime.id}\n查看详情:${url}`; + content = `buildId:${this.runtime.id}`; } else if (when === "turnToSuccess") { subject = `【Certd】执行成功(失败转成功),【${this.pipeline.id}】${this.pipeline.title}`; - content = `buildId:${this.runtime.id}\n查看详情:${url}`; + content = `buildId:${this.runtime.id}`; } else if (when === "error") { subject = `【Certd】执行失败,【${this.pipeline.id}】${this.pipeline.title}`; - content = `buildId:${this.runtime.id}\n查看详情:${url}\nerror:${error.message}`; + content = `buildId:${this.runtime.id}\nerror:${error.message}`; } else { return; } diff --git a/packages/core/pipeline/src/notification/api.ts b/packages/core/pipeline/src/notification/api.ts index 7920c505..10ffbb33 100644 --- a/packages/core/pipeline/src/notification/api.ts +++ b/packages/core/pipeline/src/notification/api.ts @@ -98,14 +98,14 @@ export abstract class BaseNotification implements INotification { await this.send({ userId: 0, title: "【Certd】测试通知", - content: "测试通知\n\n查看详情:http://www.baidu.com", + content: "测试通知", pipeline: { id: 1, title: "测试流水线", } as any, pipelineId: 1, historyId: 1, - url: "http://www.baidu.com", + url: "https://certd.docmirror.cn", }); } } diff --git a/packages/ui/certd-client/src/components/vip-button/index.vue b/packages/ui/certd-client/src/components/vip-button/index.vue index aa8ef823..96809169 100644 --- a/packages/ui/certd-client/src/components/vip-button/index.vue +++ b/packages/ui/certd-client/src/components/vip-button/index.vue @@ -199,11 +199,13 @@ function openUpgrade() { const vipTypeDefine = { free: { title: "基础版", + desc: "免费使用", type: "free", privilege: ["证书申请功能无限制", "证书流水线数量10条", "常用的主机、cdn等部署插件"] }, plus: { title: "专业版", + desc: "功能增强,适用于个人企业内部使用", type: "plus", privilege: ["可加VIP群,需求优先实现", "证书流水线数量无限制", "免配置发邮件功能", "支持宝塔、易盾、群晖、1Panel、cdnfly等部署插件"], trial: { @@ -215,6 +217,7 @@ function openUpgrade() { }, comm: { title: "商业版", + desc: "商业授权,可对外运营", type: "comm", privilege: ["拥有专业版所有特权", "允许商用,可修改logo、标题", "数据统计", "插件管理", "多用户无限制", "支持用户支付(敬请期待)"] } @@ -268,6 +271,7 @@ function openUpgrade() { )} +
{item.desc}