From 3ab99647aa6e66a9472b32f9453428adc86fd482 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Wed, 25 Jun 2025 20:09:29 +0200 Subject: [PATCH 1/9] First translation step --- packages/ui/certd-client/src/App.vue | 30 - .../src/components/tutorial/index.vue | 11 +- .../src/components/tutorial/simple-steps.vue | 15 +- .../src/components/vip-button/index.vue | 52 +- packages/ui/certd-client/src/i18n/index.ts | 24 - .../ui/certd-client/src/i18n/locale/en.ts | 8 - .../ui/certd-client/src/i18n/locale/zh_CN.ts | 14 - .../src/layout/components/user-info/index.vue | 6 +- packages/ui/certd-client/src/locales/i18n.ts | 135 +++ .../src/{vben => }/locales/index.ts | 0 .../src/locales/langs/en-US/authentication.ts | 80 ++ .../src/locales/langs/en-US/certd.ts | 153 +++ .../locales/langs/en-US/common.json | 0 .../src/locales/langs/en-US/index.ts | 15 + .../src/locales/langs/en-US/preferences.ts | 186 +++ .../src/locales/langs/en-US/tutorial.ts | 3 + .../src/locales/langs/en-US/ui.ts | 104 ++ .../src/locales/langs/en-US/vip.ts | 25 + .../src/locales/langs/zh-CN/authentication.ts | 81 ++ .../src/locales/langs/zh-CN/certd.ts | 159 +++ .../locales/langs/zh-CN/common.json | 0 .../src/locales/langs/zh-CN/index.ts | 15 + .../src/locales/langs/zh-CN/preferences.ts | 186 +++ .../src/locales/langs/zh-CN/tutorial.ts | 3 + .../src/locales/langs/zh-CN/ui.ts | 104 ++ .../src/locales/langs/zh-CN/vip.ts | 25 + .../src/{vben => }/locales/typing.ts | 0 packages/ui/certd-client/src/main.ts | 21 +- .../src/router/source/framework.ts | 58 +- .../src/router/source/modules/certd.ts | 509 ++++---- .../captcha/point-selection-captcha/index.vue | 2 +- .../point-selection-captcha-card.vue | 2 +- .../captcha/slider-captcha/index.vue | 2 +- .../captcha/slider-rotate-captcha/index.vue | 2 +- .../components/icon-picker/icon-picker.vue | 2 +- .../components/json-viewer/index.vue | 2 +- .../ui/authentication/code-login.vue | 2 +- .../ui/authentication/forget-password.vue | 2 +- .../common-ui/ui/authentication/login.vue | 2 +- .../common-ui/ui/authentication/register.vue | 2 +- .../ui/authentication/third-party-login.vue | 2 +- .../vben/common-ui/ui/fallback/fallback.vue | 2 +- packages/ui/certd-client/src/vben/index.ts | 2 +- .../src/vben/layouts/basic/layout.vue | 2 +- .../vben/layouts/basic/tabbar/use-tabbar.ts | 2 +- .../src/vben/layouts/widgets/breadcrumb.vue | 2 +- .../widgets/check-updates/check-updates.vue | 2 +- .../widgets/global-search/global-search.vue | 2 +- .../widgets/global-search/search-panel.vue | 2 +- .../vben/layouts/widgets/language-toggle.vue | 4 +- .../vben/layouts/widgets/layout-toggle.vue | 2 +- .../widgets/lock-screen/lock-screen-modal.vue | 2 +- .../widgets/lock-screen/lock-screen.vue | 2 +- .../widgets/notification/notification.vue | 2 +- .../preferences/blocks/general/animation.vue | 2 +- .../preferences/blocks/general/general.vue | 2 +- .../preferences/blocks/layout/breadcrumb.vue | 2 +- .../preferences/blocks/layout/content.vue | 2 +- .../preferences/blocks/layout/copyright.vue | 2 +- .../preferences/blocks/layout/footer.vue | 2 +- .../preferences/blocks/layout/header.vue | 2 +- .../preferences/blocks/layout/layout.vue | 151 ++- .../preferences/blocks/layout/navigation.vue | 2 +- .../preferences/blocks/layout/sidebar.vue | 2 +- .../preferences/blocks/layout/tabbar.vue | 2 +- .../preferences/blocks/layout/widget.vue | 2 +- .../blocks/shortcut-keys/global.vue | 2 +- .../preferences/blocks/theme/builtin.vue | 2 +- .../preferences/blocks/theme/color-mode.vue | 2 +- .../preferences/blocks/theme/theme.vue | 2 +- .../preferences/preferences-drawer.vue | 4 +- .../widgets/preferences/preferences.vue | 2 +- .../widgets/theme-toggle/theme-toggle.vue | 2 +- .../widgets/user-dropdown/user-dropdown.vue | 2 +- .../ui/certd-client/src/vben/locales/i18n.ts | 128 -- .../locales/langs/en-US/authentication.json | 56 - .../vben/locales/langs/en-US/preferences.json | 186 --- .../src/vben/locales/langs/en-US/ui.json | 104 -- .../locales/langs/zh-CN/authentication.json | 56 - .../vben/locales/langs/zh-CN/preferences.json | 186 --- .../src/vben/locales/langs/zh-CN/ui.json | 104 -- .../src/views/certd/history/crud.tsx | 404 +++---- .../src/views/certd/history/index.vue | 16 +- .../certd/mine/change-password-button.vue | 35 +- .../src/views/certd/pipeline/crud.tsx | 1052 ++++++++--------- .../src/views/certd/pipeline/index.vue | 14 +- .../src/views/certd/suite/order-modal.vue | 36 +- .../views/framework/home/dashboard/index.vue | 45 +- .../src/views/framework/home/index.vue | 14 +- .../src/views/framework/login/index.vue | 506 ++++---- 90 files changed, 2827 insertions(+), 2378 deletions(-) delete mode 100644 packages/ui/certd-client/src/i18n/index.ts delete mode 100644 packages/ui/certd-client/src/i18n/locale/en.ts delete mode 100644 packages/ui/certd-client/src/i18n/locale/zh_CN.ts create mode 100644 packages/ui/certd-client/src/locales/i18n.ts rename packages/ui/certd-client/src/{vben => }/locales/index.ts (100%) create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/authentication.ts create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/certd.ts rename packages/ui/certd-client/src/{vben => }/locales/langs/en-US/common.json (100%) create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/index.ts create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/preferences.ts create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/tutorial.ts create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/ui.ts create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/vip.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/authentication.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts rename packages/ui/certd-client/src/{vben => }/locales/langs/zh-CN/common.json (100%) create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/index.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/preferences.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/tutorial.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/ui.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/vip.ts rename packages/ui/certd-client/src/{vben => }/locales/typing.ts (100%) delete mode 100644 packages/ui/certd-client/src/vben/locales/i18n.ts delete mode 100644 packages/ui/certd-client/src/vben/locales/langs/en-US/authentication.json delete mode 100644 packages/ui/certd-client/src/vben/locales/langs/en-US/preferences.json delete mode 100644 packages/ui/certd-client/src/vben/locales/langs/en-US/ui.json delete mode 100644 packages/ui/certd-client/src/vben/locales/langs/zh-CN/authentication.json delete mode 100644 packages/ui/certd-client/src/vben/locales/langs/zh-CN/preferences.json delete mode 100644 packages/ui/certd-client/src/vben/locales/langs/zh-CN/ui.json diff --git a/packages/ui/certd-client/src/App.vue b/packages/ui/certd-client/src/App.vue index 7faa70cc..106ed968 100644 --- a/packages/ui/certd-client/src/App.vue +++ b/packages/ui/certd-client/src/App.vue @@ -8,8 +8,6 @@ diff --git a/packages/ui/certd-client/src/components/tutorial/index.vue b/packages/ui/certd-client/src/components/tutorial/index.vue index b37e87e1..d1eec41e 100644 --- a/packages/ui/certd-client/src/components/tutorial/index.vue +++ b/packages/ui/certd-client/src/components/tutorial/index.vue @@ -16,18 +16,23 @@ const slots = defineSlots(); + From cdac12bb2f5228ff3f72e8cbb735b0dfdd26118e Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Wed, 25 Jun 2025 21:01:34 +0200 Subject: [PATCH 2/9] Translate other parts --- .../components/tutorial/tutorial-steps.vue | 207 ++++--- .../src/locales/langs/en-US/certd.ts | 35 ++ .../src/locales/langs/en-US/guide.ts | 71 +++ .../src/locales/langs/en-US/index.ts | 4 +- .../src/locales/langs/zh-CN/certd.ts | 81 ++- .../src/locales/langs/zh-CN/guide.ts | 71 +++ .../src/locales/langs/zh-CN/index.ts | 4 +- .../src/router/source/framework.ts | 2 +- .../src/router/source/modules/sys.ts | 492 ++++++++-------- .../src/views/certd/monitor/cert/crud.tsx | 557 +++++++++--------- .../src/views/certd/monitor/cert/index.vue | 27 +- 11 files changed, 899 insertions(+), 652 deletions(-) create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/guide.ts create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/guide.ts diff --git a/packages/ui/certd-client/src/components/tutorial/tutorial-steps.vue b/packages/ui/certd-client/src/components/tutorial/tutorial-steps.vue index e20e0dab..bb9bc516 100644 --- a/packages/ui/certd-client/src/components/tutorial/tutorial-steps.vue +++ b/packages/ui/certd-client/src/components/tutorial/tutorial-steps.vue @@ -20,14 +20,18 @@
- 上一步 - 下一步 + {{ t('guide.buttons.prev') }} + {{ t('guide.buttons.next') }}
+ From daaef316e9f7768b7a2097e519dfc0c3e23ce0c8 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Wed, 25 Jun 2025 23:52:44 +0200 Subject: [PATCH 3/9] Other translations --- .../src/components/cron-editor/index.vue | 158 +-- .../src/locales/langs/en-US/certd.ts | 89 ++ .../src/locales/langs/en-US/common.json | 22 - .../src/locales/langs/en-US/common.ts | 22 + .../src/locales/langs/en-US/index.ts | 4 +- .../src/locales/langs/zh-CN/certd.ts | 89 ++ .../src/locales/langs/zh-CN/common.json | 22 - .../src/locales/langs/zh-CN/common.ts | 22 + .../src/locales/langs/zh-CN/index.ts | 4 +- .../certd-client/src/router/source/header.ts | 65 +- .../src/router/source/modules/about.tsx | 34 +- .../src/views/certd/monitor/site/crud.tsx | 1000 +++++++++-------- .../src/views/certd/monitor/site/index.vue | 72 +- .../src/views/certd/monitor/site/use.tsx | 71 +- .../notification-selector/index.vue | 180 ++- .../views/certd/pipeline/certd-form/use.tsx | 603 +++++----- .../pi-notification-form-email.vue | 79 +- .../pipeline/component/trigger-form/index.vue | 332 +++--- 18 files changed, 1540 insertions(+), 1328 deletions(-) delete mode 100644 packages/ui/certd-client/src/locales/langs/en-US/common.json create mode 100644 packages/ui/certd-client/src/locales/langs/en-US/common.ts delete mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/common.json create mode 100644 packages/ui/certd-client/src/locales/langs/zh-CN/common.ts diff --git a/packages/ui/certd-client/src/components/cron-editor/index.vue b/packages/ui/certd-client/src/components/cron-editor/index.vue index 3b2956a2..c411b4de 100644 --- a/packages/ui/certd-client/src/components/cron-editor/index.vue +++ b/packages/ui/certd-client/src/components/cron-editor/index.vue @@ -1,120 +1,132 @@ + diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index 2b17721d..b28cdb3c 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -185,4 +185,93 @@ export default { download: { title: "Download Certificate" }, + source: "Source Code", + github: "GitHub", + gitee: "Gitee", + cron: { + clearTip: "Clear Selection", + nextTrigger: "Next Trigger Time", + tip: "Please set a valid cron expression first" + }, + cronForm: { + title: "Scheduled Script", + helper: "Click the button above to select the time for daily execution.\nIt is recommended to run once a day. Tasks will be skipped if the certificate is not expiring.", + required: "This field is required" + }, + email: { + title: "Recipient Email", + helper: "Enter your recipient email addresses. Multiple addresses are supported.", + required: "This field is required" + }, + plugin: { + selectTitle: "Certificate Apply Plugin", + jsAcme: "JS-ACME: Easy to use, powerful features [Recommended]", + legoAcme: "Lego-ACME: Based on Lego, supports a wide range of DNS providers, suitable for users familiar with Lego" + }, + pipelineForm: { + createTitle: "Create Certificate Pipeline", + moreParams: "More Parameters", + triggerCronTitle: "Scheduled Trigger", + triggerCronHelper: + "Click the button above to choose a daily execution time.\nIt is recommended to trigger once per day. The task will be skipped if the certificate has not expired and will not be executed repeatedly.", + notificationTitle: "Failure Notification", + notificationHelper: "Get real-time alerts when the task fails", + groupIdTitle: "Pipeline Group" + }, + notificationDefault: "Use Default Notification", + monitor: { + title: "Site Certificate Monitoring", + description: "Check website certificates' expiration at 0:00 daily; reminders sent 10 days before expiration (using default notification channel);", + settingLink: "Site Monitoring Settings", + limitInfo: "Basic edition limited to 1, professional and above unlimited, current", + checkAll: "Check All", + confirmTitle: "Confirm", + confirmContent: "Confirm to trigger check for all site certificates?", + checkSubmitted: "Check task submitted", + pleaseRefresh: "Please refresh the page later to see the results", + siteName: "Site Name", + enterSiteName: "Please enter the site name", + domain: "Domain", + enterDomain: "Please enter the domain", + enterValidDomain: "Please enter a valid domain", + httpsPort: "HTTPS Port", + enterPort: "Please enter the port", + certInfo: "Certificate Info", + issuer: "Issuer", + certDomains: "Certificate Domains", + certProvider: "Issuer", + certStatus: "Certificate Status", + status: { + ok: "Valid", + expired: "Expired", + }, + certExpiresTime: "Certificate Expiration", + expired: "expired", + days: "days", + lastCheckTime: "Last Check Time", + disabled: "Enable/Disable", + ipCheck: "Enable IP Check", + selectRequired: "Please select", + ipCheckConfirm: "Are you sure to {status} IP check?", + ipCount: "IP Count", + checkStatus: "Check Status", + pipelineId: "Linked Pipeline ID", + certInfoId: "Certificate ID", + checkSubmittedRefresh: "Check task submitted. Please refresh later to view the result.", + ipManagement: "IP Management", + bulkImport: "Bulk Import", + basicLimitError: "Basic version allows only one monitoring site. Please upgrade to the Pro version.", + limitExceeded: "Sorry, you can only create up to {max} monitoring records. Please purchase or upgrade your plan.", + }, + checkStatus: { + success: "Success", + checking: "Checking", + error: "Error", + }, + domainList: { + title: "Domain List", + helper: "Format: domain:port:name, one per line. Port and name are optional.\nExamples:\nwww.baidu.com:443:Baidu\nwww.taobao.com::Taobao\nwww.google.com", + required: "Please enter domains to import", + placeholder: "www.baidu.com:443:Baidu\nwww.taobao.com::Taobao\nwww.google.com\n", + }, }; diff --git a/packages/ui/certd-client/src/locales/langs/en-US/common.json b/packages/ui/certd-client/src/locales/langs/en-US/common.json deleted file mode 100644 index 440af82b..00000000 --- a/packages/ui/certd-client/src/locales/langs/en-US/common.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "back": "Back", - "backToHome": "Back To Home", - "login": "Login", - "logout": "Logout", - "prompt": "Prompt", - "cancel": "Cancel", - "confirm": "Confirm", - "reset": "Reset", - "noData": "No Data", - "refresh": "Refresh", - "loadingMenu": "Loading Menu", - "query": "Search", - "search": "Search", - "enabled": "Enabled", - "disabled": "Disabled", - "edit": "Edit", - "delete": "Delete", - "create": "Create", - "yes": "Yes", - "no": "No" -} diff --git a/packages/ui/certd-client/src/locales/langs/en-US/common.ts b/packages/ui/certd-client/src/locales/langs/en-US/common.ts new file mode 100644 index 00000000..011f0b4a --- /dev/null +++ b/packages/ui/certd-client/src/locales/langs/en-US/common.ts @@ -0,0 +1,22 @@ +export default { + "back": "Back", + "backToHome": "Back To Home", + "login": "Login", + "logout": "Logout", + "prompt": "Prompt", + "cancel": "Cancel", + "confirm": "Confirm", + "reset": "Reset", + "noData": "No Data", + "refresh": "Refresh", + "loadingMenu": "Loading Menu", + "query": "Search", + "search": "Search", + "enabled": "Enabled", + "disabled": "Disabled", + "edit": "Edit", + "delete": "Delete", + "create": "Create", + "yes": "Yes", + "no": "No" +} diff --git a/packages/ui/certd-client/src/locales/langs/en-US/index.ts b/packages/ui/certd-client/src/locales/langs/en-US/index.ts index 61bd35d0..1630ca98 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/index.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/index.ts @@ -5,6 +5,7 @@ import tutorial from './tutorial'; import preferences from './preferences'; import ui from './ui'; import guide from './guide'; +import common from './common'; export default { certd, @@ -13,5 +14,6 @@ export default { ui, tutorial, preferences, - guide + guide, + common }; \ No newline at end of file diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 412efb93..c7a4a425 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -191,4 +191,93 @@ export default { download: { title: "下载证书" }, + source: "源码", + github: "github", + gitee: "gitee", + cron: { + clearTip: "清除选择", + nextTrigger: "下次触发时间", + tip: "请先设置正确的cron表达式" + }, + cronForm: { + title: "定时脚本", + helper: "点击上面的按钮,选择每天几点定时执行。\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行", + required: "此项必填" + }, + email: { + title: "收件邮箱", + helper: "输入你的收件邮箱地址,支持多个邮箱", + required: "此项必填" + }, + plugin: { + selectTitle: "证书申请插件", + jsAcme: "JS-ACME:使用简单方便,功能强大【推荐】", + legoAcme: "Lego-ACME:基于Lego实现,支持海量DNS提供商,熟悉LEGO的用户可以使用" + }, + pipelineForm: { + createTitle: "创建证书流水线", + moreParams: "更多参数", + triggerCronTitle: "定时触发", + triggerCronHelper: + "点击上面的按钮,选择每天几点定时执行。\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行", + notificationTitle: "失败通知", + notificationHelper: "任务执行失败实时提醒", + groupIdTitle: "流水线分组" + }, + notificationDefault: "使用默认通知", + monitor: { + title: "站点证书监控", + description: "每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道);", + settingLink: "站点监控设置", + limitInfo: "基础版限制1条,专业版以上无限制,当前", + checkAll: "检查全部", + confirmTitle: "确认", + confirmContent: "确认触发检查全部站点证书吗?", + checkSubmitted: "检查任务已提交", + pleaseRefresh: "请稍后刷新页面查看结果", + siteName: "站点名称", + enterSiteName: "请输入站点名称", + domain: "网站域名", + enterDomain: "请输入域名", + enterValidDomain: "请输入正确的域名", + httpsPort: "HTTPS端口", + enterPort: "请输入端口", + certInfo: "证书信息", + issuer: "证书颁发机构", + certDomains: "证书域名", + certProvider: "颁发机构", + certStatus: "证书状态", + status: { + ok: "正常", + expired: "过期", + }, + certExpiresTime: "证书到期时间", + expired: "过期", + days: "天", + lastCheckTime: "上次检查时间", + disabled: "禁用启用", + ipCheck: "开启IP检查", + selectRequired: "请选择", + ipCheckConfirm: "确定{status}IP检查?", + ipCount: "IP数量", + checkStatus: "检查状态", + pipelineId: "关联流水线ID", + certInfoId: "证书ID", + checkSubmittedRefresh: "检查任务已提交,请稍后刷新查看结果", + ipManagement: "IP管理", + bulkImport: "批量导入", + basicLimitError: "基础版只能添加一个监控站点,请赞助升级专业版", + limitExceeded: "对不起,您最多只能创建条{max}监控记录,请购买或升级套餐", + }, + checkStatus: { + success: "成功", + checking: "检查中", + error: "异常", + }, + domainList: { + title: "域名列表", + helper: "格式【域名:端口:名称】,一行一个,其中端口、名称可以省略\n比如:\nwww.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com", + required: "请输入要导入的域名", + placeholder: "www.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com\n", + }, }; diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/common.json b/packages/ui/certd-client/src/locales/langs/zh-CN/common.json deleted file mode 100644 index 95ec5f7d..00000000 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/common.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "back": "返回", - "backToHome": "返回首页", - "login": "登录", - "logout": "退出登录", - "prompt": "提示", - "cancel": "取消", - "confirm": "确认", - "reset": "重置", - "noData": "暂无数据", - "refresh": "刷新", - "loadingMenu": "加载菜单中", - "query": "查询", - "search": "搜索", - "enabled": "已启用", - "disabled": "已禁用", - "edit": "修改", - "delete": "删除", - "create": "新增", - "yes": "是", - "no": "否" -} diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/common.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/common.ts new file mode 100644 index 00000000..29516ad9 --- /dev/null +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/common.ts @@ -0,0 +1,22 @@ +export default { + "back": "返回", + "backToHome": "返回首页", + "login": "登录", + "logout": "退出登录", + "prompt": "提示", + "cancel": "取消", + "confirm": "确认", + "reset": "重置", + "noData": "暂无数据", + "refresh": "刷新", + "loadingMenu": "加载菜单中", + "query": "查询", + "search": "搜索", + "enabled": "已启用", + "disabled": "已禁用", + "edit": "修改", + "delete": "删除", + "create": "新增", + "yes": "是", + "no": "否" +} diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/index.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/index.ts index 61bd35d0..1630ca98 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/index.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/index.ts @@ -5,6 +5,7 @@ import tutorial from './tutorial'; import preferences from './preferences'; import ui from './ui'; import guide from './guide'; +import common from './common'; export default { certd, @@ -13,5 +14,6 @@ export default { ui, tutorial, preferences, - guide + guide, + common }; \ No newline at end of file diff --git a/packages/ui/certd-client/src/router/source/header.ts b/packages/ui/certd-client/src/router/source/header.ts index 26b96220..f7bd939e 100644 --- a/packages/ui/certd-client/src/router/source/header.ts +++ b/packages/ui/certd-client/src/router/source/header.ts @@ -1,33 +1,36 @@ +import i18n from '/@/locales/i18n'; + export const headerResource = [ - { - title: "文档", - path: "https://certd.docmirror.cn", - meta: { - icon: "ion:document-text-outline" - } - }, - { - title: "源码", - name: "source", - key: "source", - meta: { - icon: "ion:git-branch-outline" - }, - children: [ - { - title: "github", - path: "https://github.com/certd/certd", - meta: { - icon: "ion:logo-github" - } - }, - { - title: "gitee", - path: "https://gitee.com/certd/certd", - meta: { - icon: "ion:logo-octocat" - } - } - ] - } + { + title: i18n.global.t("certd.helpDoc"), + path: "https://certd.docmirror.cn", + meta: { + icon: "ion:document-text-outline" + } + }, + { + title: i18n.global.t("certd.source"), + name: "source", + key: "source", + meta: { + icon: "ion:git-branch-outline" + }, + children: [ + { + title: i18n.global.t("certd.github"), + path: "https://github.com/certd/certd", + meta: { + icon: "ion:logo-github" + } + }, + { + title: i18n.global.t("certd.gitee"), + path: "https://gitee.com/certd/certd", + meta: { + icon: "ion:logo-octocat" + } + } + ] + } ]; + diff --git a/packages/ui/certd-client/src/router/source/modules/about.tsx b/packages/ui/certd-client/src/router/source/modules/about.tsx index a2ca004e..8056b548 100644 --- a/packages/ui/certd-client/src/router/source/modules/about.tsx +++ b/packages/ui/certd-client/src/router/source/modules/about.tsx @@ -2,23 +2,25 @@ import { IFrameView } from "/@/vben/layouts"; import { useSettingStore } from "/@/store/settings"; import { computed } from "vue"; import TutorialButton from "/@/components/tutorial/index.vue"; +import i18n from '/@/locales/i18n'; + export const aboutResource = [ - { - title: "文档", - name: "document", - path: "/about/doc", - component: IFrameView, - meta: { - icon: "lucide:book-open-text", - link: "https://certd.docmirror.cn", - title: "文档", - order: 9999, - show: () => { - const settingStore = useSettingStore(); - return !settingStore.isComm; - }, - }, - }, + { + title: i18n.global.t("certd.dashboard.helpDoc"), + name: "document", + path: "/about/doc", + component: IFrameView, + meta: { + icon: "lucide:book-open-text", + link: "https://certd.docmirror.cn", + title: i18n.global.t("certd.dashboard.helpDoc"), + order: 9999, + show: () => { + const settingStore = useSettingStore(); + return !settingStore.isComm; + }, + }, + }, ]; export default aboutResource; diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/crud.tsx b/packages/ui/certd-client/src/views/certd/monitor/site/crud.tsx index 5607d9c9..27b1fab3 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/monitor/site/crud.tsx @@ -11,505 +11,513 @@ import { useSiteIpMonitor } from "./ip/use"; import { useSiteImport } from "/@/views/certd/monitor/site/use"; export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { - const { t } = useI18n(); - const api = siteInfoApi; - const { crudBinding } = crudExpose; - const pageRequest = async (query: UserPageQuery): Promise => { - return await api.GetList(query); - }; - const editRequest = async (req: EditReq) => { - const { form, row } = req; - form.id = row.id; - const res = await api.UpdateObj(form); - return res; - }; - const delRequest = async (req: DelReq) => { - const { row } = req; - return await api.DelObj(row.id); - }; + const { t } = useI18n(); + const api = siteInfoApi; + const { crudBinding } = crudExpose; + const pageRequest = async (query: UserPageQuery): Promise => { + return await api.GetList(query); + }; + const editRequest = async (req: EditReq) => { + const { form, row } = req; + form.id = row.id; + const res = await api.UpdateObj(form); + return res; + }; + const delRequest = async (req: DelReq) => { + const { row } = req; + return await api.DelObj(row.id); + }; - const addRequest = async (req: AddReq) => { - const { form } = req; - const res = await api.AddObj(form); - return res; - }; + const addRequest = async (req: AddReq) => { + const { form } = req; + const res = await api.AddObj(form); + return res; + }; - const settingsStore = useSettingStore(); + const settingsStore = useSettingStore(); - const checkStatusDict = dict({ - data: [ - { label: "成功", value: "ok", color: "green" }, - { label: "检查中", value: "checking", color: "blue" }, - { label: "异常", value: "error", color: "red" }, - ], - }); + const checkStatusDict = dict({ + data: [ + { label: t("checkStatus.success"), value: "ok", color: "green" }, + { label: t("checkStatus.checking"), value: "checking", color: "blue" }, + { label: t("checkStatus.error"), value: "error", color: "red" }, + ], + }); - const { openSiteIpMonitorDialog } = useSiteIpMonitor(); - const { openSiteImportDialog } = useSiteImport(); - return { - crudOptions: { - request: { - pageRequest, - addRequest, - editRequest, - delRequest, - }, - form: { - labelCol: { - //固定label宽度 - span: null, - style: { - width: "100px", - }, - }, - col: { - span: 22, - }, - wrapper: { - width: 600, - }, - }, - actionbar: { - buttons: { - add: { - async click() { - if (!settingsStore.isPlus) { - //非plus - if (crudBinding.value.data.length >= 1) { - notification.error({ - message: "基础版只能添加一个监控站点,请赞助升级专业版", - }); - mitter.emit("openVipModal"); - return; - } - } - //检查是否监控站点数量超出限制 - if (settingsStore.isComm && settingsStore.suiteSetting.enabled) { - //检查数量是否超限 - const suiteDetail = await mySuiteApi.SuiteDetailGet(); - const max = suiteDetail.monitorCount.max; - if (max != -1 && max <= suiteDetail.monitorCount.used) { - notification.error({ - message: `对不起,您最多只能创建条${max}监控记录,请购买或升级套餐`, - }); - return; - } - } - await crudExpose.openAdd({}); - }, - }, - //导入按钮 - import: { - show: true, - text: "批量导入", - type: "primary", - async click() { - openSiteImportDialog({ - afterSubmit() { - crudExpose.doRefresh(); - }, - }); - }, - }, - }, - }, - rowHandle: { - fixed: "right", - width: 240, - buttons: { - check: { - order: 0, - type: "link", - text: null, - tooltip: { - title: "立即检查", - }, - icon: "ion:play-sharp", - click: async ({ row }) => { - await api.DoCheck(row.id); - await crudExpose.doRefresh(); - notification.success({ - message: "检查任务已提交,请稍后刷新查看结果", - }); - }, - }, - ipCheck: { - order: 10, - type: "link", - text: null, - show: compute(({ row }) => { - return row.ipCheck === true; - }), - tooltip: { - title: "IP管理", - }, - icon: "entypo:address", - click: async ({ row }) => { - openSiteIpMonitorDialog({ siteId: row.id }); - }, - }, - }, - }, - tabs: { - name: "disabled", - show: true, - }, - columns: { - id: { - title: "ID", - key: "id", - type: "number", - search: { - show: false, - }, - column: { - width: 80, - align: "center", - }, - form: { - show: false, - }, - }, - name: { - title: "站点名称", - search: { - show: true, - }, - type: "text", - form: { - rules: [{ required: true, message: "请输入站点名称" }], - }, - column: { - width: 160, - }, - }, - domain: { - title: "网站域名", - search: { - show: true, - }, - type: "text", - form: { - rules: [ - { required: true, message: "请输入域名" }, - //@ts-ignore - { type: "domains", message: "请输入正确的域名" }, - ], - }, - column: { - width: 230, - sorter: true, - cellRender({ value, row }) { - const url = `https://${value}:${row.httpsPort}`; - return ( - - - - {value}:{row.httpsPort} - - - - ); - }, - }, - }, - httpsPort: { - title: "HTTPS端口", - search: { - show: false, - }, - type: "number", - form: { - value: 443, - rules: [{ required: true, message: "请输入端口" }], - }, - column: { - width: 100, - show: false, - }, - }, - certInfo: { - title: "证书信息", - type: "text", - form: { show: false }, - column: { - width: 200, - sorter: false, - show: true, - conditionalRender: false, - cellRender({ value, row }) { - const slots = { - content() { - return ( -
-
证书颁发机构:{row.certProvider}
-
证书域名:{row.certDomains}
-
- ); - }, - }; - return ( - - {row.certDomains} - - ); - }, - }, - }, - certDomains: { - title: "证书域名", - search: { - show: true, - }, - type: "text", - form: { - show: false, - }, - column: { - width: 200, - sorter: true, - show: false, - cellRender({ value }) { - return ( - - {value} - - ); - }, - }, - }, - certProvider: { - title: "颁发机构", - search: { - show: false, - }, - type: "text", - form: { - show: false, - }, - column: { - width: 200, - sorter: true, - show: false, - cellRender({ value }) { - return {value}; - }, - }, - }, - certStatus: { - title: "证书状态", - search: { - show: true, - }, - type: "dict-select", - dict: dict({ - data: [ - { label: "正常", value: "ok", color: "green" }, - { label: "过期", value: "expired", color: "red" }, - ], - }), - form: { - show: false, - }, - column: { - width: 100, - sorter: true, - show: true, - align: "center", - }, - }, - certExpiresTime: { - title: "证书到期时间", - search: { - show: false, - }, - type: "date", - form: { - show: false, - }, - column: { - sorter: true, - cellRender({ value }) { - if (!value) { - return "-"; - } - const expireDate = dayjs(value).format("YYYY-MM-DD"); - const leftDays = dayjs(value).diff(dayjs(), "day"); - const color = leftDays < 20 ? "red" : "#389e0d"; - const percent = (leftDays / 90) * 100; - return `${leftDays}天`} />; - }, - }, - }, - lastCheckTime: { - title: "上次检查时间", - search: { - show: false, - }, - type: "datetime", - form: { - show: false, - }, - column: { - sorter: true, - width: 155, - }, - }, - disabled: { - title: "禁用启用", - search: { - show: false, - }, - type: "dict-switch", - dict: dict({ - data: [ - { label: "启用", value: false, color: "green" }, - { label: "禁用", value: true, color: "red" }, - ], - }), - form: { - value: false, - }, - column: { - width: 100, - sorter: true, - align: "center", - component: { - name: "fs-dict-switch", - vModel: "checked", - on: { - async change({ row, $event }) { - await api.DisabledChange(row.id, $event); - await crudExpose.doRefresh(); - }, - }, - }, - }, - }, - ipCheck: { - title: "开启IP检查", - type: "dict-switch", - dict: dict({ - data: [ - { label: "启用", value: true, color: "green" }, - { label: "禁用", value: false, color: "gray" }, - ], - }), - form: { - value: false, - rules: [{ required: true, message: "请选择" }], - }, - column: { - align: "center", - width: 100, - conditionalRender: false, - component: { - name: "fs-dict-switch", - vModel: "checked", - on: { - change({ row, $event }) { - Modal.confirm({ - title: "提示", - content: `确定${$event ? "开启" : "关闭"}IP检查?`, - onOk: async () => { - await api.IpCheckChange(row.id, $event); - await crudExpose.doRefresh(); - if ($event) { - openSiteIpMonitorDialog({ siteId: row.id }); - } - }, - onCancel: async () => { - await crudExpose.doRefresh(); - }, - }); - }, - }, - }, - }, - } as ColumnCompositionProps, - ipCount: { - title: "IP数量", - search: { - show: false, - }, - type: "text", - form: { - show: false, - }, - column: { - width: 100, - sorter: true, - align: "center", - }, - }, - checkStatus: { - title: "检查状态", - search: { - show: false, - }, - type: "dict-select", - dict: checkStatusDict, - form: { - show: false, - }, - column: { - width: 100, - align: "center", - sorter: true, - cellRender({ value, row, key }) { - return ( - - - - ); - }, - }, - }, - // error: { - // title: "错误信息", - // search: { - // show: false - // }, - // type: "text", - // form: { - // show: false - // }, - // column: { - // width: 200, - // sorter: true, - // cellRender({ value }) { - // return {value}; - // } - // } - // }, - pipelineId: { - title: "关联流水线id", - search: { - show: false, - }, - form: { show: false }, - type: "number", - column: { - width: 200, - sorter: true, - show: false, - }, - }, - certInfoId: { - title: "证书id", - search: { - show: false, - }, - type: "number", - form: { show: false }, - column: { - width: 100, - sorter: true, - show: false, - }, - }, - }, - }, - }; + const { openSiteIpMonitorDialog } = useSiteIpMonitor(); + const { openSiteImportDialog } = useSiteImport(); + return { + crudOptions: { + request: { + pageRequest, + addRequest, + editRequest, + delRequest, + }, + form: { + labelCol: { + //固定label宽度 + span: null, + style: { + width: "100px", + }, + }, + col: { + span: 22, + }, + wrapper: { + width: 600, + }, + }, + actionbar: { + buttons: { + add: { + async click() { + if (!settingsStore.isPlus) { + // 非plus + if (crudBinding.value.data.length >= 1) { + notification.error({ + message: t("certd.monitor.basicLimitError"), + }); + mitter.emit("openVipModal"); + return; + } + } + + + //检查是否监控站点数量超出限制 + if (settingsStore.isComm && settingsStore.suiteSetting.enabled) { + // 检查数量是否超限 + const suiteDetail = await mySuiteApi.SuiteDetailGet(); + const max = suiteDetail.monitorCount.max; + if (max != -1 && max <= suiteDetail.monitorCount.used) { + notification.error({ + message: t("certd.monitor.limitExceeded", { max }), + }); + return; + } + } + + await crudExpose.openAdd({}); + }, + }, + //导入按钮 + import: { + show: true, + text: t("certd.monitor.bulkImport"), + type: "primary", + async click() { + openSiteImportDialog({ + afterSubmit() { + crudExpose.doRefresh(); + }, + }); + }, + }, + }, + }, + rowHandle: { + fixed: "right", + width: 240, + buttons: { + check: { + order: 0, + type: "link", + text: null, + tooltip: { + title: "立即检查", + }, + icon: "ion:play-sharp", + click: async ({ row }) => { + await api.DoCheck(row.id); + await crudExpose.doRefresh(); + notification.success({ + message: t("certd.monitor.checkSubmittedRefresh"), + }); + }, + }, + ipCheck: { + order: 10, + type: "link", + text: null, + show: compute(({ row }) => row.ipCheck === true), + tooltip: { + title: t("certd.monitor.ipManagement"), + }, + icon: "entypo:address", + click: async ({ row }) => { + openSiteIpMonitorDialog({ siteId: row.id }); + }, + }, + }, + }, + tabs: { + name: "disabled", + show: true, + }, + columns: { + id: { + title: "ID", + key: "id", + type: "number", + search: { + show: false, + }, + column: { + width: 80, + align: "center", + }, + form: { + show: false, + }, + }, + name: { + title: t("certd.monitor.siteName"), + search: { + show: true, + }, + type: "text", + form: { + rules: [{ required: true, message: t("certd.monitor.enterSiteName") }], + }, + column: { + width: 160, + }, + }, + domain: { + title: t("certd.monitor.domain"), + search: { + show: true, + }, + type: "text", + form: { + rules: [ + { required: true, message: t("certd.monitor.enterDomain") }, + // @ts-ignore + { type: "domains", message: t("certd.monitor.enterValidDomain") }, + ], + }, + column: { + width: 230, + sorter: true, + cellRender({ value, row }) { + const url = `https://${value}:${row.httpsPort}`; + return ( + + + + {value}:{row.httpsPort} + + + + ); + }, + }, + }, + httpsPort: { + title: t("certd.monitor.httpsPort"), + search: { + show: false, + }, + type: "number", + form: { + value: 443, + rules: [{ required: true, message: t("certd.monitor.enterPort") }], + }, + column: { + width: 100, + show: false, + }, + }, + certInfo: { + title: t("certd.monitor.certInfo"), + type: "text", + form: { show: false }, + column: { + width: 200, + sorter: false, + show: true, + conditionalRender: false, + cellRender({ value, row }) { + const slots = { + content() { + return ( +
+
{t("certd.monitor.issuer")}: {row.certProvider}
+
{t("certd.monitor.certDomains")}: {row.certDomains}
+
+ ); + }, + }; + return ( + + {row.certDomains} + + ); + }, + }, + }, + certDomains: { + title: t("certd.monitor.certDomains"), + search: { + show: true, + }, + type: "text", + form: { + show: false, + }, + column: { + width: 200, + sorter: true, + show: false, + cellRender({ value }) { + return ( + + {value} + + ); + }, + }, + }, + certProvider: { + title: t("certd.monitor.certProvider"), + search: { + show: false, + }, + type: "text", + form: { + show: false, + }, + column: { + width: 200, + sorter: true, + show: false, + cellRender({ value }) { + return {value}; + }, + }, + }, + certStatus: { + title: t("certd.monitor.certStatus"), + search: { + show: true, + }, + type: "dict-select", + dict: dict({ + data: [ + { label: t("certd.monitor.status.ok"), value: "ok", color: "green" }, + { label: t("certd.monitor.status.expired"), value: "expired", color: "red" }, + ], + }), + form: { + show: false, + }, + column: { + width: 100, + sorter: true, + show: true, + align: "center", + }, + }, + certExpiresTime: { + title: t("certd.monitor.certExpiresTime"), + search: { + show: false, + }, + type: "date", + form: { + show: false, + }, + column: { + sorter: true, + cellRender({ value }) { + if (!value) { + return "-"; + } + const expireDate = dayjs(value).format("YYYY-MM-DD"); + const leftDays = dayjs(value).diff(dayjs(), "day"); + const color = leftDays < 20 ? "red" : "#389e0d"; + const percent = (leftDays / 90) * 100; + return ( + `${leftDays}${t("certd.monitor.days")}`} + /> + ); + }, + }, + }, + lastCheckTime: { + title: t("certd.monitor.lastCheckTime"), + search: { + show: false, + }, + type: "datetime", + form: { + show: false, + }, + column: { + sorter: true, + width: 155, + }, + }, + disabled: { + title: t("certd.monitor.disabled"), + search: { + show: false, + }, + type: "dict-switch", + dict: dict({ + data: [ + { label: t("common.enabled"), value: false, color: "green" }, + { label: t("common.disabled"), value: true, color: "red" }, + ], + }), + form: { + value: false, + }, + column: { + width: 100, + sorter: true, + align: "center", + component: { + name: "fs-dict-switch", + vModel: "checked", + on: { + async change({ row, $event }) { + await api.DisabledChange(row.id, $event); + await crudExpose.doRefresh(); + }, + }, + }, + }, + }, + ipCheck: { + title: t("certd.monitor.ipCheck"), + type: "dict-switch", + dict: dict({ + data: [ + { label: t("common.enabled"), value: true, color: "green" }, + { label: t("common.disabled"), value: false, color: "gray" }, + ], + }), + form: { + value: false, + rules: [{ required: true, message: t("certd.monitor.selectRequired") }], + }, + column: { + align: "center", + width: 100, + conditionalRender: false, + component: { + name: "fs-dict-switch", + vModel: "checked", + on: { + change({ row, $event }) { + Modal.confirm({ + title: t("common.confirm"), + content: t("certd.monitor.ipCheckConfirm", { status: $event ? t("common.enabled") : t("common.disabled") }), + onOk: async () => { + await api.IpCheckChange(row.id, $event); + await crudExpose.doRefresh(); + if ($event) { + openSiteIpMonitorDialog({ siteId: row.id }); + } + }, + onCancel: async () => { + await crudExpose.doRefresh(); + }, + }); + }, + }, + }, + } + } as ColumnCompositionProps, + ipCount: { + title: t("certd.monitor.ipCount"), + search: { + show: false, + }, + type: "text", + form: { + show: false, + }, + column: { + width: 100, + sorter: true, + align: "center", + }, + }, + checkStatus: { + title: t("certd.monitor.checkStatus"), + search: { + show: false, + }, + type: "dict-select", + dict: checkStatusDict, + form: { + show: false, + }, + column: { + width: 100, + align: "center", + sorter: true, + cellRender({ value, row }) { + return ( + + + + ); + }, + }, + }, + // error: { + // title: "错误信息", + // search: { + // show: false + // }, + // type: "text", + // form: { + // show: false + // }, + // column: { + // width: 200, + // sorter: true, + // cellRender({ value }) { + // return {value}; + // } + // } + // }, + pipelineId: { + title: t("certd.monitor.pipelineId"), + search: { + show: false, + }, + form: { show: false }, + type: "number", + column: { + width: 200, + sorter: true, + show: false, + }, + }, + certInfoId: { + title: t("certd.monitor.certInfoId"), + search: { + show: false, + }, + type: "number", + form: { show: false }, + column: { + width: 100, + sorter: true, + show: false, + }, + }, + }, + }, + }; } diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/index.vue b/packages/ui/certd-client/src/views/certd/monitor/site/index.vue index b3521df3..1da7404d 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/site/index.vue @@ -1,53 +1,61 @@ + diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/use.tsx b/packages/ui/certd-client/src/views/certd/monitor/site/use.tsx index a4b913b7..32b0efc3 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/use.tsx +++ b/packages/ui/certd-client/src/views/certd/monitor/site/use.tsx @@ -1,41 +1,44 @@ import { useFormWrapper } from "@fast-crud/fast-crud"; import { siteInfoApi } from "./api"; +import { useI18n } from "vue-i18n"; export function useSiteImport() { - const { openCrudFormDialog } = useFormWrapper(); + const { t } = useI18n(); + const { openCrudFormDialog } = useFormWrapper(); - async function openSiteImportDialog(opts: { afterSubmit: any }) { - const { afterSubmit } = opts; - await openCrudFormDialog({ - crudOptions: { - columns: { - text: { - type: "textarea", - title: "域名列表", - form: { - helper: "格式【域名:端口:名称】,一行一个,其中端口、名称可以省略\n比如:\nwww.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com", - rules: [{ required: true, message: "请输入要导入的域名" }], - component: { - placeholder: "www.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com\n", - rows: 8, - }, - col: { - span: 24, - }, - }, - }, - }, - form: { - async doSubmit({ form }) { - return siteInfoApi.Import(form); - }, - afterSubmit, - }, - }, - }); - } + async function openSiteImportDialog(opts: { afterSubmit: any }) { + const { afterSubmit } = opts; + await openCrudFormDialog({ + crudOptions: { + columns: { + text: { + type: "textarea", + title: t("certd.domainList.title"), // 域名列表 + form: { + helper: t("certd.domainList.helper"), + rules: [{ required: true, message: t("certd.domainList.required") }], + component: { + placeholder: t("certd.domainList.placeholder"), + rows: 8, + }, + col: { + span: 24, + }, + }, + }, + }, - return { - openSiteImportDialog, - }; + form: { + async doSubmit({ form }) { + return siteInfoApi.Import(form); + }, + afterSubmit, + }, + }, + }); + } + + return { + openSiteImportDialog, + }; } diff --git a/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue b/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue index 1ac58c86..cc10c45b 100644 --- a/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue +++ b/packages/ui/certd-client/src/views/certd/notification/notification-selector/index.vue @@ -1,36 +1,26 @@ diff --git a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx index 508175d6..341e1b5a 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/certd-form/use.tsx @@ -11,323 +11,328 @@ import * as api from "../api"; import { PluginGroup, usePluginStore } from "/@/store/plugin"; import { createNotificationApi } from "/@/views/certd/notification/api"; import GroupSelector from "../group/group-selector.vue"; +import { useI18n } from "vue-i18n"; + export function setRunnableIds(pipeline: any) { - const idMap: any = {}; - function createId(oldId: any) { - if (oldId == null) { - return nanoid(); - } - const newId = nanoid(); - idMap[oldId] = newId; - return newId; - } - if (pipeline.stages) { - for (const stage of pipeline.stages) { - stage.id = createId(stage.id); - if (stage.tasks) { - for (const task of stage.tasks) { - task.id = createId(task.id); - if (task.steps) { - for (const step of task.steps) { - step.id = createId(step.id); - } - } - } - } - } - } + const { t } = useI18n(); + const idMap: any = {}; + function createId(oldId: any) { + if (oldId == null) { + return nanoid(); + } + const newId = nanoid(); + idMap[oldId] = newId; + return newId; + } + if (pipeline.stages) { + for (const stage of pipeline.stages) { + stage.id = createId(stage.id); + if (stage.tasks) { + for (const task of stage.tasks) { + task.id = createId(task.id); + if (task.steps) { + for (const step of task.steps) { + step.id = createId(step.id); + } + } + } + } + } + } - for (const trigger of pipeline.triggers) { - trigger.id = nanoid(); - } - for (const notification of pipeline.notifications) { - notification.id = nanoid(); - } + for (const trigger of pipeline.triggers) { + trigger.id = nanoid(); + } + for (const notification of pipeline.notifications) { + notification.id = nanoid(); + } - let content = JSON.stringify(pipeline); - for (const key in idMap) { - content = content.replaceAll(key, idMap[key]); - } - return JSON.parse(content); + let content = JSON.stringify(pipeline); + for (const key in idMap) { + content = content.replaceAll(key, idMap[key]); + } + return JSON.parse(content); } export function useCertPipelineCreator() { - const { openCrudFormDialog } = useFormWrapper(); + const { t } = useI18n(); + const { openCrudFormDialog } = useFormWrapper(); - const pluginStore = usePluginStore(); - const router = useRouter(); + const pluginStore = usePluginStore(); + const router = useRouter(); - function createCrudOptions(certPlugins: any[], getFormData: any, doSubmit: any): CreateCrudOptionsRet { - const inputs: any = {}; - const moreParams = []; - for (const plugin of certPlugins) { - for (const inputKey in plugin.input) { - if (inputs[inputKey]) { - //如果两个插件有的字段,直接显示 - inputs[inputKey].form.show = true; - continue; - } - const inputDefine = cloneDeep(plugin.input[inputKey]); - if (!inputDefine.required && !inputDefine.maybeNeed) { - moreParams.push(inputKey); - // continue; - } - useReference(inputDefine); - inputs[inputKey] = { - title: inputDefine.title, - form: { - ...inputDefine, - show: compute(ctx => { - const form = getFormData(); - if (!form) { - return false; - } + function createCrudOptions(certPlugins: any[], getFormData: any, doSubmit: any): CreateCrudOptionsRet { + const inputs: any = {}; + const moreParams = []; + for (const plugin of certPlugins) { + for (const inputKey in plugin.input) { + if (inputs[inputKey]) { + //如果两个插件有的字段,直接显示 + inputs[inputKey].form.show = true; + continue; + } + const inputDefine = cloneDeep(plugin.input[inputKey]); + if (!inputDefine.required && !inputDefine.maybeNeed) { + moreParams.push(inputKey); + // continue; + } + useReference(inputDefine); + inputs[inputKey] = { + title: inputDefine.title, + form: { + ...inputDefine, + show: compute(ctx => { + const form = getFormData(); + if (!form) { + return false; + } - let inputDefineShow = true; - if (inputDefine.show != null) { - const computeShow = inputDefine.show as any; - if (computeShow === false) { - inputDefineShow = false; - } else if (computeShow && computeShow.computeFn) { - inputDefineShow = computeShow.computeFn({ form }); - } - } - return form?.certApplyPlugin === plugin.name && inputDefineShow; - }), - }, - }; - } - } + let inputDefineShow = true; + if (inputDefine.show != null) { + const computeShow = inputDefine.show as any; + if (computeShow === false) { + inputDefineShow = false; + } else if (computeShow && computeShow.computeFn) { + inputDefineShow = computeShow.computeFn({ form }); + } + } + return form?.certApplyPlugin === plugin.name && inputDefineShow; + }), + }, + }; + } + } - const pluginStore = usePluginStore(); - const randomHour = Math.floor(Math.random() * 6); - const randomMin = Math.floor(Math.random() * 60); + const pluginStore = usePluginStore(); + const randomHour = Math.floor(Math.random() * 6); + const randomMin = Math.floor(Math.random() * 60); - const groupDictRef = dict({ - url: "/pi/pipeline/group/all", - value: "id", - label: "name", - }); + const groupDictRef = dict({ + url: "/pi/pipeline/group/all", + value: "id", + label: "name", + }); - return { - crudOptions: { - form: { - doSubmit, - wrapper: { - width: 1350, - saveRemind: false, - title: "创建证书流水线", - }, - group: { - groups: { - more: { - header: "更多参数", - columns: moreParams, - collapsed: true, - }, - }, - }, - }, - columns: { - certApplyPlugin: { - title: "证书申请插件", - type: "dict-select", - dict: dict({ - data: [ - { value: "CertApply", label: "JS-ACME" }, - { value: "CertApplyLego", label: "Lego-ACME" }, - ], - }), - form: { - order: 0, - value: "CertApply", - helper: { - render: () => { - return ( -
    -
  • JS-ACME:使用简单方便,功能强大【推荐】
  • -
  • Lego-ACME:基于Lego实现,支持海量DNS提供商,熟悉LEGO的用户可以使用
  • -
- ); - }, - }, - valueChange: { - handle: async ({ form, value }) => { - const config = await pluginStore.getPluginConfig({ - name: value, - type: "builtIn", - }); - if (config.sysSetting?.input) { - merge(form, config.sysSetting.input); - } - }, - immediate: true, - }, - }, - }, - ...inputs, - triggerCron: { - title: "定时触发", - type: "text", - form: { - value: `0 ${randomMin} ${randomHour} * * *`, - component: { - name: "cron-editor", - vModel: "modelValue", - placeholder: "0 0 4 * * *", - }, - helper: "点击上面的按钮,选择每天几点定时执行。\n建议设置为每天触发一次,证书未到期之前任务会跳过,不会重复执行", - order: 100, - }, - }, - notification: { - title: "失败通知", - type: "text", - form: { - value: 0, - component: { - name: NotificationSelector, - vModel: "modelValue", - on: { - selectedChange({ $event, form }) { - form.notificationTarget = $event; - }, - }, - }, - order: 101, - helper: "任务执行失败实时提醒", - }, - }, - groupId: { - title: "流水线分组", - type: "dict-select", - dict: groupDictRef, - form: { - component: { - name: GroupSelector, - vModel: "modelValue", - }, - order: 9999, - }, - }, - }, - }, - }; - } + return { + crudOptions: { + form: { + doSubmit, + wrapper: { + width: 1350, + saveRemind: false, + title: t("certd.pipelineForm.createTitle"), + }, + group: { + groups: { + more: { + header: t("certd.pipelineForm.moreParams"), + columns: moreParams, + collapsed: true, + }, + }, + }, + }, + columns: { + certApplyPlugin: { + title: t("certd.plugin.selectTitle"), + type: "dict-select", + dict: dict({ + data: [ + { value: "CertApply", label: "JS-ACME" }, + { value: "CertApplyLego", label: "Lego-ACME" }, + ], + }), + form: { + order: 0, + value: "CertApply", + helper: { + render: () => { + return ( +
    +
  • {t("certd.plugin.jsAcme")}
  • +
  • {t("certd.plugin.legoAcme")}
  • +
+ ); + }, + }, + valueChange: { + handle: async ({ form, value }) => { + const config = await pluginStore.getPluginConfig({ + name: value, + type: "builtIn", + }); + if (config.sysSetting?.input) { + merge(form, config.sysSetting.input); + } + }, + immediate: true, + }, + }, + }, + ...inputs, + triggerCron: { + title: t("certd.pipelineForm.triggerCronTitle"), + type: "text", + form: { + value: `0 ${randomMin} ${randomHour} * * *`, + component: { + name: "cron-editor", + vModel: "modelValue", + placeholder: "0 0 4 * * *", + }, + helper: t("certd.pipelineForm.triggerCronHelper"), + order: 100, + }, + }, + notification: { + title: t("certd.pipelineForm.notificationTitle"), + type: "text", + form: { + value: 0, + component: { + name: NotificationSelector, + vModel: "modelValue", + on: { + selectedChange({ $event, form }) { + form.notificationTarget = $event; + }, + }, + }, + order: 101, + helper: t("certd.pipelineForm.notificationHelper"), + }, + }, + groupId: { + title: t("certd.pipelineForm.groupIdTitle"), + type: "dict-select", + dict: groupDictRef, + form: { + component: { + name: GroupSelector, + vModel: "modelValue", + }, + order: 9999, + }, + } - async function getCertPlugins() { - const pluginGroup = await pluginStore.getGroups(); - const pluginGroups: { [key: string]: PluginGroup } = pluginGroup.groups; - const certPluginGroup = pluginGroups.cert; + }, + }, + }; + } - const certPlugins = []; - for (const plugin of certPluginGroup.plugins) { - const detail: any = await pluginStore.getPluginDefine(plugin.name); - certPlugins.push(detail); - } - return certPlugins; - } + async function getCertPlugins() { + const pluginGroup = await pluginStore.getGroups(); + const pluginGroups: { [key: string]: PluginGroup } = pluginGroup.groups; + const certPluginGroup = pluginGroups.cert; - async function openAddCertdPipelineDialog(req: { defaultGroupId?: number }) { - //检查是否流水线数量超出限制 - await checkPipelineLimit(); + const certPlugins = []; + for (const plugin of certPluginGroup.plugins) { + const detail: any = await pluginStore.getPluginDefine(plugin.name); + certPlugins.push(detail); + } + return certPlugins; + } - const wrapperRef = ref(); - function getFormData() { - if (!wrapperRef.value) { - return null; - } - return wrapperRef.value.getFormData(); - } + async function openAddCertdPipelineDialog(req: { defaultGroupId?: number }) { + //检查是否流水线数量超出限制 + await checkPipelineLimit(); - async function doSubmit({ form }: any) { - // const certDetail = readCertDetail(form.cert.crt); - // 添加certd pipeline - const triggers = []; - if (form.triggerCron) { - triggers.push({ title: "定时触发", type: "timer", props: { cron: form.triggerCron } }); - } - const notifications = []; - if (form.notification != null) { - notifications.push({ - type: "custom", - when: ["error", "turnToSuccess", "success"], - notificationId: form.notification, - title: form.notificationTarget?.name || "自定义通知", - }); - } - const pluginInput = omit(form, ["triggerCron", "notification", "notificationTarget", "certApplyPlugin", "groupId"]); - let pipeline = { - title: form.domains[0] + "证书自动化", - runnableType: "pipeline", - stages: [ - { - title: "证书申请阶段", - maxTaskCount: 1, - runnableType: "stage", - tasks: [ - { - title: "证书申请任务", - runnableType: "task", - steps: [ - { - title: "申请证书", - runnableType: "step", - input: { - renewDays: 35, - ...pluginInput, - }, - strategy: { - runStrategy: 0, // 正常执行 - }, - type: form.certApplyPlugin, - }, - ], - }, - ], - }, - ], - triggers, - notifications, - }; - pipeline = setRunnableIds(pipeline); + const wrapperRef = ref(); + function getFormData() { + if (!wrapperRef.value) { + return null; + } + return wrapperRef.value.getFormData(); + } - /** - * // cert: 证书; backup: 备份; custom:自定义; - * type: string; - * // custom: 自定义; monitor: 监控; - * from: string; - */ - const groupId = form.groupId; - const id = await api.Save({ - title: pipeline.title, - content: JSON.stringify(pipeline), - keepHistoryCount: 30, - type: "cert", - groupId, - }); - if (form.email) { - try { - //创建一个默认的邮件通知 - const notificationApi = createNotificationApi(); - await notificationApi.GetOrCreateDefault({ email: form.email }); - } catch (e) { - console.error(e); - } - } - message.success("创建成功,请添加证书部署任务"); - router.push({ path: "/certd/pipeline/detail", query: { id, editMode: "true" } }); - } - const certPlugins = await getCertPlugins(); - const { crudOptions } = createCrudOptions(certPlugins, getFormData, doSubmit); - //@ts-ignore - crudOptions.columns.groupId.form.value = req.defaultGroupId || undefined; - const wrapper = await openCrudFormDialog({ crudOptions }); - wrapperRef.value = wrapper; - } + async function doSubmit({ form }: any) { + // const certDetail = readCertDetail(form.cert.crt); + // 添加certd pipeline + const triggers = []; + if (form.triggerCron) { + triggers.push({ title: "定时触发", type: "timer", props: { cron: form.triggerCron } }); + } + const notifications = []; + if (form.notification != null) { + notifications.push({ + type: "custom", + when: ["error", "turnToSuccess", "success"], + notificationId: form.notification, + title: form.notificationTarget?.name || "自定义通知", + }); + } + const pluginInput = omit(form, ["triggerCron", "notification", "notificationTarget", "certApplyPlugin", "groupId"]); + let pipeline = { + title: form.domains[0] + "证书自动化", + runnableType: "pipeline", + stages: [ + { + title: "证书申请阶段", + maxTaskCount: 1, + runnableType: "stage", + tasks: [ + { + title: "证书申请任务", + runnableType: "task", + steps: [ + { + title: "申请证书", + runnableType: "step", + input: { + renewDays: 35, + ...pluginInput, + }, + strategy: { + runStrategy: 0, // 正常执行 + }, + type: form.certApplyPlugin, + }, + ], + }, + ], + }, + ], + triggers, + notifications, + }; + pipeline = setRunnableIds(pipeline); - return { - openAddCertdPipelineDialog, - }; + /** + * // cert: 证书; backup: 备份; custom:自定义; + * type: string; + * // custom: 自定义; monitor: 监控; + * from: string; + */ + const groupId = form.groupId; + const id = await api.Save({ + title: pipeline.title, + content: JSON.stringify(pipeline), + keepHistoryCount: 30, + type: "cert", + groupId, + }); + if (form.email) { + try { + //创建一个默认的邮件通知 + const notificationApi = createNotificationApi(); + await notificationApi.GetOrCreateDefault({ email: form.email }); + } catch (e) { + console.error(e); + } + } + message.success("创建成功,请添加证书部署任务"); + router.push({ path: "/certd/pipeline/detail", query: { id, editMode: "true" } }); + } + const certPlugins = await getCertPlugins(); + const { crudOptions } = createCrudOptions(certPlugins, getFormData, doSubmit); + //@ts-ignore + crudOptions.columns.groupId.form.value = req.defaultGroupId || undefined; + const wrapper = await openCrudFormDialog({ crudOptions }); + wrapperRef.value = wrapper; + } + + return { + openAddCertdPipelineDialog, + }; } diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue index 63320a85..ae0fd926 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/notification-form/pi-notification-form-email.vue @@ -1,36 +1,37 @@ diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue index ed97f8e0..cbd52b98 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue @@ -1,70 +1,65 @@ From 34ec6210c628a905fba0c760aee726018e03cddd Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Thu, 26 Jun 2025 00:08:13 +0200 Subject: [PATCH 4/9] Translate VIP popup --- .../src/components/vip-button/index.vue | 516 ++++++++++-------- .../src/locales/langs/en-US/vip.ts | 61 +++ .../src/locales/langs/zh-CN/vip.ts | 63 ++- 3 files changed, 401 insertions(+), 239 deletions(-) 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 6c32a903..682d69e8 100644 --- a/packages/ui/certd-client/src/components/vip-button/index.vue +++ b/packages/ui/certd-client/src/components/vip-button/index.vue @@ -1,19 +1,15 @@ diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index b28cdb3c..09c62e3f 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -274,4 +274,19 @@ export default { required: "Please enter domains to import", placeholder: "www.baidu.com:443:Baidu\nwww.taobao.com::Taobao\nwww.google.com\n", }, + accountInfo: "Account Information", + securitySettings: "Security & Settings", + confirmDisable2FA: "Are you sure you want to disable two-factor authentication login?", + disabledSuccess: "Disabled successfully", + saveSuccess: "Saved successfully", + twoFactorAuth: "2FA Two-Factor Authentication Login", + rebind: "Rebind", + twoFactorAuthHelper: "Enable or disable two-factor authentication login", + bindDevice: "Bind Device", + step1: "1. Install any authenticator app, for example:", + tooltipGoogleServiceError: "If you get a Google service not found error, you can install KK Google Assistant", + step2: "2. Scan the QR code to add the account", + step3: "3. Enter the verification code", + inputVerifyCode: "Please enter the verification code", + cancel: "Cancel", }; diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index c7a4a425..98d61d31 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -280,4 +280,19 @@ export default { required: "请输入要导入的域名", placeholder: "www.baidu.com:443:百度\nwww.taobao.com::淘宝\nwww.google.com\n", }, + accountInfo: "账号信息", + securitySettings: "认证安全设置", + confirmDisable2FA: "确定要关闭多重验证登录吗?", + disabledSuccess: "关闭成功", + saveSuccess: "保存成功", + twoFactorAuth: "2FA多重验证登录", + rebind: "重新绑定", + twoFactorAuthHelper: "是否开启多重验证登录", + bindDevice: "绑定设备", + step1: "1. 安装任意一款支持Authenticator的验证APP,比如:", + tooltipGoogleServiceError: "如果报没有找到谷歌服务的错误,您可以安装KK谷歌助手", + step2: "2. 扫描二维码添加账号", + step3: "3. 输入验证码", + inputVerifyCode: "请输入验证码", + cancel: "取消", }; diff --git a/packages/ui/certd-client/src/views/certd/mine/security/index.vue b/packages/ui/certd-client/src/views/certd/mine/security/index.vue index 0a4ccf6a..0e0ff348 100644 --- a/packages/ui/certd-client/src/views/certd/mine/security/index.vue +++ b/packages/ui/certd-client/src/views/certd/mine/security/index.vue @@ -1,73 +1,82 @@ From b50121ad0bd4a6f30111ef90c6e262f8159f0479 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Thu, 26 Jun 2025 00:36:22 +0200 Subject: [PATCH 6/9] Translate user account info page --- .../src/locales/langs/en-US/authentication.ts | 4 + .../src/locales/langs/en-US/certd.ts | 11 + .../src/locales/langs/zh-CN/authentication.ts | 4 + .../src/locales/langs/zh-CN/certd.ts | 11 + .../access/access-selector/access/crud.tsx | 264 +++++++++--------- .../src/views/certd/access/index.vue | 54 ++-- .../certd/mine/change-password-button.vue | 156 +++++------ .../src/views/certd/mine/user-profile.vue | 57 ++-- 8 files changed, 303 insertions(+), 258 deletions(-) diff --git a/packages/ui/certd-client/src/locales/langs/en-US/authentication.ts b/packages/ui/certd-client/src/locales/langs/en-US/authentication.ts index a20035f3..0469d159 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/authentication.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/authentication.ts @@ -77,4 +77,8 @@ export default { newPasswordNotSameOld: "The new password cannot be the same as the old password", enterPasswordAgain: "Please enter the password again", passwordsNotMatch: "The two passwords do not match!", + avatar: "Avatar", + nickName: "Nickname", + phoneNumber: "Phone Number", + changePassword: "Change Password", } \ No newline at end of file diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index 09c62e3f..258f3097 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -289,4 +289,15 @@ export default { step3: "3. Enter the verification code", inputVerifyCode: "Please enter the verification code", cancel: "Cancel", + authorizationManagement: "Authorization Management", + manageThirdPartyAuth: "Manage third-party system authorization information", + name: "Name", + pleaseEnterName: "Please enter the name", + nameHelper: "Fill in as you like, useful to distinguish when multiple authorizations of the same type exist", + level: "Level", + system: "System", + usera: "User", + nickName: "Nickname", + max50Chars: "Maximum 50 characters", + myInfo: "My Information", }; diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/authentication.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/authentication.ts index 4c34c2df..384c1265 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/authentication.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/authentication.ts @@ -78,4 +78,8 @@ export default { newPasswordNotSameOld: "新密码不能和旧密码相同", enterPasswordAgain: "请再次输入密码", passwordsNotMatch: "两次输入密码不一致!", + avatar: "头像", + nickName: "昵称", + phoneNumber: "手机号", + changePassword: "修改密码", } diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 98d61d31..1983dadd 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -295,4 +295,15 @@ export default { step3: "3. 输入验证码", inputVerifyCode: "请输入验证码", cancel: "取消", + authorizationManagement: "授权管理", + manageThirdPartyAuth: "管理第三方系统授权信息", + name: "名称", + pleaseEnterName: "请填写名称", + nameHelper: "随便填,当多个相同类型的授权时,便于区分", + level: "级别", + system: "系统", + usera: "用户", + nickName: "昵称", + max50Chars: "最大50个字符", + myInfo: "我的信息", }; diff --git a/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx b/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx index 23bbb1f8..dfb06237 100644 --- a/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx @@ -2,141 +2,143 @@ import { ref } from "vue"; import { getCommonColumnDefine } from "/@/views/certd/access/common"; import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud"; +import { useI18n } from "vue-i18n"; export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { - const { crudBinding } = crudExpose; - const { props, ctx, api } = context; - const lastResRef = ref(); - const pageRequest = async (query: UserPageQuery): Promise => { - return await context.api.GetList(query); - }; - const editRequest = async (req: EditReq) => { - const { form, row } = req; - form.id = row.id; - form.type = props.type; - const res = await context.api.UpdateObj(form); - lastResRef.value = res; - return res; - }; - const delRequest = async (req: DelReq) => { - const { row } = req; - return await context.api.DelObj(row.id); - }; + const { t } = useI18n(); + const { crudBinding } = crudExpose; + const { props, ctx, api } = context; + const lastResRef = ref(); + const pageRequest = async (query: UserPageQuery): Promise => { + return await context.api.GetList(query); + }; + const editRequest = async (req: EditReq) => { + const { form, row } = req; + form.id = row.id; + form.type = props.type; + const res = await context.api.UpdateObj(form); + lastResRef.value = res; + return res; + }; + const delRequest = async (req: DelReq) => { + const { row } = req; + return await context.api.DelObj(row.id); + }; - const addRequest = async (req: AddReq) => { - const { form } = req; - form.type = props.type; - const res = await context.api.AddObj(form); - lastResRef.value = res; - return res; - }; + const addRequest = async (req: AddReq) => { + const { form } = req; + form.type = props.type; + const res = await context.api.AddObj(form); + lastResRef.value = res; + return res; + }; - const selectedRowKey = ref([props.modelValue]); + const selectedRowKey = ref([props.modelValue]); - const onSelectChange = (changed: any) => { - selectedRowKey.value = changed; - ctx.emit("update:modelValue", changed[0]); - }; + const onSelectChange = (changed: any) => { + selectedRowKey.value = changed; + ctx.emit("update:modelValue", changed[0]); + }; - const typeRef = ref("aliyun"); - context.typeRef = typeRef; - const commonColumnsDefine = getCommonColumnDefine(crudExpose, typeRef, api); - commonColumnsDefine.type.form.component.disabled = true; - return { - typeRef, - crudOptions: { - request: { - pageRequest, - addRequest, - editRequest, - delRequest, - }, - toolbar: { - show: false, - }, - search: { - show: false, - }, - form: { - wrapper: { - width: "1050px", - }, - }, - rowHandle: { - width: 200, - }, - table: { - scroll: { - x: 800, - }, - rowSelection: { - type: "radio", - selectedRowKeys: selectedRowKey, - onChange: onSelectChange, - }, - customRow: (record: any) => { - return { - onClick: () => { - onSelectChange([record.id]); - }, // 点击行 - }; - }, - }, - columns: { - id: { - title: "ID", - key: "id", - type: "number", - column: { - width: 50, - }, - form: { - show: false, - }, - }, - name: { - title: "名称", - search: { - show: true, - }, - type: ["text"], - form: { - rules: [{ required: true, message: "请填写名称" }], - helper: "随便填,当多个相同类型的授权时,便于区分", - }, - column: { - width: 200, - }, - }, - from: { - title: "级别", - type: "dict-select", - dict: dict({ - data: [ - { label: "系统", value: "sys" }, - { label: "用户", value: "user" }, - ], - }), - search: { - show: false, - }, - form: { - show: false, - }, - column: { - width: 100, - align: "center", - component: { - color: "auto", - }, - order: 10, - }, - valueBuilder: ({ row, key, value }) => { - row[key] = row.userId > 0 ? "user" : "sys"; - }, - }, - ...commonColumnsDefine, - }, - }, - }; + const typeRef = ref("aliyun"); + context.typeRef = typeRef; + const commonColumnsDefine = getCommonColumnDefine(crudExpose, typeRef, api); + commonColumnsDefine.type.form.component.disabled = true; + return { + typeRef, + crudOptions: { + request: { + pageRequest, + addRequest, + editRequest, + delRequest, + }, + toolbar: { + show: false, + }, + search: { + show: false, + }, + form: { + wrapper: { + width: "1050px", + }, + }, + rowHandle: { + width: 200, + }, + table: { + scroll: { + x: 800, + }, + rowSelection: { + type: "radio", + selectedRowKeys: selectedRowKey, + onChange: onSelectChange, + }, + customRow: (record: any) => { + return { + onClick: () => { + onSelectChange([record.id]); + }, // 点击行 + }; + }, + }, + columns: { + id: { + title: "ID", + key: "id", + type: "number", + column: { + width: 50, + }, + form: { + show: false, + }, + }, + name: { + title: t("certd.name"), + search: { + show: true, + }, + type: ["text"], + form: { + rules: [{ required: true, message: t("certd.pleaseEnterName") }], + helper: t("certd.nameHelper"), + }, + column: { + width: 200, + }, + }, + from: { + title: t("certd.level"), + type: "dict-select", + dict: dict({ + data: [ + { label: t("certd.system"), value: "sys" }, + { label: t("certd.usera"), value: "user" }, + ], + }), + search: { + show: false, + }, + form: { + show: false, + }, + column: { + width: 100, + align: "center", + component: { + color: "auto", + }, + order: 10, + }, + valueBuilder: ({ row, key, value }) => { + row[key] = row.userId > 0 ? "user" : "sys"; + }, + }, + ...commonColumnsDefine, + }, + }, + }; } diff --git a/packages/ui/certd-client/src/views/certd/access/index.vue b/packages/ui/certd-client/src/views/certd/access/index.vue index 79d6164f..9bf9a750 100644 --- a/packages/ui/certd-client/src/views/certd/access/index.vue +++ b/packages/ui/certd-client/src/views/certd/access/index.vue @@ -1,13 +1,13 @@ diff --git a/packages/ui/certd-client/src/views/certd/mine/change-password-button.vue b/packages/ui/certd-client/src/views/certd/mine/change-password-button.vue index b61057fa..920afe71 100644 --- a/packages/ui/certd-client/src/views/certd/mine/change-password-button.vue +++ b/packages/ui/certd-client/src/views/certd/mine/change-password-button.vue @@ -1,7 +1,7 @@ From 0b3472d227b31a58aa314245c300670122c42f48 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Thu, 26 Jun 2025 00:56:43 +0200 Subject: [PATCH 7/9] Partially translate user settings --- .../src/locales/langs/en-US/certd.ts | 44 ++ .../src/locales/langs/zh-CN/certd.ts | 44 ++ .../certd/monitor/site/setting/index.vue | 97 ++-- .../src/views/certd/notification/common.tsx | 445 +++++++------- .../src/views/certd/open/openkey/crud.tsx | 351 +++++------ .../pipeline/components/change-trigger.vue | 94 +-- .../pipeline/component/trigger-form/index.vue | 24 +- .../src/views/sys/authority/user/crud.tsx | 549 +++++++++--------- 8 files changed, 881 insertions(+), 767 deletions(-) diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index 258f3097..6b9ef176 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -300,4 +300,48 @@ export default { nickName: "Nickname", max50Chars: "Maximum 50 characters", myInfo: "My Information", + siteMonitorSettings: "Site Monitor Settings", + notificationChannel: "Notification Channel", + setNotificationChannel: "Set the notification channel", + retryTimes: "Retry Times", + monitorRetryTimes: "Number of retry attempts for monitoring requests", + monitorCronSetting: "Monitoring Schedule", + cronTrigger: "Scheduled trigger for monitoring", + save: "Save", + editSchedule: "Edit Schedule", + timerTrigger: "Timer Trigger", + schedule: "Schedule", + selectCron: "Please select a schedule Cron", + batchEditSchedule: "Batch Edit Schedule", + editTrigger: "Edit Trigger", + triggerName: "Trigger Name", + requiredField: "This field is required", + type: "Type", + enterName: "Please enter a name", + confirmDeleteTrigger: "Are you sure you want to delete this trigger?", + notificationType: "Notification Type", + selectNotificationType: "Please select a notification type", + notificationName: "Notification Name", + helperNotificationName: "Fill freely, helps to distinguish when multiple notifications of the same type exist", + isDefault: "Is Default", + yes: "Yes", + no: "No", + selectIsDefault: "Please select if default", + prompt: "Prompt", + confirmSetDefaultNotification: "Are you sure to set as default notification?", + test: "Test", + scope: "Scope", + scopeOpenApiOnly: "Open API Only", + scopeFullAccount: "Full Account Permissions", + required: "This field is required", + scopeHelper: "Open API only allows access to open APIs; full account permissions allow access to all APIs", + add: "Generate New Key", + gen: { + text: "API Test", + title: "x-certd-token", + okText: "Confirm", + contentPart1: "Test the x-certd-token below, you can use it within 3 minutes to test ", + openApi: "Open API", + contentPart2: " request testing", + }, }; diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 1983dadd..259a8ad8 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -306,4 +306,48 @@ export default { nickName: "昵称", max50Chars: "最大50个字符", myInfo: "我的信息", + siteMonitorSettings: "站点监控设置", + notificationChannel: "通知渠道", + setNotificationChannel: "设置通知渠道", + retryTimes: "重试次数", + monitorRetryTimes: "监控请求重试次数", + monitorCronSetting: "监控定时设置", + cronTrigger: "定时触发监控", + save: "保存", + editSchedule: "修改定时", + timerTrigger: "定时触发", + schedule: "定时", + selectCron: "请选择定时Cron", + batchEditSchedule: "批量修改定时", + editTrigger: "编辑触发器", + triggerName: "触发器名称", + requiredField: "此项必填", + type: "类型", + enterName: "请输入名称", + confirmDeleteTrigger: "确定要删除此触发器吗?", + notificationType: "通知类型", + selectNotificationType: "请选择通知类型", + notificationName: "通知名称", + helperNotificationName: "随便填,当多个相同类型的通知时,便于区分", + isDefault: "是否默认", + yes: "是", + no: "否", + selectIsDefault: "请选择是否默认", + prompt: "提示", + confirmSetDefaultNotification: "确定设置为默认通知?", + test: "测试", + scope: "权限范围", + scopeOpenApiOnly: "仅开放接口", + scopeFullAccount: "账户所有权限", + required: "此项必填", + scopeHelper: "仅开放接口只可以访问开放接口,账户所有权限可以访问所有接口", + add: "生成新的Key", + gen: { + text: "接口测试", + title: "x-certd-token", + okText: "确定", + contentPart1: "测试x-certd-token如下,您可以在3分钟内使用它进行", + openApi: "开放接口", + contentPart2: "请求测试", + }, }; diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue b/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue index 57a6bc2d..0c5c3934 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/site/setting/index.vue @@ -1,37 +1,41 @@ + diff --git a/packages/ui/certd-client/src/views/certd/notification/common.tsx b/packages/ui/certd-client/src/views/certd/notification/common.tsx index 18e061cd..196adcdd 100644 --- a/packages/ui/certd-client/src/views/certd/notification/common.tsx +++ b/packages/ui/certd-client/src/views/certd/notification/common.tsx @@ -5,238 +5,241 @@ import { forEach, get, merge, set } from "lodash-es"; import { Modal } from "ant-design-vue"; import * as api from "/@/views/sys/cname/provider/api"; import { mitter } from "/@/utils/util.mitt"; +import { useI18n } from "vue-i18n"; export function notificationProvide(api: any) { - provide("notificationApi", api); - provide("get:plugin:type", () => { - return "notification"; - }); + provide("notificationApi", api); + provide("get:plugin:type", () => { + return "notification"; + }); } export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) { - const notificationTypeDictRef = dict({ - url: "/pi/notification/getTypeDict", - }); - const defaultPluginConfig = { - component: { - name: "a-input", - vModel: "value", - }, - }; + const { t } = useI18n(); - function buildDefineFields(define: any, form: any, mode: string) { - const formWrapperRef = crudExpose.getFormWrapperRef(); - const columnsRef = toRef(formWrapperRef.formOptions, "columns"); + const notificationTypeDictRef = dict({ + url: "/pi/notification/getTypeDict", + }); + const defaultPluginConfig = { + component: { + name: "a-input", + vModel: "value", + }, + }; - for (const key in columnsRef.value) { - if (key.indexOf(".") >= 0) { - delete columnsRef.value[key]; - } - } - console.log('crudBinding.value[mode + "Form"].columns', columnsRef.value); - forEach(define.input, (value: any, mapKey: any) => { - const key = "body." + mapKey; - const field = { - ...value, - key, - }; - const column = merge({ title: key }, defaultPluginConfig, field); - //eval - useReference(column); + function buildDefineFields(define: any, form: any, mode: string) { + const formWrapperRef = crudExpose.getFormWrapperRef(); + const columnsRef = toRef(formWrapperRef.formOptions, "columns"); - if (column.required) { - if (!column.rules) { - column.rules = []; - } - column.rules.push({ required: true, message: "此项必填" }); - } + for (const key in columnsRef.value) { + if (key.indexOf(".") >= 0) { + delete columnsRef.value[key]; + } + } + console.log('crudBinding.value[mode + "Form"].columns', columnsRef.value); + forEach(define.input, (value: any, mapKey: any) => { + const key = "body." + mapKey; + const field = { + ...value, + key, + }; + const column = merge({ title: key }, defaultPluginConfig, field); + //eval + useReference(column); - //设置默认值 - if (column.value != null && get(form, key) == null) { - set(form, key, column.value); - } - //字段配置赋值 - columnsRef.value[key] = column; - console.log("form", columnsRef.value, form); - }); - } + if (column.required) { + if (!column.rules) { + column.rules = []; + } + column.rules.push({ required: true, message: t("certd.requiredField") }); + } - const currentDefine = ref(); + //设置默认值 + if (column.value != null && get(form, key) == null) { + set(form, key, column.value); + } + //字段配置赋值 + columnsRef.value[key] = column; + console.log("form", columnsRef.value, form); + }); + } - return { - id: { - title: "ID", - key: "id", - type: "number", - column: { - width: 100, - }, - form: { - show: false, - }, - }, - type: { - title: "通知类型", - type: "dict-select", - dict: notificationTypeDictRef, - search: { - show: false, - }, - column: { - width: 200, - component: { - color: "auto", - }, - }, - editForm: { - component: { - disabled: false, - }, - }, - form: { - component: { - disabled: false, - showSearch: true, - filterOption: (input: string, option: any) => { - input = input?.toLowerCase(); - return option.value.toLowerCase().indexOf(input) >= 0 || option.label.toLowerCase().indexOf(input) >= 0; - }, - renderLabel(item: any) { - return ( - - {item.label} - {item.needPlus && } - - ); - }, - }, - rules: [{ required: true, message: "请选择通知类型" }], - valueChange: { - immediate: true, - async handle({ value, mode, form, immediate }) { - if (value == null) { - return; - } - const lastTitle = currentDefine.value?.title; - const define = await api.GetProviderDefine(value); - currentDefine.value = define; - console.log("define", define); + const currentDefine = ref(); - if (!immediate) { - form.body = {}; - if (define.needPlus) { - mitter.emit("openVipModal"); - } - } + return { + id: { + title: "ID", + key: "id", + type: "number", + column: { + width: 100, + }, + form: { + show: false, + }, + }, + type: { + title: t("certd.notificationType"), + type: "dict-select", + dict: notificationTypeDictRef, + search: { + show: false, + }, + column: { + width: 200, + component: { + color: "auto", + }, + }, + editForm: { + component: { + disabled: false, + }, + }, + form: { + component: { + disabled: false, + showSearch: true, + filterOption: (input: string, option: any) => { + input = input?.toLowerCase(); + return option.value.toLowerCase().indexOf(input) >= 0 || option.label.toLowerCase().indexOf(input) >= 0; + }, + renderLabel(item: any) { + return ( + + {item.label} + {item.needPlus && } + + ); + }, + }, + rules: [{ required: true, message: t("certd.selectNotificationType") }], + valueChange: { + immediate: true, + async handle({ value, mode, form, immediate }) { + if (value == null) { + return; + } + const lastTitle = currentDefine.value?.title; + const define = await api.GetProviderDefine(value); + currentDefine.value = define; + console.log("define", define); - if (!form.name || form.name === lastTitle) { - form.name = define.title; - } - buildDefineFields(define, form, mode); - }, - }, - helper: computed(() => { - const define = currentDefine.value; - if (define == null) { - return ""; - } - return define.desc; - }), - }, - } as ColumnCompositionProps, - name: { - title: "通知名称", - search: { - show: true, - }, - type: ["text"], - form: { - rules: [{ required: true, message: "请填写名称" }], - helper: "随便填,当多个相同类型的通知时,便于区分", - }, - column: { - width: 200, - }, - }, - isDefault: { - title: "是否默认", - type: "dict-switch", - dict: dict({ - data: [ - { label: "是", value: true, color: "success" }, - { label: "否", value: false, color: "default" }, - ], - }), - form: { - value: false, - rules: [{ required: true, message: "请选择是否默认" }], - order: 999, - }, - column: { - align: "center", - width: 100, - component: { - name: "a-switch", - vModel: "checked", - disabled: compute(({ value }) => { - return value === true; - }), - on: { - change({ row }) { - Modal.confirm({ - title: "提示", - content: "确定设置为默认通知?", - onOk: async () => { - await api.SetDefault(row.id); - await crudExpose.doRefresh(); - }, - onCancel: async () => { - await crudExpose.doRefresh(); - }, - }); - }, - }, - }, - }, - } as ColumnCompositionProps, - test: { - title: "测试", - form: { - show: compute(({ form }) => { - return !!form.type; - }), - component: { - name: "api-test", - action: "TestRequest", - }, - order: 990, - col: { - span: 24, - }, - }, - column: { - show: false, - }, - }, - setting: { - column: { show: false }, - form: { - show: false, - valueBuilder({ value, form }) { - form.body = {}; - if (!value) { - return; - } - const setting = JSON.parse(value); - for (const key in setting) { - form.body[key] = setting[key]; - } - }, - valueResolve({ form }) { - const setting = form.body; - form.setting = JSON.stringify(setting); - }, - }, - } as ColumnCompositionProps, - }; + if (!immediate) { + form.body = {}; + if (define.needPlus) { + mitter.emit("openVipModal"); + } + } + + if (!form.name || form.name === lastTitle) { + form.name = define.title; + } + buildDefineFields(define, form, mode); + }, + }, + helper: computed(() => { + const define = currentDefine.value; + if (define == null) { + return ""; + } + return define.desc; + }), + }, + } as ColumnCompositionProps, + name: { + title: t("certd.notificationName"), + search: { + show: true, + }, + type: ["text"], + form: { + rules: [{ required: true, message: t("certd.enterName") }], + helper: t("certd.helperNotificationName"), + }, + column: { + width: 200, + }, + }, + isDefault: { + title: t("certd.isDefault"), + type: "dict-switch", + dict: dict({ + data: [ + { label: t("certd.yes"), value: true, color: "success" }, + { label: t("certd.no"), value: false, color: "default" }, + ], + }), + form: { + value: false, + rules: [{ required: true, message: t("certd.selectIsDefault") }], + order: 999, + }, + column: { + align: "center", + width: 100, + component: { + name: "a-switch", + vModel: "checked", + disabled: compute(({ value }) => { + return value === true; + }), + on: { + change({ row }) { + Modal.confirm({ + title: t("certd.prompt"), + content: t("certd.confirmSetDefaultNotification"), + onOk: async () => { + await api.SetDefault(row.id); + await crudExpose.doRefresh(); + }, + onCancel: async () => { + await crudExpose.doRefresh(); + }, + }); + }, + }, + }, + }, + } as ColumnCompositionProps, + test: { + title: t("certd.test"), + form: { + show: compute(({ form }) => { + return !!form.type; + }), + component: { + name: "api-test", + action: "TestRequest", + }, + order: 990, + col: { + span: 24, + }, + }, + column: { + show: false, + }, + }, + setting: { + column: { show: false }, + form: { + show: false, + valueBuilder({ value, form }) { + form.body = {}; + if (!value) { + return; + } + const setting = JSON.parse(value); + for (const key in setting) { + form.body[key] = setting[key]; + } + }, + valueResolve({ form }) { + const setting = form.body; + form.setting = JSON.stringify(setting); + }, + }, + } as ColumnCompositionProps, + }; } diff --git a/packages/ui/certd-client/src/views/certd/open/openkey/crud.tsx b/packages/ui/certd-client/src/views/certd/open/openkey/crud.tsx index 040624e0..a98133ed 100644 --- a/packages/ui/certd-client/src/views/certd/open/openkey/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/open/openkey/crud.tsx @@ -5,181 +5,182 @@ import { OPEN_API_DOC, openkeyApi } from "./api"; import { useModal } from "/@/use/use-modal"; export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { - const { t } = useI18n(); - const api = openkeyApi; - const pageRequest = async (query: UserPageQuery): Promise => { - return await api.GetList(query); - }; - const editRequest = async (req: EditReq) => { - const { form, row } = req; - form.id = row.id; - const res = await api.UpdateObj(form); - return res; - }; - const delRequest = async (req: DelReq) => { - const { row } = req; - return await api.DelObj(row.id); - }; + const { t } = useI18n(); + const api = openkeyApi; + const pageRequest = async (query: UserPageQuery): Promise => { + return await api.GetList(query); + }; + const editRequest = async (req: EditReq) => { + const { form, row } = req; + form.id = row.id; + const res = await api.UpdateObj(form); + return res; + }; + const delRequest = async (req: DelReq) => { + const { row } = req; + return await api.DelObj(row.id); + }; - const addRequest = async (req: AddReq) => { - const { form } = req; - const res = await api.AddObj(form); - return res; - }; - const model = useModal(); - return { - crudOptions: { - request: { - pageRequest, - addRequest, - editRequest, - delRequest, - }, - search: { - show: false, - }, - form: { - labelCol: { - //固定label宽度 - span: null, - style: { - width: "100px", - }, - }, - col: { - span: 22, - }, - wrapper: { - width: 600, - }, - }, - actionbar: { - buttons: { - add: { - text: "生成新的Key", - }, - }, - }, - rowHandle: { - width: 300, - fixed: "right", - buttons: { - view: { show: true }, - copy: { show: false }, - edit: { show: false }, - remove: { show: true }, - gen: { - text: "接口测试", - size: "mini", - icon: "devicon-plain:vitest", - type: "primary", - async click({ row }) { - const apiToken = await api.GetApiToken(row.id); + const addRequest = async (req: AddReq) => { + const { form } = req; + const res = await api.AddObj(form); + return res; + }; + const model = useModal(); + return { + crudOptions: { + request: { + pageRequest, + addRequest, + editRequest, + delRequest, + }, + search: { + show: false, + }, + form: { + labelCol: { + //固定label宽度 + span: null, + style: { + width: "100px", + }, + }, + col: { + span: 22, + }, + wrapper: { + width: 600, + }, + }, + actionbar: { + buttons: { + add: { + text: t("certd.actionbar.add"), + }, + }, + }, + rowHandle: { + width: 300, + fixed: "right", + buttons: { + view: { show: true }, + copy: { show: false }, + edit: { show: false }, + remove: { show: true }, + gen: { + text: t("certd.gen.text"), + size: "mini", + icon: "devicon-plain:vitest", + type: "primary", + async click({ row }) { + const apiToken = await api.GetApiToken(row.id); - model.success({ - title: "x-certd-token", - maskClosable: true, - okText: "确定", - width: 600, - content: () => { - return ( -
-
- 测试x-certd-token如下,您可以在3分钟内使用它进行 - - 开放接口 - - 请求测试 -
-
- -
-
- ); - }, - }); - }, - }, - }, - }, - columns: { - id: { - title: "ID", - key: "id", - type: "number", - search: { - show: false, - }, - column: { - width: 100, - editable: { - disabled: true, - }, - }, - form: { - show: false, - }, - }, - keyId: { - title: "KeyId", - type: ["text", "copyable"], - search: { - show: true, - }, - form: { - show: false, - }, - column: { - width: 250, - sorter: true, - }, - }, - keySecret: { - title: "KeySecret", - type: ["text", "copyable"], - form: { - show: false, - }, - column: { - width: 580, - sorter: true, - }, - }, - scope: { - title: "权限范围", - type: "dict-radio", - dict: dict({ - data: [ - { label: "仅开放接口", value: "open", color: "blue" }, - { label: "账户所有权限", value: "user", color: "red" }, - ], - }), - form: { - value: "open", - show: true, - rules: [{ required: true, message: "此项必填" }], - helper: "仅开放接口只可以访问开放接口,账户所有权限可以访问所有接口", - component: { - vModel: "value", - }, - }, - column: { - width: 120, - align: "center", - sorter: true, - }, - }, - createTime: { - title: "创建时间", - type: "datetime", - search: { - show: false, - }, - form: { - show: false, - }, - }, - }, - }, - }; + model.success({ + title: t("certd.gen.title"), + maskClosable: true, + okText: t("certd.gen.okText"), + width: 600, + content: () => { + return ( +
+
+ {t("certd.gen.contentPart1")} + + {t("certd.gen.openApi")} + + {t("certd.gen.contentPart2")} +
+
+ +
+
+ ); + }, + }); + }, + }, + }, + }, + columns: { + id: { + title: "ID", + key: "id", + type: "number", + search: { + show: false, + }, + column: { + width: 100, + editable: { + disabled: true, + }, + }, + form: { + show: false, + }, + }, + keyId: { + title: "KeyId", + type: ["text", "copyable"], + search: { + show: true, + }, + form: { + show: false, + }, + column: { + width: 250, + sorter: true, + }, + }, + keySecret: { + title: "KeySecret", + type: ["text", "copyable"], + form: { + show: false, + }, + column: { + width: 580, + sorter: true, + }, + }, + scope: { + title: t("certd.scope"), + type: "dict-radio", + dict: dict({ + data: [ + { label: t("certd.scopeOpenApiOnly"), value: "open", color: "blue" }, + { label: t("certd.scopeFullAccount"), value: "user", color: "red" }, + ], + }), + form: { + value: "open", + show: true, + rules: [{ required: true, message: t("certd.required") }], + helper: t("certd.scopeHelper"), + component: { + vModel: "value", + }, + }, + column: { + width: 120, + align: "center", + sorter: true, + }, + }, + createTime: { + title: t("certd.fields.createTime"), + type: "datetime", + search: { + show: false, + }, + form: { + show: false, + }, + }, + + }, + }, + }; } diff --git a/packages/ui/certd-client/src/views/certd/pipeline/components/change-trigger.vue b/packages/ui/certd-client/src/views/certd/pipeline/components/change-trigger.vue index 8f754712..4e4fb599 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/components/change-trigger.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/components/change-trigger.vue @@ -1,62 +1,70 @@ + + diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue index cbd52b98..0f57b080 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/trigger-form/index.vue @@ -3,7 +3,7 @@ class="pi-trigger-form" @after-open-change="triggerDrawerOnAfterVisibleChange">