Compare commits

...

40 Commits

Author SHA1 Message Date
xiaojunnuo 60c8ace443 perf: 支持部署到华为elb 2026-01-29 23:39:57 +08:00
xiaojunnuo 933aaeaf25 chore: cfTurnstile 2026-01-29 22:10:27 +08:00
xiaojunnuo ca43c77525 perf: 验证码支持 Cloudflare Turnstile ,谨慎启用,国内被墙了 2026-01-29 17:21:39 +08:00
xiaojunnuo b204182c13 build: release 2026-01-29 01:17:50 +08:00
xiaojunnuo dfb4165a12 build: release 2026-01-29 01:16:15 +08:00
xiaojunnuo 26a54cd228 build: publish 2026-01-29 01:03:11 +08:00
xiaojunnuo e229f14121 build: trigger build image 2026-01-29 01:02:59 +08:00
xiaojunnuo ee6cdfb391 v1.38.3 2026-01-29 01:01:31 +08:00
xiaojunnuo 58354e563c build: prepare to build 2026-01-29 00:57:53 +08:00
xiaojunnuo 48f1bf0918 perf: 站点监控,检查状态挪到前面显示 2026-01-29 00:57:29 +08:00
xiaojunnuo 0ffe1f2cef chore: metadata refresh 2026-01-29 00:50:45 +08:00
xiaojunnuo 8fe1adacf3 build: prepare to build 2026-01-29 00:48:55 +08:00
xiaojunnuo 30245c5d8a chore: 移除错误引用 2026-01-29 00:48:50 +08:00
xiaojunnuo 67a5225bde chore: 修复默认更新天数无效的bug 2026-01-29 00:46:29 +08:00
xiaojunnuo 58c3d7087b perf: 证书仓库页面增加到期状态查询条件 2026-01-29 00:38:33 +08:00
xiaojunnuo c408687af7 perf: ucloud支持部署到ulb(alb、clb统一成一个) 2026-01-28 23:53:57 +08:00
xiaojunnuo 33b284afc0 fix: 站点检查多个ip连接超时的报错显示不出来的bug 2026-01-28 19:22:00 +08:00
xiaojunnuo 78004bdfb5 perf: ucloud支持部署到alb 2026-01-27 19:25:50 +08:00
xiaojunnuo 640950d4c8 perf: 部署插件支持ucloud alb 2026-01-27 00:32:23 +08:00
xiaojunnuo 998de0f9a0 perf: 优化首页图标 2026-01-27 00:32:03 +08:00
xiaojunnuo ce6e515309 chore: tour 2026-01-26 19:07:29 +08:00
xiaojunnuo e054c8fc55 perf: 首次使用提示新手教程按钮 2026-01-26 18:49:16 +08:00
xiaojunnuo 9fa1c2eb3e perf: 优化首页统计数据,饼图替换成证书数量统计 2026-01-26 00:42:47 +08:00
xiaojunnuo 64a314c19e chore: zindex 2026-01-25 23:08:42 +08:00
xiaojunnuo 40be42406c perf: 输入证书域名时,支持点击导入域名 2026-01-25 22:57:59 +08:00
xiaojunnuo bca0eefc83 chore: domain import icon 2026-01-25 13:06:19 +08:00
xiaojunnuo 662ca19f8f chore: domain import 优化 2026-01-25 13:01:12 +08:00
xiaojunnuo 65f9d482f3 chore: domain import task 2026-01-25 02:09:16 +08:00
xiaojunnuo 7058d5cb93 perf: 域名导入任务进度条 2026-01-25 00:50:36 +08:00
xiaojunnuo f7b13c69e9 chore: page turn 2026-01-24 23:36:44 +08:00
xiaojunnuo 9f21b1a097 perf: 所有的dnsprovider 支持导入域名列表 2026-01-23 18:37:38 +08:00
xiaojunnuo 53983002b6 fix: 当通知配置被删除时,使用默认通知配置进行发送 2026-01-23 17:10:10 +08:00
xiaojunnuo d3c0914ac1 perf: 多个dns 提供商支持导入域名 2026-01-23 16:56:01 +08:00
xiaojunnuo 7eb9694221 perf: 支持导入51dns域名 2026-01-23 15:28:33 +08:00
xiaojunnuo b8f0d37420 docs: 1 2026-01-23 14:13:53 +08:00
xiaojunnuo 1d5b1c239c perf: 证书流水线创建域名输入框支持获取域名数据进行选择 2026-01-22 18:33:39 +08:00
xiaojunnuo d1ebc08478 chore: publish 优化 2026-01-22 13:50:20 +08:00
xiaojunnuo 5074a91669 build: release 2026-01-22 13:11:06 +08:00
xiaojunnuo 40e56c4040 build: publish 2026-01-22 12:32:55 +08:00
xiaojunnuo 3b0ed9310a build: trigger build image 2026-01-22 12:32:42 +08:00
154 changed files with 3655 additions and 598 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
- name: publish_to_github - name: publish_to_github
id: publish_to_github id: publish_to_github
run: | run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} export GITHUB_TOKEN=${{ secrets.GH_TOKEN }}
rm -rf ./pnpm*.yaml rm -rf ./pnpm*.yaml
npm install -g pnpm npm install -g pnpm
pnpm install pnpm install
+3
View File
@@ -13,5 +13,8 @@
"explorer.autoReveal": false, "explorer.autoReveal": false,
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features" "editor.defaultFormatter": "vscode.typescript-language-features"
},
"[less]": {
"editor.defaultFormatter": "vscode.css-language-features"
} }
} }
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Bug Fixes
* 当通知配置被删除时,使用默认通知配置进行发送 ([5398300](https://github.com/certd/certd/commit/53983002b6553a929b72e2c70a26809a9f306e89))
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
### Performance Improvements
* 部署插件支持ucloud alb ([640950d](https://github.com/certd/certd/commit/640950d4c847c72cae2986e3c2cae10d52a67fdf))
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
* 所有的dnsprovider 支持导入域名列表 ([9f21b1a](https://github.com/certd/certd/commit/9f21b1a09797d7dab253e4416c538b55fb8f4488))
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
* 优化首页图标 ([998de0f](https://github.com/certd/certd/commit/998de0f9a031339b019aa7a09e61e994664a8047))
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
* 站点监控,检查状态挪到前面显示 ([48f1bf0](https://github.com/certd/certd/commit/48f1bf091869b87dd17feaca5efd8680ef741582))
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
* ucloud支持部署到ulbalb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
### Bug Fixes ### Bug Fixes
+1 -1
View File
@@ -39,7 +39,7 @@ Certd® 是一个免费的全自动证书管理系统,让你的网站证书永
* **站点证书监控**: 定时监控网站证书的过期时间 * **站点证书监控**: 定时监控网站证书的过期时间
* **多用户管理**: 用户可以管理自己的证书流水线 * **多用户管理**: 用户可以管理自己的证书流水线
* **多语言支持** 中英双语切换 * **多语言支持** 中英双语切换
* **一键无忧升级** 版本向下兼容 * **无忧升级** 版本向下兼容
![](./docs/images/intro/intro.svg) ![](./docs/images/intro/intro.svg)
+40
View File
@@ -3,6 +3,46 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Bug Fixes
* 当通知配置被删除时,使用默认通知配置进行发送 ([5398300](https://github.com/certd/certd/commit/53983002b6553a929b72e2c70a26809a9f306e89))
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
### Performance Improvements
* 部署插件支持ucloud alb ([640950d](https://github.com/certd/certd/commit/640950d4c847c72cae2986e3c2cae10d52a67fdf))
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
* 所有的dnsprovider 支持导入域名列表 ([9f21b1a](https://github.com/certd/certd/commit/9f21b1a09797d7dab253e4416c538b55fb8f4488))
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
* 优化首页图标 ([998de0f](https://github.com/certd/certd/commit/998de0f9a031339b019aa7a09e61e994664a8047))
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
* 站点监控,检查状态挪到前面显示 ([48f1bf0](https://github.com/certd/certd/commit/48f1bf091869b87dd17feaca5efd8680ef741582))
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
* ucloud支持部署到ulbalb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
### Bug Fixes
* 编辑插件author不允许出现符号 ([5ea2b09](https://github.com/certd/certd/commit/5ea2b09dc30397c086a2498f958f661e7fef10fc))
* 修复插件修改名字和删除后没有注销注册的bug ([61192b9](https://github.com/certd/certd/commit/61192b998a7088a8f446fd224cc242def462a79b))
* 修复流水线复制出错的bug ([418bcdd](https://github.com/certd/certd/commit/418bcddc95bf19d2659d2a9cfe336bc059d157b0))
### Performance Improvements
* 优化流水线创建入口,各种证书申请任务类型拆分成多个按钮 ([f75c73d](https://github.com/certd/certd/commit/f75c73d739ee271fb718148416836dbe09bb3266))
* 域名导入 ([ad64384](https://github.com/certd/certd/commit/ad64384891c13342980b7559924666dcfb2796c2))
* 支持从提供商导入域名列表 ([f442363](https://github.com/certd/certd/commit/f4423638a2ee779d48fc17b3819ce3bee55b0361))
* 支持同步域名过期时间 ([a97cee8](https://github.com/certd/certd/commit/a97cee84f3bfdeeb2083d91f748cac5405fed6ae))
* cname记录支持批量导入和导出 ([607afe8](https://github.com/certd/certd/commit/607afe864a12d6f50993895a4e10f4c9a3dd8fee))
## [1.38.1](https://github.com/certd/certd/compare/v1.38.0...v1.38.1) (2026-01-15) ## [1.38.1](https://github.com/certd/certd/compare/v1.38.0...v1.38.1) (2026-01-15)
### Bug Fixes ### Bug Fixes
-9
View File
@@ -1,14 +1,5 @@
# 专业版赞助 # 专业版赞助
## 开源为什么要做专业版收费?
1. 纯靠为爱发电不可持续,容易烂尾(比如:我的dev-sidecar项目即便是拥有20K+star,也差点凉凉,幸亏有另外大佬接手用爱发电)
2. 没有赞助的项目,作者会比较任性,不会用心倾听用户的心声,不顾用户体验(比如:下意识拒绝需求、频繁破坏性变更升级、全盘推倒重来之类的)
3. 没有赞助的项目,交流群的戾气有时候比较重,容易起冲突
## 赞助权益:
1. 可加入专属VIP群,可以获得作者一对一技术支持,必要时可以远程协助
# 专业版赞助
## 开源为什么要做专业版收费? ## 开源为什么要做专业版收费?
1. 纯靠为爱发电不可持续,容易烂尾(比如:我的[dev-sidecar项目](https://github.com/docmirror/dev-sidecar)即便是拥有20K+star,也差点凉凉,幸亏有另外大佬接手用爱发电) 1. 纯靠为爱发电不可持续,容易烂尾(比如:我的[dev-sidecar项目](https://github.com/docmirror/dev-sidecar)即便是拥有20K+star,也差点凉凉,幸亏有另外大佬接手用爱发电)
2. 没有赞助的项目,作者会比较任性,不会用心倾听用户的心声,不顾用户体验(比如:下意识拒绝需求、频繁破坏性变更升级、全盘推倒重来之类的) 2. 没有赞助的项目,作者会比较任性,不会用心倾听用户的心声,不顾用户体验(比如:下意识拒绝需求、频繁破坏性变更升级、全盘推倒重来之类的)
+2
View File
@@ -15,6 +15,8 @@ Certd 是一款开源、免费、全自动申请和部署更新SSL证书的工
![首页](../images/start/home.png) ![首页](../images/start/home.png)
![](../images/start/first.png)
## 1、关于证书续期 ## 1、关于证书续期
>* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。 >* 实际上没有办法不改变证书文件本身情况下直接续期或者续签。
>* 我们所说的续期,其实就是按照全套流程重新申请一份新证书,然后重新部署上去。 >* 我们所说的续期,其实就是按照全套流程重新申请一份新证书,然后重新部署上去。
+12 -4
View File
@@ -5,12 +5,20 @@
![](./images/1.png) ![](./images/1.png)
:::tip
接口key分两种权限范围:
1. 仅开放接口: 仅能访问下面`接口文档`中的接口
2. 用户级别: 可访问Certd所有接口,没有文档,可以在浏览器中F12抓取网络请求参考
:::
## 接口文档 ## 接口文档
https://apifox.com/apidoc/shared-2e76f8c4-7c58-413b-a32d-a1316529af44/254949529e0 https://apifox.com/apidoc/shared-2e76f8c4-7c58-413b-a32d-a1316529af44/254949529e0
## Token生成方法 ### Token生成方法
header中传入x-certd-token即可调用开放接口 header中传入x-certd-token即可调用开放接口
1、首先从OpenKey页面生成keyIdkeySecret 1、首先从OpenKey页面生成keyIdkeySecret
@@ -19,10 +27,10 @@ header中传入x-certd-token即可调用开放接口
4、然后将content和sign分别base64后用.号连接: x-certd-token = base64(content) +"."+base64(sign) 4、然后将content和sign分别base64后用.号连接: x-certd-token = base64(content) +"."+base64(sign)
## 参数 ### 参数
支持证书id和域名两种方式获取证书。 支持证书id和域名两种方式获取证书。
## 创建新的证书申请 ### 创建新的证书申请
参数autoApply=true,将在没有证书时自动触发申请证书,检查逻辑如下: 参数autoApply=true,将在没有证书时自动触发申请证书,检查逻辑如下:
1. 如果证书仓库里面有,且没有过期,就直接返回证书 1. 如果证书仓库里面有,且没有过期,就直接返回证书
2. 如果没有或者已过期,就会去找流水线,有就触发流水线执行 2. 如果没有或者已过期,就会去找流水线,有就触发流水线执行
@@ -30,7 +38,7 @@ header中传入x-certd-token即可调用开放接口
4. 再次采用相同参数请求接口,如果在申请过程中,就会提示`正在申请中`,可轮循获取状态,直到证书申请成功。 4. 再次采用相同参数请求接口,如果在申请过程中,就会提示`正在申请中`,可轮循获取状态,直到证书申请成功。
## SDK ### SDK
待开发 待开发
## 客户端工具 ## 客户端工具
+1 -1
View File
@@ -24,7 +24,7 @@
| 20.| **google cloud** | 谷歌云授权 | | 20.| **google cloud** | 谷歌云授权 |
| 21.| **cloudflare授权** | | | 21.| **cloudflare授权** | |
| 22.| **中国移动CND授权** | | | 22.| **中国移动CND授权** | |
| 23.| **授权插件示例** | | | 23.| **授权插件示例** | 这是一个示例授权插件,用于演示如何实现一个授权插件 |
| 24.| **dns.la授权** | | | 24.| **dns.la授权** | |
| 25.| **多吉云** | | | 25.| **多吉云** | |
| 26.| **Dokploy授权** | | | 26.| **Dokploy授权** | |
+5 -3
View File
@@ -1,5 +1,5 @@
# 任务插件 # 任务插件
`116` 款任务插件 `118` 款任务插件
## 1. 证书申请 ## 1. 证书申请
| 序号 | 名称 | 说明 | | 序号 | 名称 | 说明 |
@@ -138,8 +138,10 @@
| 序号 | 名称 | 说明 | | 序号 | 名称 | 说明 |
|-----|-----|-----| |-----|-----|-----|
| 1.| **UCloud-部署到CDN** | 将证书部署到UCloud CDN | | 1.| **UCloud-部署到CDN** | 将证书部署到UCloud CDN |
| 2.| **UCloud-部署到WAF** | 将证书部署到UCloud WAF | | 2.| **UCloud-部署到负载均衡** | 将证书部署到UCloud负载均衡(ULB/ALB/CLB) |
| 3.| **UCloud-上传到USSL** | 将证书上传到UCloud USSL | | 3.| **UCloud-部署到对象存储(US3)** | 将证书部署到UCloud对象存储(US3) |
| 4.| **UCloud-部署到WAF** | 将证书部署到UCloud WAF |
| 5.| **UCloud-上传到USSL** | 将证书上传到UCloud USSL |
## 11. 百度云 ## 11. 百度云
| 序号 | 名称 | 说明 | | 序号 | 名称 | 说明 |
+1
View File
@@ -15,3 +15,4 @@
## 2. 图文教程链接 ## 2. 图文教程链接
如果不方便登录系统,您还可以直接查看 [图文教程](https://gitee.com/certd/certd/blob/v2/step.md) 如果不方便登录系统,您还可以直接查看 [图文教程](https://gitee.com/certd/certd/blob/v2/step.md)
![alt text](../images/start/first.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

+1 -1
View File
@@ -9,5 +9,5 @@
} }
}, },
"npmClient": "pnpm", "npmClient": "pnpm",
"version": "1.38.2" "version": "1.38.3"
} }
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/publishlab/node-acme-client/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/acme-client
## [1.38.2](https://github.com/publishlab/node-acme-client/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/publishlab/node-acme-client/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/acme-client **Note:** Version bump only for package @certd/acme-client
+3 -3
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client", "description": "Simple and unopinionated ACME client",
"private": false, "private": false,
"author": "nmorsman", "author": "nmorsman",
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"module": "scr/index.js", "module": "scr/index.js",
"main": "src/index.js", "main": "src/index.js",
@@ -18,7 +18,7 @@
"types" "types"
], ],
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@peculiar/x509": "^1.11.0", "@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5", "asn1js": "^3.0.5",
"axios": "^1.9.0", "axios": "^1.9.0",
@@ -70,5 +70,5 @@
"bugs": { "bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues" "url": "https://github.com/publishlab/node-acme-client/issues"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Bug Fixes
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/basic **Note:** Version bump only for package @certd/basic
+1 -1
View File
@@ -1 +1 @@
12:26 00:57
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/basic", "name": "@certd/basic",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -47,5 +47,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+36 -22
View File
@@ -25,26 +25,30 @@ export class HttpError extends Error {
if (!error) { if (!error) {
return; return;
} }
super(error.message || error.response?.statusText);
const message = error?.message; let message = error?.message || error?.response.statusText || error?.code;
if (message && typeof message === "string" && message.indexOf) { if (message && typeof message === "string" && message.indexOf) {
for (const key in errorMap) { for (const key in errorMap) {
if (message.indexOf(key) > -1) { if (message.indexOf(key) > -1) {
this.message = `${this.message}(${errorMap[key]})`; message = `${message}(${errorMap[key]})`;
break; break;
} }
} }
} }
if (!message) {
message = error.message;
}
if (error.errors && error.errors.length > 0) {
message += " \n" + error.errors.map((item: any) => item.message).join("\n ");
}
super(message);
this.name = error.name; this.name = error.name;
this.code = error.code; this.code = error.code;
this.status = error.response?.status; this.status = error.response?.status;
this.statusText = error.response?.statusText || error.code; this.statusText = error.response?.statusText || error.code;
if (!this.message) {
this.message = error.code;
}
this.request = { this.request = {
baseURL: error.config?.baseURL, baseURL: error.config?.baseURL,
url: error.config?.url, url: error.config?.url,
@@ -173,39 +177,40 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
}, },
(error: any) => { (error: any) => {
const status = error.response?.status; const status = error.response?.status;
let message = "";
switch (status) { switch (status) {
case 400: case 400:
error.message = "请求错误"; message = "请求错误";
break; break;
case 401: case 401:
error.message = "认证/登录失败"; message = "认证/登录失败";
break; break;
case 403: case 403:
error.message = "拒绝访问"; message = "拒绝访问";
break; break;
case 404: case 404:
error.message = `请求地址出错`; message = `请求地址出错`;
break; break;
case 408: case 408:
error.message = "请求超时"; message = "请求超时";
break; break;
case 500: case 500:
error.message = "服务器内部错误"; message = "服务器内部错误";
break; break;
case 501: case 501:
error.message = "服务未实现"; message = "服务未实现";
break; break;
case 502: case 502:
error.message = "网关错误"; message = "网关错误";
break; break;
case 503: case 503:
error.message = "服务不可用"; message = "服务不可用";
break; break;
case 504: case 504:
error.message = "网关超时"; message = "网关超时";
break; break;
case 505: case 505:
error.message = "HTTP版本不受支持"; message = "HTTP版本不受支持";
break; break;
case 302: case 302:
//重定向 //重定向
@@ -213,9 +218,12 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
default: default:
break; break;
} }
if (status) {
message += ` [${status}] `;
}
const errorCode = error.code; const errorCode = error.code;
let errorMessage = null; let errorMessage = "";
if (errorCode === "ECONNABORTED") { if (errorCode === "ECONNABORTED") {
errorMessage = "请求连接终止"; errorMessage = "请求连接终止";
} else if (errorCode === "ETIMEDOUT") { } else if (errorCode === "ETIMEDOUT") {
@@ -227,11 +235,17 @@ export function createAxiosService({ logger }: { logger: ILogger }) {
} else if (errorCode === "ENOTFOUND") { } else if (errorCode === "ENOTFOUND") {
errorMessage = "请求地址不存在"; errorMessage = "请求地址不存在";
} }
if (errorMessage) { if (errorCode) {
error.message = errorMessage + "," + error.message; errorMessage += ` [${errorCode}] `;
} }
if (message) {
logger.error(`请求出错:status:${error.response?.status || error.code},statusText:${error.response?.statusText || error.code},url:${error.config?.url},method:${error.config?.method}`); errorMessage += `,${message}`;
}
if (error.message) {
errorMessage += `(${error.message})`;
}
error.message = errorMessage;
logger.error(`请求出错:${errorMessage} status:${status},statusText:${error.response?.statusText || error.code},url:${error.config?.url},method:${error.config?.method}`);
logger.error("返回数据:", JSON.stringify(error.response?.data)); logger.error("返回数据:", JSON.stringify(error.response?.data));
if (error.response?.data) { if (error.response?.data) {
const message = error.response.data.message || error.response.data.msg || error.response.data.error; const message = error.response.data.message || error.response.data.msg || error.response.data.error;
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/pipeline
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
### Bug Fixes ### Bug Fixes
+4 -4
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/pipeline", "name": "@certd/pipeline",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch" "compile": "tsc --skipLibCheck --watch"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@certd/plus-core": "^1.38.2", "@certd/plus-core": "^1.38.3",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13" "reflect-metadata": "^0.1.13"
@@ -45,5 +45,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+8 -1
View File
@@ -35,7 +35,14 @@ export class Pager {
} }
} }
export async function doPageTurn<T>(req: { pager: Pager; getPage: (pager: Pager) => Promise<PageRes<T>>; itemHandle?: (item: T) => Promise<void>; batchHandle?: (pageRes: PageRes<T>) => Promise<void> }) { export type PageTurnReq<T = any> = {
pager: Pager;
getPage: (pager: Pager) => Promise<PageRes<T>>;
itemHandle?: (item: T) => Promise<void>;
batchHandle?: (pageRes: PageRes<T>) => Promise<void>;
};
export async function doPageTurn<T>(req: PageTurnReq<T>) {
let count = 0; let count = 0;
const { pager, getPage, itemHandle, batchHandle } = req; const { pager, getPage, itemHandle, batchHandle } = req;
while (true) { while (true) {
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/lib-huawei **Note:** Version bump only for package @certd/lib-huawei
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-huawei", "name": "@certd/lib-huawei",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
"types": "./dist/d/index.d.ts", "types": "./dist/d/index.d.ts",
@@ -24,5 +24,5 @@
"prettier": "^2.8.8", "prettier": "^2.8.8",
"tslib": "^2.8.1" "tslib": "^2.8.1"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/lib-iframe **Note:** Version bump only for package @certd/lib-iframe
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-iframe", "name": "@certd/lib-iframe",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/jdcloud **Note:** Version bump only for package @certd/jdcloud
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/jdcloud", "name": "@certd/jdcloud",
"version": "1.38.2", "version": "1.38.3",
"description": "jdcloud openApi sdk", "description": "jdcloud openApi sdk",
"main": "./dist/bundle.js", "main": "./dist/bundle.js",
"module": "./dist/bundle.js", "module": "./dist/bundle.js",
@@ -56,5 +56,5 @@
"fetch" "fetch"
] ]
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/lib-k8s **Note:** Version bump only for package @certd/lib-k8s
+3 -3
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/lib-k8s", "name": "@certd/lib-k8s",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js", "module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish" "pub": "npm publish"
}, },
"dependencies": { "dependencies": {
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@kubernetes/client-node": "0.21.0" "@kubernetes/client-node": "0.21.0"
}, },
"devDependencies": { "devDependencies": {
@@ -32,5 +32,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+7
View File
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Performance Improvements
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/lib-server **Note:** Version bump only for package @certd/lib-server
+7 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/lib-server", "name": "@certd/lib-server",
"version": "1.38.2", "version": "1.38.3",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@@ -28,11 +28,11 @@
], ],
"license": "AGPL", "license": "AGPL",
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.38.2", "@certd/acme-client": "^1.38.3",
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@certd/pipeline": "^1.38.2", "@certd/pipeline": "^1.38.3",
"@certd/plugin-lib": "^1.38.2", "@certd/plugin-lib": "^1.38.3",
"@certd/plus-core": "^1.38.2", "@certd/plus-core": "^1.38.3",
"@midwayjs/cache": "3.14.0", "@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11", "@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13", "@midwayjs/i18n": "3.20.13",
@@ -64,5 +64,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
@@ -53,6 +53,8 @@ export class SysPublicSettings extends BaseSettings {
//默认到期前更新天数 //默认到期前更新天数
defaultCertRenewDays?: number; defaultCertRenewDays?: number;
// 即将到期天数
defaultWillExpireDays?: number = 15;
// 第三方OAuth配置 // 第三方OAuth配置
oauthEnabled?: boolean = false; oauthEnabled?: boolean = false;
@@ -255,3 +257,4 @@ export class SysSafeSetting extends BaseSettings {
autoHiddenTimes: 5, autoHiddenTimes: 5,
}; };
} }
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/midway-flyway-js **Note:** Version bump only for package @certd/midway-flyway-js
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/midway-flyway-js", "name": "@certd/midway-flyway-js",
"version": "1.38.2", "version": "1.38.3",
"description": "midway with flyway, sql upgrade way ", "description": "midway with flyway, sql upgrade way ",
"private": false, "private": false,
"type": "module", "type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11", "typeorm": "^0.3.11",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
**Note:** Version bump only for package @certd/plugin-cert **Note:** Version bump only for package @certd/plugin-cert
+6 -6
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-cert", "name": "@certd/plugin-cert",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch" "compile": "tsc --skipLibCheck --watch"
}, },
"dependencies": { "dependencies": {
"@certd/acme-client": "^1.38.2", "@certd/acme-client": "^1.38.3",
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@certd/pipeline": "^1.38.2", "@certd/pipeline": "^1.38.3",
"@certd/plugin-lib": "^1.38.2", "@certd/plugin-lib": "^1.38.3",
"psl": "^1.9.0", "psl": "^1.9.0",
"punycode.js": "^2.3.1" "punycode.js": "^2.3.1"
}, },
@@ -38,5 +38,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Performance Improvements
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
### Performance Improvements ### Performance Improvements
+6 -6
View File
@@ -1,7 +1,7 @@
{ {
"name": "@certd/plugin-lib", "name": "@certd/plugin-lib",
"private": false, "private": false,
"version": "1.38.2", "version": "1.38.3",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
@@ -22,10 +22,10 @@
"@alicloud/pop-core": "^1.7.10", "@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.11", "@alicloud/tea-util": "^1.4.11",
"@aws-sdk/client-s3": "^3.964.0", "@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.2", "@certd/acme-client": "^1.38.3",
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@certd/pipeline": "^1.38.2", "@certd/pipeline": "^1.38.3",
"@certd/plus-core": "^1.38.2", "@certd/plus-core": "^1.38.3",
"@kubernetes/client-node": "0.21.0", "@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5", "basic-ftp": "^5.0.5",
@@ -57,5 +57,5 @@
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
"gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2" "gitHead": "ee6cdfb391568ad8532701a2c37ee53e88e39f75"
} }
@@ -250,7 +250,7 @@ export class CertReader {
return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS"); return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS");
} }
static buildCertName(cert: any) { static buildCertName(cert: CertInfo) {
return new CertReader(cert).buildCertName(); return new CertReader(cert).buildCertName();
} }
} }
@@ -1,5 +1,5 @@
import { HttpClient, ILogger, utils } from "@certd/basic"; import { HttpClient, ILogger, utils } from "@certd/basic";
import { IAccess, IServiceGetter, Pager, PageRes, Registrable } from "@certd/pipeline"; import { IAccess, IServiceGetter, PageRes, PageSearch, Registrable } from "@certd/pipeline";
export type DnsProviderDefine = Registrable & { export type DnsProviderDefine = Registrable & {
accessType: string; accessType: string;
@@ -57,7 +57,7 @@ export interface IDnsProvider<T = any> {
//中文域名是否需要punycode转码,如果返回True,则使用punycode来添加解析记录,否则使用中文域名添加解析记录 //中文域名是否需要punycode转码,如果返回True,则使用punycode来添加解析记录,否则使用中文域名添加解析记录
usePunyCode(): boolean; usePunyCode(): boolean;
getDomainListPage(pager: Pager): Promise<PageRes<DomainRecord>>; getDomainListPage(pager: PageSearch): Promise<PageRes<DomainRecord>>;
} }
export interface ISubDomainsGetter { export interface ISubDomainsGetter {
@@ -1,8 +1,8 @@
import { Pager, PageRes } from "@certd/pipeline"; import { HttpClient, ILogger } from "@certd/basic";
import { PageRes, PageSearch } from "@certd/pipeline";
import punycode from "punycode.js";
import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, DomainRecord, IDnsProvider, RemoveRecordOptions } from "./api.js"; import { CreateRecordOptions, DnsProviderContext, DnsProviderDefine, DomainRecord, IDnsProvider, RemoveRecordOptions } from "./api.js";
import { dnsProviderRegistry } from "./registry.js"; import { dnsProviderRegistry } from "./registry.js";
import { HttpClient, ILogger } from "@certd/basic";
import punycode from "punycode.js";
export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> { export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
ctx!: DnsProviderContext; ctx!: DnsProviderContext;
http!: HttpClient; http!: HttpClient;
@@ -46,7 +46,7 @@ export abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
abstract removeRecord(options: RemoveRecordOptions<T>): Promise<void>; abstract removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
async getDomainListPage(pager: Pager): Promise<PageRes<DomainRecord>> { async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
throw new Error("Method not implemented."); throw new Error("Method not implemented.");
} }
} }
+15
View File
@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Performance Improvements
* 首次使用提示新手教程按钮 ([e054c8f](https://github.com/certd/certd/commit/e054c8fc55063fd96548f1c19049070524a63411))
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
* 优化首页图标 ([998de0f](https://github.com/certd/certd/commit/998de0f9a031339b019aa7a09e61e994664a8047))
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
* 站点监控,检查状态挪到前面显示 ([48f1bf0](https://github.com/certd/certd/commit/48f1bf091869b87dd17feaca5efd8680ef741582))
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
* ucloud支持部署到ulbalb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
### Bug Fixes ### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-client", "name": "@certd/ui-client",
"version": "1.38.2", "version": "1.38.3",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --open", "dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3" "zod-defaults": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@certd/lib-iframe": "^1.38.2", "@certd/lib-iframe": "^1.38.3",
"@certd/pipeline": "^1.38.2", "@certd/pipeline": "^1.38.3",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12", "@types/chai": "^4.3.12",
@@ -0,0 +1,97 @@
<template>
<div class="cf-turnstile">
<div id="turnstile-container" class="cf-turnstile-container" :data-sitekey="siteKeyRef"></div>
</div>
</template>
<script setup lang="ts">
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
import { loadScript } from "vue-plugin-load-script";
const loaded = ref(false);
async function loadCaptchaScript() {
await loadScript("https://challenges.cloudflare.com/turnstile/v0/api.js");
loaded.value = true;
}
defineOptions({
name: "CfTurnstileCaptcha",
});
const emit = defineEmits(["update:modelValue", "change"]);
const props = defineProps<{
modelValue: any;
captchaGet: () => Promise<any>;
}>();
const captchaRef = ref(null);
const siteKeyRef = ref("");
const widgetIdRef = ref(null);
onMounted(async () => {
await loadCaptchaScript();
await nextTick();
const { siteKey } = await props.captchaGet();
siteKeyRef.value = siteKey; //string
//@ts-ignore
const widgetId = turnstile.render("#turnstile-container", {
sitekey: siteKey,
size: "flexible",
callback: function (token: string) {
console.log("turnstile success:", token);
emitChange({
token: token,
});
},
});
widgetIdRef.value = widgetId;
});
onUnmounted(() => {
//@ts-ignore
if (turnstile && widgetIdRef.value) {
//@ts-ignore
turnstile.remove(widgetIdRef.value);
}
});
function checkExpired() {
//@ts-ignore
if (turnstile && widgetIdRef.value) {
//@ts-ignore
return turnstile.isExpired(widgetIdRef.value);
}
}
function emitChange(value: any) {
emit("update:modelValue", value);
emit("change", value);
}
function reset() {
//
//@ts-ignore
if (turnstile && widgetIdRef.value) {
//@ts-ignore
turnstile.reset(widgetIdRef.value);
}
}
watch(
() => {
return props.modelValue;
},
value => {
if (value == null) {
reset();
}
}
);
defineExpose({
reset,
});
</script>
<style lang="less">
.cf-turnstile-container {
iframe {
width: 100% !important;
}
}
</style>
@@ -11,8 +11,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineEmits, defineExpose, defineProps, ref, watch } from "vue"; import { ref, watch } from "vue";
import { nanoid } from "nanoid";
const props = defineProps<{ const props = defineProps<{
modelValue: any; modelValue: any;
@@ -11,8 +11,8 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, defineProps, defineEmits, ref, onUnmounted, Ref, watch } from "vue";
import { notification } from "ant-design-vue"; import { notification } from "ant-design-vue";
import { ref, Ref, watch } from "vue";
import { loadScript } from "vue-plugin-load-script"; import { loadScript } from "vue-plugin-load-script";
const loaded = ref(false); const loaded = ref(false);
@@ -39,6 +39,7 @@ import { dict } from "@fast-crud/fast-crud";
import * as api from "./api.js"; import * as api from "./api.js";
import CnameTip from "./cname-tip.vue"; import CnameTip from "./cname-tip.vue";
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import { utils } from "/@/utils/index.js";
const statusDict = dict({ const statusDict = dict({
data: [ data: [
{ label: "待设置CNAME", value: "cname", color: "warning" }, { label: "待设置CNAME", value: "cname", color: "warning" },
@@ -0,0 +1,209 @@
<template>
<div class="domain-select">
<div class="flex flex-row">
<a-select
class="domain-select-input"
:dropdown-style="dropdownStyle"
show-search
:filter-option="filterOption"
:options="optionsRef"
:value="value"
v-bind="attrs"
@click="onClick"
@update:value="emit('update:value', $event)"
>
<template #dropdownRender="{ menuNode }">
<template v-if="search">
<div class="flex w-full items-center justify-between flex-wrap" style="padding: 4px 8px">
<div class="flex-1 flex flex-row items-center">
<a-input ref="inputRef" v-model:value="searchKeyRef" class="flex-1" allow-clear placeholder="这里可以搜索域名(数据来自“设置->域名管理”),您也可以直接在上面输入框输入" @keydown.enter="doSearch" />
<fs-button type="primary" class="m-1" :loading="loading" icon="mingcute:search-2-line" @click="doSearch"> 查询 </fs-button>
</div>
<div class="manager flex flex-row items-center">
<fs-button type="primary" class="m-1" icon="mingcute:vip-1-line" @click="openDomainImportDialog">导入域名</fs-button>
<fs-button class="m-1" type="primary" icon="carbon:gui-management" @click="openDomainManager">管理域名</fs-button>
</div>
</div>
<div v-if="hasError" class="helper p-2" :class="{ error: hasError }">
{{ message }}
</div>
<a-divider style="margin: 4px 0" />
</template>
<v-nodes :vnodes="menuNode" />
<div v-if="pager === true" class="pager text-center p-5" @click="paginationClick">
<a-pagination v-model:current="pagerRef.pageNo" simple :total="pagerRef.total" :page-size="pagerRef.pageSize" @change="onPageChange" />
</div>
</template>
<template #option="scope">
<div class="flex flex-row items-center">
<span class="min-w-60">{{ scope.label }}</span>
<div>
<fs-values-format :model-value="scope.challengeType" :dict="challengeTypeDict"></fs-values-format>
<fs-values-format :model-value="scope.dnsProviderType" :dict="dnsProviderTypeDict"></fs-values-format>
</div>
</div>
</template>
</a-select>
<div class="ml-5">
<fs-button :loading="loading" title="刷新我的域名列表" icon="ion:refresh-outline" @click="refreshOptions"></fs-button>
</div>
</div>
<div class="helper" :class="{ error: hasError }">
{{ message }}
</div>
</div>
</template>
<script setup lang="ts">
import { computed, defineComponent, ref, Ref, useAttrs } from "vue";
import { request } from "/@/api/service";
import { Dicts } from "../lib/dicts";
import { useRouter } from "vue-router";
import { useDomainImport, useDomainImportManage } from "/@/views/certd/cert/domain/use";
defineOptions({
name: "DomainSelector",
});
const VNodes = defineComponent({
props: {
vnodes: {
type: Object,
required: true,
},
},
render() {
return this.vnodes;
},
});
const props = defineProps<{
search?: boolean;
pager?: boolean;
value?: any[];
}>();
const emit = defineEmits<{
"update:value": any;
}>();
const attrs = useAttrs();
const searchKeyRef = ref("");
const optionsRef = ref([]);
const message = ref("");
const hasError = ref(false);
const loading = ref(false);
const pagerRef: Ref = ref({
pageNo: 1,
total: 0,
pageSize: 20,
});
const getOptions = async () => {
if (loading.value) {
return;
}
message.value = "";
hasError.value = false;
loading.value = true;
const pageNo = pagerRef.value.pageNo;
const pageSize = pagerRef.value.pageSize;
try {
const res = await request({
url: "/cert/domain/page",
method: "POST",
data: {
query: {
domain: props.search ? searchKeyRef.value : undefined,
},
page: {
offset: (pageNo - 1) * pageSize,
limit: pageSize,
},
},
});
const list = res?.records || res || [];
const options = [];
for (let item of list) {
options.push({
value: item.domain,
label: item.domain,
dnsProviderType: item.dnsProviderType,
challengeType: item.challengeType,
});
options.push({
value: `*.${item.domain}`,
label: `*.${item.domain}`,
dnsProviderType: item.dnsProviderType,
challengeType: item.challengeType,
});
}
optionsRef.value = options;
pagerRef.value.total = list.length;
if (props.pager) {
if (res.total != null) {
pagerRef.value.total = res.total;
}
}
return res;
} finally {
loading.value = false;
}
};
const filterOption = (input: string, option: any) => {
return option.label.toLowerCase().includes(input.toLowerCase()) || String(option.value).toLowerCase().includes(input.toLowerCase());
};
async function onClick() {
if (optionsRef.value?.length === 0) {
await refreshOptions();
}
}
async function refreshOptions() {
await getOptions();
}
async function doSearch() {
pagerRef.value.pageNo = 1;
await refreshOptions();
}
async function onPageChange(current: any) {
await refreshOptions();
}
async function paginationClick(e: any) {
e.stopPropagation();
e.preventDefault();
}
const dnsProviderTypeDict = Dicts.dnsProviderTypeDict;
const challengeTypeDict = Dicts.challengeTypeDict;
const router = useRouter();
function openDomainManager(e: any) {
e.preventDefault();
// router.push("/certd/cert/domain");
window.open(`${window.location.origin}/#/certd/cert/domain`);
}
const openDomainImportManageDialog = useDomainImportManage();
function openDomainImportDialog() {
openDomainImportManageDialog({
afterSubmit: res => {
refreshOptions();
},
});
}
const dropdownStyle = ref({
zIndex: 2000,
});
</script>
<style lang="less"></style>
@@ -85,7 +85,9 @@ const message = ref("");
const hasError = ref(false); const hasError = ref(false);
const loading = ref(false); const loading = ref(false);
const pagerRef: Ref = ref({ const pagerRef: Ref = ref({
current: 1, pageNo: 1,
total: 0,
pageSize: 100,
}); });
const getOptions = async () => { const getOptions = async () => {
if (loading.value) { if (loading.value) {
@@ -143,12 +145,18 @@ const getOptions = async () => {
showErrorNotify: false, showErrorNotify: false,
} }
); );
const list = res?.list || res || []; let list = res?.list || res || [];
if (list.length > 0) { if (list.length > 0) {
message.value = "获取数据成功,请从下拉框中选择"; message.value = "获取数据成功,请从下拉框中选择";
} else { } else {
message.value = "获取数据成功,没有数据"; message.value = "获取数据成功,没有数据";
} }
list = list.map((item: any) => {
return {
...item,
title: `${item.domain || item.value}`,
};
});
optionsRef.value = list; optionsRef.value = list;
pagerRef.value.total = list.length; pagerRef.value.total = list.length;
if (props.pager) { if (props.pager) {
@@ -4,6 +4,7 @@ import RemoteSelect from "./common/remote-select.vue";
import RemoteInput from "./common/remote-input.vue"; import RemoteInput from "./common/remote-input.vue";
import RemoteTreeSelect from "./common/remote-tree-select.vue"; import RemoteTreeSelect from "./common/remote-tree-select.vue";
import CertDomainsGetter from "./common/cert-domains-getter.vue"; import CertDomainsGetter from "./common/cert-domains-getter.vue";
import DomainSelector from "./common/domain-selector.vue";
import OutputSelector from "/@/components/plugins/common/output-selector/index.vue"; import OutputSelector from "/@/components/plugins/common/output-selector/index.vue";
import DnsProviderSelector from "/@/components/plugins/cert/dns-provider-selector/index.vue"; import DnsProviderSelector from "/@/components/plugins/cert/dns-provider-selector/index.vue";
import DomainsVerifyPlanEditor from "/@/components/plugins/cert/domains-verify-plan-editor/index.vue"; import DomainsVerifyPlanEditor from "/@/components/plugins/cert/domains-verify-plan-editor/index.vue";
@@ -29,6 +30,7 @@ export default {
app.component("RemoteTreeSelect", RemoteTreeSelect); app.component("RemoteTreeSelect", RemoteTreeSelect);
app.component("RemoteInput", RemoteInput); app.component("RemoteInput", RemoteInput);
app.component("CertDomainsGetter", CertDomainsGetter); app.component("CertDomainsGetter", CertDomainsGetter);
app.component("DomainSelector", DomainSelector);
app.component("InputPassword", InputPassword); app.component("InputPassword", InputPassword);
app.component("ParamsShow", ParamsShow); app.component("ParamsShow", ParamsShow);
}, },
@@ -10,7 +10,7 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { defineProps, inject, ref, useAttrs } from "vue"; import { inject, ref, useAttrs } from "vue";
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib"; import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
@@ -1,6 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { onMounted, ref } from "vue";
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue"; import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
import { mitter } from "/@/utils/util.mitt";
import { useI18n } from "/@/locales";
defineOptions({ defineOptions({
name: "TutorialModal", name: "TutorialModal",
@@ -8,6 +10,7 @@ defineOptions({
const props = defineProps<{ const props = defineProps<{
showIcon?: boolean; showIcon?: boolean;
mode?: string;
}>(); }>();
const openedRef = ref(false); const openedRef = ref(false);
@@ -15,17 +18,26 @@ function open() {
openedRef.value = true; openedRef.value = true;
} }
const slots = defineSlots(); const slots = defineSlots();
onMounted(() => {
mitter.on("openTutorialModal", () => {
if (props.mode === "nav") {
open();
}
});
});
const { t } = useI18n();
</script> </script>
<template> <template>
<div class="tutorial-button pointer" @click="open"> <div class="tutorial-button pointer" @click="open">
<template v-if="!slots.default"> <template v-if="!slots.default">
<fs-icon v-if="showIcon === false" icon="ant-design:question-circle-outlined" class="mr-0.5"></fs-icon> <fs-icon v-if="showIcon === false" icon="ant-design:question-circle-outlined" class="mr-0.5"></fs-icon>
<div class="hidden md:block">{{ $t("tutorial.title") }}</div> <div class="hidden md:block">{{ t("tutorial.title") }}</div>
</template> </template>
<slot></slot> <slot></slot>
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%"> <a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
<template #title>{{ $t("tutorial.title") }}</template> <template #title>{{ t("tutorial.title") }}</template>
<tutorial-steps v-if="openedRef" /> <tutorial-steps v-if="openedRef" />
<template #footer></template> <template #footer></template>
</a-modal> </a-modal>
@@ -1,8 +1,8 @@
<template> <template>
<a-steps :current="3" class="mt-10" size="small" :items="steps" @click="goPipeline"></a-steps> <a-steps :current="3" class="mt-10 simple-steps" size="small" :items="steps" @click="goPipeline"></a-steps>
</template> </template>
<script lang="ts" setup> <script lang="tsx" setup>
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@@ -11,14 +11,26 @@ const { t } = useI18n();
type Step = { type Step = {
title: string; title: string;
description?: string; description?: string;
icon?: any;
}; };
import { ref } from "vue"; import { ref } from "vue";
import { mitter } from "/@/utils/util.mitt";
const steps = ref<Step[]>([{ title: t("certd.steps.createPipeline") }, { title: t("certd.steps.addTask") }, { title: t("certd.steps.scheduledRun") }]); const steps = ref<Step[]>([
{ title: t("certd.steps.createPipeline"), icon: <fs-icon icon="tabler:circle-number-1-filled"></fs-icon> },
{ title: t("certd.steps.addTask"), icon: <fs-icon icon="tabler:circle-number-2-filled"></fs-icon> },
{ title: t("certd.steps.scheduledRun"), icon: <fs-icon icon="tabler:circle-number-3-filled"></fs-icon> },
]);
const router = useRouter();
function goPipeline() { function goPipeline() {
router.push({ path: "/certd/pipeline" }); mitter.emit("openTutorialModal");
} }
</script> </script>
<style lang="less">
.simple-steps {
.fs-icon {
font-size: 18px !important;
}
}
</style>
@@ -6,7 +6,7 @@
<div class="text"> <div class="text">
<h3 class="title">{{ number }} {{ currentStepItem.title }}</h3> <h3 class="title">{{ number }} {{ currentStepItem.title }}</h3>
<div class="description mt-5"> <div class="description mt-5">
<div v-for="desc of currentStepItem.descriptions">{{ desc }}</div> <div v-for="(desc, index) of currentStepItem.descriptions" :key="index">{{ desc }}</div>
</div> </div>
<div v-if="currentStepItem.body"> <div v-if="currentStepItem.body">
<fs-render :render-func="currentStepItem.body" /> <fs-render :render-func="currentStepItem.body" />
@@ -29,9 +29,12 @@
<script setup lang="tsx"> <script setup lang="tsx">
import { FsRender } from "@fast-crud/fast-crud"; import { FsRender } from "@fast-crud/fast-crud";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
const { t } = useI18n();
import SimpleSteps from "./simple-steps.vue"; import SimpleSteps from "./simple-steps.vue";
const props = defineProps<{
mode?: string;
}>();
const { t } = useI18n();
type Step = { type Step = {
title: string; title: string;
subTitle?: string; subTitle?: string;
@@ -69,10 +72,10 @@ const steps = ref<Step[]>([
title: t("guide.createCertPipeline.items.successTitle"), title: t("guide.createCertPipeline.items.successTitle"),
descriptions: [t("guide.createCertPipeline.items.successDesc")], descriptions: [t("guide.createCertPipeline.items.successDesc")],
}, },
{ // {
title: t("guide.createCertPipeline.items.nextTitle"), // title: t("guide.createCertPipeline.items.nextTitle"),
descriptions: [t("guide.createCertPipeline.items.nextDesc")], // descriptions: [t("guide.createCertPipeline.items.nextDesc")],
}, // },
], ],
}, },
{ {
@@ -252,7 +255,7 @@ function previewMask() {
flex: 1; flex: 1;
padding: 20px; padding: 20px;
.text { .text {
width: 350px; width: 400px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@@ -12,16 +12,16 @@
</div> </div>
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { computed, onMounted, reactive, ref } from "vue";
import dayjs from "dayjs";
import { message, Modal } from "ant-design-vue"; import { message, Modal } from "ant-design-vue";
import dayjs from "dayjs";
import { computed, onMounted, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import * as api from "./api"; import * as api from "./api";
import { useSettingStore } from "/@/store/settings"; import { useSettingStore } from "/@/store/settings";
import { useRouter } from "vue-router";
import { useUserStore } from "/@/store/user"; import { useUserStore } from "/@/store/user";
import { mitter } from "/@/utils/util.mitt";
import { useI18n } from "vue-i18n";
import { env } from "/@/utils/util.env"; import { env } from "/@/utils/util.env";
import { mitter } from "/@/utils/util.mitt";
const { t } = useI18n(); const { t } = useI18n();
const settingStore = useSettingStore(); const settingStore = useSettingStore();
@@ -445,6 +445,11 @@ function openUpgrade() {
<div class="vip-type-vs"> <div class="vip-type-vs">
<a-row gutter={20}>{slots}</a-row> <a-row gutter={20}>{slots}</a-row>
</div> </div>
<div>
<a href="https://certd.docmirror.cn/guide/donate/#相关问题" target="_blank">
{t("vip.question")}
</a>
</div>
<div class="mt-10"> <div class="mt-10">
<div class=" w-100 flex-col md:flex-row "> <div class=" w-100 flex-col md:flex-row ">
<span>{t("vip.site_id")}</span> <span>{t("vip.site_id")}</span>
@@ -3,7 +3,7 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { ref, watch, defineOptions } from "vue"; import { ref, watch } from "vue";
import { routerUtils } from "/@/utils/util.router"; import { routerUtils } from "/@/utils/util.router";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { utils } from "@fast-crud/fast-crud"; import { utils } from "@fast-crud/fast-crud";
@@ -83,7 +83,7 @@ provide("fn:ai.open", openChat);
</template> </template>
<template #header-right-0> <template #header-right-0>
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block"> <div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
<tutorial-button class="flex-center header-btn" /> <tutorial-button class="flex-center header-btn" mode="nav" />
</div> </div>
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full"> <div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
<vip-button class="flex-center header-btn" mode="nav" /> <vip-button class="flex-center header-btn" mode="nav" />
@@ -19,6 +19,7 @@ export default {
legoCertPipeline: "Lego Certificate Pipeline", legoCertPipeline: "Lego Certificate Pipeline",
customPipeline: "Custom Pipeline", customPipeline: "Custom Pipeline",
batchAddPipeline: "Add Pipeline Use Template", batchAddPipeline: "Add Pipeline Use Template",
myPipelinesDesc: "Pipeline Mode: Apply -> Deploy -> Schedule",
}, },
order: { order: {
confirmTitle: "Order Confirmation", confirmTitle: "Order Confirmation",
@@ -88,6 +89,14 @@ export default {
helpDoc: "Help Docs", helpDoc: "Help Docs",
pipelineCount: "Number of Certificate Pipelines", pipelineCount: "Number of Certificate Pipelines",
noPipeline: "You have no certificate pipelines yet", noPipeline: "You have no certificate pipelines yet",
enabledCount: "Enabled",
disabledCount: "Disabled",
certCount: "Number of Certificates",
noCert: "You have no certificates yet",
manageCert: "View Certificates",
certExpiringCount: "Soon-to-Expire",
certExpiredCount: "Expired",
certNoExpireCount: "Not Expired",
createNow: "Create Now", createNow: "Create Now",
managePipeline: "Manage Pipelines", managePipeline: "Manage Pipelines",
pipelineStatus: "Pipeline Status", pipelineStatus: "Pipeline Status",
@@ -321,6 +330,11 @@ export default {
certValidDays: "Certificate Valid Days", certValidDays: "Certificate Valid Days",
certValidDaysHelper: "Number of days before expiration to send a notification", certValidDaysHelper: "Number of days before expiration to send a notification",
}, },
cert: {
expired: "Expired",
expiring: "Expiring",
noExpired: "Not Expired",
},
}, },
checkStatus: { checkStatus: {
success: "Success", success: "Success",
@@ -3,9 +3,9 @@ export default {
title: "Create Certificate Application Pipeline", title: "Create Certificate Application Pipeline",
description: "Demonstrate how to configure a certificate application task", description: "Demonstrate how to configure a certificate application task",
items: { items: {
tutorialTitle: "Tutorial Demo Content", tutorialTitle: "This tutorial demonstrates how to automatically apply for a certificate and deploy it to Nginx",
tutorialDesc1: "This tutorial demonstrates how to automatically apply for a certificate and deploy it to Nginx", tutorialDesc1: "Only 3 steps, fully automatic application and deployment",
tutorialDesc2: "Only 3 steps, fully automatic application and deployment", tutorialDesc2: "",
createTitle: "Create Certificate Pipeline", createTitle: "Create Certificate Pipeline",
createDesc: "Click to add a certificate pipeline and fill in the certificate application information", createDesc: "Click to add a certificate pipeline and fill in the certificate application information",
successTitle: "Pipeline Created Successfully", successTitle: "Pipeline Created Successfully",
@@ -100,4 +100,5 @@ export default {
confirm: "Confirm", confirm: "Confirm",
not_effective: "Not effective or duration not sync?", not_effective: "Not effective or duration not sync?",
learn_more: "More privileges", learn_more: "More privileges",
question: "More VIP related questions",
}; };
@@ -23,6 +23,7 @@ export default {
legoCertPipeline: "Lego证书流水线", legoCertPipeline: "Lego证书流水线",
customPipeline: "自定义流水线", customPipeline: "自定义流水线",
batchAddPipeline: "模版批量创建流水线", batchAddPipeline: "模版批量创建流水线",
myPipelinesDesc: "流水线模式:申请证书->部署证书->定时运行",
}, },
order: { order: {
confirmTitle: "订单确认", confirmTitle: "订单确认",
@@ -93,7 +94,16 @@ export default {
alertMessage: "证书和授权为敏感信息,不要使用来历不明的在线Certd服务和镜像,以免泄露;请务必私有化部署使用,认准官方版本发布渠道:", alertMessage: "证书和授权为敏感信息,不要使用来历不明的在线Certd服务和镜像,以免泄露;请务必私有化部署使用,认准官方版本发布渠道:",
helpDoc: "帮助文档", helpDoc: "帮助文档",
pipelineCount: "证书流水线数量", pipelineCount: "证书流水线数量",
enabledCount: "已启用",
disabledCount: "已禁用",
noPipeline: "您还没有证书流水线", noPipeline: "您还没有证书流水线",
certCount: "证书数量",
certExpiringCount: "即将过期",
certExpiredCount: "已过期",
certNoExpireCount: "未过期",
noCert: "还没有证书",
manageCert: "查看证书",
createNow: "立即创建", createNow: "立即创建",
managePipeline: "管理流水线", managePipeline: "管理流水线",
pipelineStatus: "流水线状态", pipelineStatus: "流水线状态",
@@ -327,6 +337,12 @@ export default {
certValidDays: "证书到期前天数", certValidDays: "证书到期前天数",
certValidDaysHelper: "证书到期前多少天发送通知", certValidDaysHelper: "证书到期前多少天发送通知",
}, },
cert: {
expired: "已过期",
expiring: "即将过期",
noExpired: "未过期",
},
}, },
checkStatus: { checkStatus: {
success: "成功", success: "成功",
@@ -3,9 +3,9 @@ export default {
title: "创建证书申请流水线", title: "创建证书申请流水线",
description: "演示证书申请任务如何配置", description: "演示证书申请任务如何配置",
items: { items: {
tutorialTitle: "教程演示内容", tutorialTitle: "教程演示如何自动申请证书并部署到Nginx上",
tutorialDesc1: "本教程演示如何自动申请证书并部署到Nginx上", tutorialDesc1: "仅需3步,全自动申请部署证书",
tutorialDesc2: "仅需3步,全自动申请部署证书", tutorialDesc2: "",
createTitle: "创建证书流水线", createTitle: "创建证书流水线",
createDesc: "点击添加证书流水线,填写证书申请信息", createDesc: "点击添加证书流水线,填写证书申请信息",
successTitle: "流水线创建成功", successTitle: "流水线创建成功",
@@ -99,4 +99,5 @@ export default {
confirm: "确认", confirm: "确认",
not_effective: "VIP没有生效/时长未同步?", not_effective: "VIP没有生效/时长未同步?",
learn_more: "更多特权(加VIP群等)", learn_more: "更多特权(加VIP群等)",
question: "更多VIP相关问题",
}; };
@@ -57,6 +57,8 @@ export type SysPublicSetting = {
// 默认到期前更新天数 // 默认到期前更新天数
defaultCertRenewDays?: number; defaultCertRenewDays?: number;
// 默认即将到期天数
defaultWillExpireDays?: number;
//证书域名添加到监控 //证书域名添加到监控
certDomainAddToMonitorEnabled?: boolean; certDomainAddToMonitorEnabled?: boolean;
+148 -6
View File
@@ -19,8 +19,8 @@ div#app {
height: 100%; height: 100%;
} }
pre.pre{ pre.pre {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
} }
h1, h1,
@@ -61,16 +61,20 @@ h6 {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.flex-vc { .flex-vc {
align-items: center; align-items: center;
} }
.flex-vb { .flex-vb {
align-items: baseline; align-items: baseline;
} }
.flex-o { .flex-o {
display: flex !important; display: flex !important;
align-items: center; align-items: center;
} }
.flex-baseline { .flex-baseline {
display: flex !important; display: flex !important;
align-items: baseline; align-items: baseline;
@@ -82,9 +86,15 @@ h6 {
align-items: baseline; align-items: baseline;
} }
.flex-evenly {
display: flex;
justify-content: space-evenly;
}
.flex { .flex {
display: flex; display: flex;
} }
.flex-inline { .flex-inline {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -93,6 +103,7 @@ h6 {
.flex-1 { .flex-1 {
flex: 1; flex: 1;
} }
.flex-0 { .flex-0 {
flex: 0; flex: 0;
} }
@@ -101,9 +112,11 @@ h6 {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.align-left { .align-left {
text-align: left; text-align: left;
} }
.align-right { .align-right {
text-align: right; text-align: right;
} }
@@ -111,18 +124,23 @@ h6 {
.scroll-y { .scroll-y {
overflow-y: auto; overflow-y: auto;
} }
.m-0 { .m-0 {
margin: 0 !important; margin: 0 !important;
} }
.m-2 { .m-2 {
margin: 2px !important; margin: 2px !important;
} }
.m-3 { .m-3 {
margin: 3px !important; margin: 3px !important;
} }
.m-5 { .m-5 {
margin: 5px !important; margin: 5px !important;
} }
.m-10 { .m-10 {
margin: 10px !important; margin: 10px !important;
} }
@@ -130,6 +148,7 @@ h6 {
.m-20 { .m-20 {
margin: 20px !important; margin: 20px !important;
} }
.mb-2 { .mb-2 {
margin-bottom: 2px !important; margin-bottom: 2px !important;
} }
@@ -137,6 +156,7 @@ h6 {
.mb-5 { .mb-5 {
margin-bottom: 5px !important; margin-bottom: 5px !important;
} }
.ml-5 { .ml-5 {
margin-left: 5px !important; margin-left: 5px !important;
} }
@@ -192,6 +212,7 @@ h6 {
.p-20 { .p-20 {
padding: 20px !important; padding: 20px !important;
} }
.ellipsis { .ellipsis {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -220,6 +241,7 @@ h6 {
.color-plus { .color-plus {
color: #c5913f; color: #c5913f;
} }
.color-blue { .color-blue {
color: #1890ff; color: #1890ff;
} }
@@ -231,6 +253,7 @@ h6 {
.color-green { .color-green {
color: green; color: green;
} }
.color-gray { .color-gray {
color: gray; color: gray;
} }
@@ -274,6 +297,7 @@ h6 {
font-size: 12px; font-size: 12px;
margin-top: 3px; margin-top: 3px;
margin-bottom: 3px; margin-bottom: 3px;
&.error { &.error {
color: #ff4d4f; color: #ff4d4f;
} }
@@ -281,6 +305,7 @@ h6 {
.fs-copyable { .fs-copyable {
display: inline-flex; display: inline-flex;
.text { .text {
flex: 1; flex: 1;
} }
@@ -292,7 +317,11 @@ h6 {
} }
.fs-16 { .fs-16 {
font-size: 16px; font-size: 16px !important;
}
.fs-28 {
font-size: 28px !important;
} }
.w-50\% { .w-50\% {
@@ -309,14 +338,127 @@ h6 {
color: #6e6e6e; color: #6e6e6e;
} }
.ant-modal-body{ .ant-modal-body {
.fs-form-body{ .fs-form-body {
max-height: 66vh; max-height: 66vh;
overflow-y: auto; overflow-y: auto;
} }
} }
.ant-input-number{ .ant-input-number {
min-width: 100px; min-width: 100px;
}
.cd-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
overflow: auto;
.fs-loading {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.05);
z-index: 10000
}
table {
width: 1000px;
min-width: 100%;
table-layout: fixed;
font-size: 16px;
}
thead {
position: sticky;
top: 0;
z-index: 100;
}
.position-sticky-right {
position: sticky;
right: 0;
z-index: 100;
border-left: 0px;
&::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 1px;
/* 边框宽度 */
background: #eee;
/* 边框颜色 */
}
}
th,
td {
text-align: left;
border-bottom: 1px solid #eee;
border-left: 1px solid #eee;
}
th {
padding: 10px 5px;
background: #fbfbfb;
font-weight: 600;
color: #000000;
font-size: 14px;
border-top: 1px solid #eee;
&:last-child {
border-right: 1px solid #eee;
}
}
td {
padding: 10px;
font-size: 14px;
&:last-child {
border-right: 1px solid #eee;
}
}
td.position-sticky-right {
background-color: #fff;
}
tr.hover-color:hover td {
background: #f9f9ff;
}
.status {
padding: 5px 10px;
border-radius: 20px;
font-size: 0.8rem;
font-weight: 600;
}
.status-active {
background: #e7f6e9;
color: #2e7d32;
}
.status-pending {
background: #ffecb3;
color: #f57c00;
}
}
.ant-tag{
.fs-icon{
margin-right: 5px;
}
} }
@@ -2,8 +2,11 @@ import { useFormWrapper } from "@fast-crud/fast-crud";
export type FormOptionReq = { export type FormOptionReq = {
title: string; title: string;
columns: any; columns?: any;
onSubmit?: any; onSubmit?: any;
body?: any;
initialForm?: any;
zIndex?: number;
}; };
export function useFormDialog() { export function useFormDialog() {
@@ -15,9 +18,14 @@ export function useFormDialog() {
crudOptions: { crudOptions: {
columns: req.columns, columns: req.columns,
form: { form: {
initialForm: req.initialForm,
wrapper: { wrapper: {
zIndex: req.zIndex,
title: req.title, title: req.title,
saveRemind: false, saveRemind: false,
slots: {
"form-body-top": req.body,
},
}, },
async afterSubmit() {}, async afterSubmit() {},
async doSubmit({ form }: any) { async doSubmit({ form }: any) {
@@ -58,17 +58,44 @@ export async function DeleteBatch(ids: any[]) {
}); });
} }
export async function SyncSubmit(body: any) { export async function ImportTaskSave(body: any) {
return await request({ return await request({
url: apiPrefix + "/sync/import", url: apiPrefix + "/import/save",
method: "post", method: "post",
data: body, data: body,
}); });
} }
export async function ImportTaskStatus() {
export async function SyncDomainsExpiration() {
return await request({ return await request({
url: apiPrefix + "/sync/expiration", url: apiPrefix + "/import/status",
method: "post",
});
}
export async function ImportTaskDelete(key: string) {
return await request({
url: apiPrefix + "/import/delete",
method: "post",
data: { key },
});
}
export async function ImportTaskStart(key: string) {
return await request({
url: apiPrefix + "/import/start",
method: "post",
data: { key },
});
}
export async function SyncExpirationStart() {
return await request({
url: apiPrefix + "/sync/expiration/start",
method: "post",
});
}
export async function SyncExpirationStatus() {
return await request({
url: apiPrefix + "/sync/expiration/status",
method: "post", method: "post",
}); });
} }
@@ -1,15 +1,14 @@
import * as api from "./api"; import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { useI18n } from "/src/locales"; import { Modal, notification } from "ant-design-vue";
import { Ref, ref } from "vue"; import { Ref, ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud"; import * as api from "./api";
import { useUserStore } from "/@/store/user"; import { useDomainImportManage } from "./use";
import { useSettingStore } from "/@/store/settings";
import { Dicts } from "/@/components/plugins/lib/dicts"; import { Dicts } from "/@/components/plugins/lib/dicts";
import { useSettingStore } from "/@/store/settings";
import { useUserStore } from "/@/store/user";
import { createAccessApi } from "/@/views/certd/access/api"; import { createAccessApi } from "/@/views/certd/access/api";
import { Modal, notification } from "ant-design-vue"; import { useI18n } from "/src/locales";
import { useDomainImport } from "./use";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet { export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
@@ -51,7 +50,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
url: "pi/dnsProvider/dnsProviderTypeDict", url: "pi/dnsProvider/dnsProviderTypeDict",
}); });
const openDomainImportDialog = useDomainImport(); const openDomainImportManageDialog = useDomainImportManage();
return { return {
crudOptions: { crudOptions: {
settings: { settings: {
@@ -103,13 +102,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
needPlus: true, needPlus: true,
color: "gold", color: "gold",
icon: "mingcute:vip-1-line", icon: "mingcute:vip-1-line",
click: () => { click: async () => {
settingStore.checkPlus(); await openDomainImportManageDialog({
openDomainImportDialog({ afterSubmit: res => {
afterSubmit: () => { crudExpose.doRefresh();
setTimeout(() => {
crudExpose.doRefresh();
}, 2000);
}, },
}); });
}, },
@@ -120,7 +116,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
icon: "ion:refresh-outline", icon: "ion:refresh-outline",
text: "同步域名过期时间", text: "同步域名过期时间",
click: async () => { click: async () => {
await api.SyncDomainsExpiration(); await api.SyncExpirationStart();
notification.success({ notification.success({
message: "同步任务已提交", message: "同步任务已提交",
}); });
@@ -339,10 +335,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
title: t("certd.domain.fromType"), title: t("certd.domain.fromType"),
type: "dict-select", type: "dict-select",
dict: Dicts.domainFromTypeDict, dict: Dicts.domainFromTypeDict,
form: {
show: false,
},
column: { column: {
component: { component: {
color: "auto", color: "auto",
}, },
show: false,
}, },
}, },
disabled: { disabled: {
@@ -0,0 +1,137 @@
<template>
<div class="domain-import-task-status min-h-[300px]">
<div class="action mb-5">
<fs-button type="primary" icon="mingcute:vip-1-line" @click="addTask">添加导入任务</fs-button>
<fs-button type="primary" icon="ion:refresh-outline" class="ml-2" @click="loadImportTaskStatus">刷新</fs-button>
</div>
<div class="table-container overflow-auto mb-10">
<table class="cd-table border-gray-300 w-full">
<thead>
<tr>
<th class="w-[220px]">来源</th>
<th class="">进度</th>
<th class="w-[220px]">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="item in list" :key="item.key">
<td class="ellipsis">
<span class="flex items-center pointer" @click="editTask(item)">
<span class="flex-1 ellipsis flex items-center">
<fs-icon :icon="item.icon" class="mr-2"></fs-icon>
{{ item.title }}
</span>
<fs-icon icon="ant-design:edit-outlined" class="ml-2" />
</span>
</td>
<td>
<div v-if="item.task">
<div>
<a-tag color="blue">总数{{ item.task?.total }}</a-tag>
<a-tag color="success" class="ml-2">成功{{ item.task?.successCount }}</a-tag>
<a-tag type="info" class="ml-2">跳过{{ item.task?.skipCount }}</a-tag>
<a-tooltip v-if="item.task?.errors.length > 0">
<template #title>
<div v-for="error in item.task?.errors" :key="error">{{ error }}</div>
</template>
<a-tag color="red" class="ml-2">失败{{ item.task?.errors.length }}</a-tag>
</a-tooltip>
</div>
<a-progress :percent="item.task?.progress" size="small" status="active" />
</div>
<div v-else>未执行</div>
</td>
<td>
<fs-button type="primary" icon="ion:play-outline" :disabled="item.task?.status === 'running'" @click="startTask(item)">执行</fs-button>
<fs-button type="primary" class="ml-2" danger icon="ion:trash-outline" @click="deleteTask(item)">删除</fs-button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script setup lang="ts">
import { Modal } from "ant-design-vue";
import { onMounted, onUnmounted, ref } from "vue";
import * as api from "./api";
import { useDomainImport } from "./use";
import { useSettingStore } from "/@/store/settings";
defineOptions({
name: "DomainImportTaskStatus",
});
const list = ref([]);
async function loadImportTaskStatus() {
const res = await api.ImportTaskStatus();
list.value = res || [];
}
async function startTask(item: any) {
settingStore.checkPlus();
await api.ImportTaskStart(item.key);
await loadImportTaskStatus();
}
async function deleteTask(item: any) {
Modal.confirm({
title: "确认删除吗?",
okText: "确认",
okType: "danger",
onOk: async () => {
await api.ImportTaskDelete(item.key);
await loadImportTaskStatus();
},
});
}
const openDomainImportDialog = useDomainImport();
const settingStore = useSettingStore();
async function addTask() {
settingStore.checkPlus();
await openDomainImportDialog({
afterSubmit: async (res?: any) => {
if (res) {
await api.ImportTaskStart(res.key);
}
await loadImportTaskStatus();
},
});
}
async function editTask(item: any) {
settingStore.checkPlus();
await openDomainImportDialog({
afterSubmit: async () => {
await loadImportTaskStatus();
},
form: item,
});
}
const checkIntervalRef = ref();
onMounted(async () => {
await loadImportTaskStatus();
checkIntervalRef.value = setInterval(async () => {
await loadImportTaskStatus();
}, 3000);
});
onUnmounted(() => {
clearInterval(checkIntervalRef.value);
});
</script>
<style lang="less">
.domain-import-task-status {
.table-container {
height: 50vh;
}
.ant-progress {
margin-bottom: 0px;
}
}
</style>
@@ -2,7 +2,9 @@ import { message } from "ant-design-vue";
import * as api from "./api"; import * as api from "./api";
import { useFormDialog } from "/@/use/use-dialog"; import { useFormDialog } from "/@/use/use-dialog";
import { compute } from "@fast-crud/fast-crud"; import { compute } from "@fast-crud/fast-crud";
import { Dicts } from "/@/components/plugins/lib/dicts";
import { useSettingStore } from "/@/store/settings";
import DomainImportTaskStatus from "./import.vue";
export function useDomainImport() { export function useDomainImport() {
const { openFormDialog } = useFormDialog(); const { openFormDialog } = useFormDialog();
@@ -13,11 +15,11 @@ export function useDomainImport() {
form: { form: {
component: { component: {
name: "dns-provider-selector", name: "dns-provider-selector",
}, on: {
on: { //@ts-ignore
//@ts-ignore selectedChange: ({ form, $event }) => {
onSelectedChange: ({ form, $event }) => { form.dnsProviderAccessType = $event.accessType;
form.dnsProviderAccessType = $event.accessType; },
}, },
}, },
//@ts-ignore //@ts-ignore
@@ -48,18 +50,40 @@ export function useDomainImport() {
}, },
}; };
return function openDomainImportDialog(req: { afterSubmit?: () => void }) { return function openDomainImportDialog(req: { afterSubmit?: (res?: any) => void; form?: any }) {
openFormDialog({ openFormDialog({
title: "从域名提供商导入域名", title: "从域名提供商导入域名",
columns: columns, columns: columns,
initialForm: {
...req.form,
},
onSubmit: async (form: any) => { onSubmit: async (form: any) => {
await api.SyncSubmit({ const res = await api.ImportTaskSave({
key: form.key,
dnsProviderType: form.dnsProviderType, dnsProviderType: form.dnsProviderType,
dnsProviderAccessId: form.dnsProviderAccessId, dnsProviderAccessId: form.dnsProviderAccessId,
}); });
message.success("导入任务已提交");
if (req.afterSubmit) { if (req.afterSubmit) {
req.afterSubmit(); req.afterSubmit(res);
}
},
});
};
}
export function useDomainImportManage() {
const { openFormDialog } = useFormDialog();
const settingStore = useSettingStore();
return async function openDomainImportManageDialog(req: { afterSubmit?: (res?: any) => void; form?: any; zIndex?: number }) {
await openFormDialog({
title: "从域名提供商导入域名",
body: () => {
return <DomainImportTaskStatus />;
},
zIndex: req.zIndex,
onSubmit: async (form: any) => {
if (req.afterSubmit) {
req.afterSubmit(form);
} }
}, },
}); });
@@ -4,7 +4,7 @@ import { useI18n } from "/src/locales";
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, useFormWrapper, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud"; import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, useFormWrapper, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { certInfoApi } from "./api"; import { certInfoApi } from "./api";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useModal } from "/@/use/use-modal"; import { useModal } from "/@/use/use-modal";
import { notification } from "ant-design-vue"; import { notification } from "ant-design-vue";
import CertView from "/@/views/certd/pipeline/cert-view.vue"; import CertView from "/@/views/certd/pipeline/cert-view.vue";
@@ -57,7 +57,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}); });
}; };
const { openUploadCreateDialog, openUpdateCertDialog } = useCertUpload(); const { openUploadCreateDialog } = useCertUpload();
const DEFAULT_WILL_EXPIRE_DAYS = settingStore.sysPublic.defaultWillExpireDays || settingStore.sysPublic.defaultCertRenewDays || 15;
const route = useRoute();
const expireStatus = route?.query?.expireStatus as string;
const searchInitForm = {
expiresLeft: expireStatus,
};
return { return {
crudOptions: { crudOptions: {
request: { request: {
@@ -66,6 +73,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
editRequest, editRequest,
delRequest, delRequest,
}, },
search: {
initialForm: searchInitForm,
},
form: { form: {
labelCol: { labelCol: {
//固定label宽度 //固定label宽度
@@ -213,7 +223,17 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
expiresLeft: { expiresLeft: {
title: t("certd.validDays"), title: t("certd.validDays"),
search: { search: {
show: false, show: true,
component: {
name: "fs-dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.cert.expired"), value: "expired" },
{ label: t("certd.monitor.cert.expiring"), value: "expiring" },
{ label: t("certd.monitor.cert.noExpired"), value: "noExpired" },
],
}),
},
}, },
type: "date", type: "date",
form: { form: {
@@ -242,9 +262,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
// 距离失效时间剩余天数 // 距离失效时间剩余天数
const leftDays = dayjs(expiresTime).diff(dayjs(), "day"); const leftDays = dayjs(expiresTime).diff(dayjs(), "day");
const color = leftDays < 20 ? "red" : "#389e0d"; const color = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : "#389e0d";
const percent = (leftDays / effectiveDays) * 100; const percent = (leftDays / effectiveDays) * 100;
const textColor = leftDays < 20 ? "red" : leftDays > 60 ? "#389e0d" : ""; const textColor = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : leftDays > 60 ? "#389e0d" : "";
const format = () => { const format = () => {
return <span style={{ color: textColor }}>{`${leftDays}${t("certd.days")}`}</span>; return <span style={{ color: textColor }}>{`${leftDays}${t("certd.days")}`}</span>;
}; };
@@ -457,6 +457,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
align: "center", 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 (
<a-tooltip title={row.error}>
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
</a-tooltip>
);
},
},
},
certEffectiveTime: { certEffectiveTime: {
title: t("certd.monitor.certEffectiveTime"), title: t("certd.monitor.certEffectiveTime"),
search: { search: {
@@ -610,29 +633,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}, },
}, },
}, },
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 (
<a-tooltip title={row.error}>
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
</a-tooltip>
);
},
},
},
// error: { // error: {
// title: "错误信息", // title: "错误信息",
// search: { // search: {
@@ -167,8 +167,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: true, show: true,
}, },
type: "text", type: "text",
helper: t("certd.helperIpCname"),
form: { form: {
helper: t("certd.helperIpCname"),
rules: [{ required: true, message: t("certd.ruleIpRequired") }], rules: [{ required: true, message: t("certd.ruleIpRequired") }],
}, },
column: { column: {
@@ -115,6 +115,15 @@ export function useCertPipelineCreator() {
label: "name", label: "name",
}); });
const DEFAULT_RENEW_DAYS = settingStore.sysPublic.defaultCertRenewDays || settingStore.sysPublic.defaultWillExpireDays || 15;
merge(inputs, {
renewDays: {
form: {
value: DEFAULT_RENEW_DAYS,
},
},
});
return { return {
crudOptions: { crudOptions: {
form: { form: {
@@ -338,7 +347,7 @@ export function useCertPipelineCreator() {
title: "申请证书", title: "申请证书",
runnableType: "step", runnableType: "step",
input: { input: {
renewDays: 35, renewDays: 15,
...pluginInput, ...pluginInput,
}, },
strategy: { strategy: {
@@ -66,6 +66,8 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
const userStore = useUserStore(); const userStore = useUserStore();
const settingStore = useSettingStore(); const settingStore = useSettingStore();
const DEFAULT_WILL_EXPIRE_DAYS = settingStore.sysPublic.defaultWillExpireDays || settingStore.sysPublic.defaultCertRenewDays || 15;
function onDialogOpen(opt: any) { function onDialogOpen(opt: any) {
const searchForm = crudExpose.getSearchValidatedFormData(); const searchForm = crudExpose.getSearchValidatedFormData();
opt.initialForm = { opt.initialForm = {
@@ -389,9 +391,9 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
} }
// 距离失效时间剩余天数 // 距离失效时间剩余天数
const leftDays = dayjs(expiresTime).diff(dayjs(), "day"); const leftDays = dayjs(expiresTime).diff(dayjs(), "day");
const color = leftDays < 20 ? "red" : "#389e0d"; const color = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : "#389e0d";
const percent = (leftDays / effectiveDays) * 100; const percent = (leftDays / effectiveDays) * 100;
const textColor = leftDays < 20 ? "red" : leftDays > 60 ? "#389e0d" : ""; const textColor = leftDays < DEFAULT_WILL_EXPIRE_DAYS ? "red" : leftDays > 60 ? "#389e0d" : "";
const format = () => { const format = () => {
return <span style={{ color: textColor }}>{`${leftDays}${t("certd.days")}`}</span>; return <span style={{ color: textColor }}>{`${leftDays}${t("certd.days")}`}</span>;
}; };
@@ -1,7 +1,10 @@
<template> <template>
<fs-page class="page-cert"> <fs-page class="page-cert">
<template #header> <template #header>
<div class="title">{{ t("certd.myPipelines") }}</div> <div class="title">
{{ t("certd.myPipelines") }}
<div class="sub">{{ t("certd.pipelinePage.myPipelinesDesc") }}</div>
</div>
</template> </template>
<!-- <a-alert v-if="settingStore.sysPublic.notice" type="warning" show-icon> <!-- <a-alert v-if="settingStore.sysPublic.notice" type="warning" show-icon>
<template #message> <template #message>
@@ -5,12 +5,12 @@
</template> </template>
<p class="flex items-center"> <p class="flex items-center">
<TriggerIcon class="mr-2" :trigger-type="runnable.triggerType"></TriggerIcon> <TriggerIcon class="mr-2" :trigger-type="runnable.triggerType"></TriggerIcon>
<fs-date-format :model-value="runnable.createTime"></fs-date-format> <fs-date-format class="mr-1" :model-value="runnable.createTime"></fs-date-format>
<a-tag class="ml-5" :color="status.color" :closable="status.value === 'start'" @close="cancelTask"> <a-tag class="ml-0 mr-1" :color="status.color" :closable="status.value === 'start'" @close="cancelTask">
{{ status.label }} {{ status.label }}
</a-tag> </a-tag>
<a-tag v-if="isCurrent" class="pointer" color="green" :closable="true" @close="cancel">当前</a-tag> <a-tag v-if="isCurrent" class="pointer ml-0 mr-1" color="green" :closable="true" @close="cancel">当前</a-tag>
<a-tag v-else-if="!editMode" class="pointer" color="blue" @click="view">查看</a-tag> <a-tag v-else-if="!editMode" class="pointer ml-0 mr-1" color="blue" @click="view">查看</a-tag>
</p> </p>
</a-timeline-item> </a-timeline-item>
</template> </template>
@@ -89,5 +89,9 @@ export default defineComponent({
.ant-tag.pointer { .ant-tag.pointer {
cursor: pointer; cursor: pointer;
} }
.ant-timeline .ant-timeline-item-content {
margin-inline-start: 22px !important;
}
} }
</style> </style>
@@ -67,7 +67,7 @@
<div class="statistic-data m-20"> <div class="statistic-data m-20">
<a-row :gutter="20" class="flex-wrap"> <a-row :gutter="20" class="flex-wrap">
<a-col :md="6" :xs="24"> <a-col :md="6" :xs="24">
<statistic-card :title="t('certd.dashboard.pipelineCount')" :count="count.pipelineCount"> <statistic-card icon="fluent-color:data-line-24" :title="t('certd.dashboard.pipelineCount')" :count="count.pipelineCount" :sub-counts="count.pipelineEnableCount">
<template v-if="count.pipelineCount === 0" #default> <template v-if="count.pipelineCount === 0" #default>
<div class="flex-center flex-1 flex-col"> <div class="flex-center flex-1 flex-col">
<div style="font-size: 18px; font-weight: 700">{{ t("certd.dashboard.noPipeline") }}</div> <div style="font-size: 18px; font-weight: 700">{{ t("certd.dashboard.noPipeline") }}</div>
@@ -79,18 +79,30 @@
</template> </template>
</statistic-card> </statistic-card>
</a-col> </a-col>
<a-col :md="6" :xs="24"> <!-- <a-col :md="6" :xs="24">
<statistic-card :title="t('certd.dashboard.pipelineStatus')" :footer="false"> <statistic-card :title="t('certd.dashboard.pipelineStatus')" :footer="false">
<pie-count v-if="count.pipelineStatusCount" :data="count.pipelineStatusCount"></pie-count> <pie-count v-if="count.pipelineStatusCount" :data="count.pipelineStatusCount"></pie-count>
</statistic-card> </statistic-card>
</a-col> -->
<a-col :md="6" :xs="24">
<statistic-card icon="fluent-color:certificate-24" :title="t('certd.dashboard.certCount')" :count="count.certCount" :sub-counts="count.certStatusCount">
<template v-if="count.certCount === 0" #default>
<div class="flex-center flex-1 flex-col">
<div style="font-size: 18px; font-weight: 700">{{ t("certd.dashboard.noCert") }}</div>
</div>
</template>
<template #footer>
<router-link to="/certd/monitor/cert" class="flex"> <fs-icon icon="ion:settings-outline" class="mr-5 fs-16" /> {{ t("certd.dashboard.manageCert") }} </router-link>
</template>
</statistic-card>
</a-col> </a-col>
<a-col :md="6" :xs="24"> <a-col :md="6" :xs="24">
<statistic-card :title="t('certd.dashboard.recentRun')" :footer="false"> <statistic-card icon="fluent-color:data-trending-24" :title="t('certd.dashboard.recentRun')" :footer="false">
<day-count v-if="count.historyCountPerDay" :data="count.historyCountPerDay" :title="t('certd.dashboard.runCount')"></day-count> <day-count v-if="count.historyCountPerDay" :data="count.historyCountPerDay" :title="t('certd.dashboard.runCount')"></day-count>
</statistic-card> </statistic-card>
</a-col> </a-col>
<a-col :md="6" :xs="24"> <a-col :md="6" :xs="24">
<statistic-card :title="t('certd.dashboard.expiringCerts')"> <statistic-card icon="fluent-color:alert-urgent-24" :title="t('certd.dashboard.expiringCerts')">
<expiring-list v-if="count.expiringList" :data="count.expiringList"></expiring-list> <expiring-list v-if="count.expiringList" :data="count.expiringList"></expiring-list>
</statistic-card> </statistic-card>
</a-col> </a-col>
@@ -100,8 +112,11 @@
<div v-if="pluginGroups" class="plugin-list"> <div v-if="pluginGroups" class="plugin-list">
<a-card> <a-card>
<template #title> <template #title>
{{ t("certd.dashboard.supportedTasks") }} <div class="flex items-center">
<a-tag color="green">{{ pluginGroups.groups.all.plugins.length }}</a-tag> <fs-icon icon="fluent-color:puzzle-piece-24" class="mr-5 fs-28" />
<div class="mr-5">{{ t("certd.dashboard.supportedTasks") }}</div>
<a-tag color="green">{{ pluginGroups.groups.all.plugins.length }}</a-tag>
</div>
</template> </template>
<a-row :gutter="10"> <a-row :gutter="10">
<a-col v-for="item of pluginGroups.groups.all.plugins" :key="item.name" class="plugin-item-col" :xl="4" :md="6" :xs="24"> <a-col v-for="item of pluginGroups.groups.all.plugins" :key="item.name" class="plugin-item-col" :xl="4" :md="6" :xs="24">
@@ -126,32 +141,33 @@
</a-row> </a-row>
</a-card> </a-card>
</div> </div>
<a-tour v-bind="tour" v-model:current="tour.current" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { FsIcon } from "@fast-crud/fast-crud"; import { FsIcon } from "@fast-crud/fast-crud";
import SimpleSteps from "/@/components/tutorial/simple-steps.vue"; import { notification } from "ant-design-vue";
import { useUserStore } from "/@/store/user";
import { computed, ComputedRef, onMounted, Ref, ref } from "vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue"; import { computed, ComputedRef, onMounted, Ref, ref } from "vue";
import TutorialButton from "/@/components/tutorial/index.vue";
import DayCount from "./charts/day-count.vue";
import PieCount from "./charts/pie-count.vue";
import ExpiringList from "./charts/expiring-list.vue";
import SuiteCard from "./suite-card.vue";
import { useSettingStore } from "/@/store/settings";
import { SiteInfo } from "/@/store/settings/api.basic";
import { UserInfoRes } from "/@/store/user/api.user";
import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import * as api from "./api"; import * as api from "./api";
import DayCount from "./charts/day-count.vue";
import ExpiringList from "./charts/expiring-list.vue";
import NoticeBar from "./notice-bar.vue";
import SuiteCard from "./suite-card.vue";
import TutorialButton from "/@/components/tutorial/index.vue";
import SimpleSteps from "/@/components/tutorial/simple-steps.vue";
import { usePluginStore } from "/@/store/plugin";
import { useSettingStore } from "/@/store/settings";
import { SiteInfo } from "/@/store/settings/api.basic";
import { useUserStore } from "/@/store/user";
import { UserInfoRes } from "/@/store/user/api.user";
import { LocalStorage } from "/@/utils/util.storage";
import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue";
import { useI18n } from "/src/locales"; import { useI18n } from "/src/locales";
const { t } = useI18n(); const { t } = useI18n();
import { usePluginStore } from "/@/store/plugin";
import { notification } from "ant-design-vue";
import NoticeBar from "./notice-bar.vue";
defineOptions({ defineOptions({
name: "DashboardUser", name: "DashboardUser",
}); });
@@ -242,6 +258,19 @@ function transformStatusCount() {
} }
} }
count.value.pipelineStatusCount = result; count.value.pipelineStatusCount = result;
const pipelineEnableCount = count.value.pipelineEnableCount;
count.value.pipelineEnableCount = [
{ name: t("certd.dashboard.enabledCount"), value: pipelineEnableCount.enabled, color: "green" },
{ name: t("certd.dashboard.disabledCount"), value: pipelineEnableCount.disabled, color: "gray" },
];
const certCount = count.value.certCount;
count.value.certStatusCount = [
{ name: t("certd.dashboard.certExpiredCount"), value: certCount.expired, color: "red", checkIcon: "mingcute:warning-fill:#f44336" },
{ name: t("certd.dashboard.certExpiringCount"), value: certCount.expiring, color: "yellow", checkIcon: "mingcute:alert-fill:#ff9800", title: "到期不足15天" },
{ name: t("certd.dashboard.certNoExpireCount"), value: certCount.notExpired, color: "green" },
];
count.value.certCount = certCount.total;
} }
async function loadCount() { async function loadCount() {
count.value = await GetStatisticCount(); count.value = await GetStatisticCount();
@@ -266,6 +295,9 @@ onMounted(async () => {
loadLatestVersion(); loadLatestVersion();
loadCount(); loadCount();
loadPluginGroups(); loadPluginGroups();
if (count.value.pipelineCount === 0) {
tourHandleOpen(true);
}
}); });
function openUpgradeUrl() { function openUpgradeUrl() {
@@ -300,6 +332,50 @@ const noticeList = computed(() => {
return list; return list;
}); });
function useTour() {
const tour = ref({
open: false,
current: 0,
steps: [],
onClose: () => {
tour.value.open = false;
LocalStorage.set("home-tour-off", true, 999999999);
},
onFinish: () => {
tour.value.open = false;
LocalStorage.set("home-tour-off", true, 999999999);
},
});
const tourHandleOpen = (val: boolean): void => {
if (LocalStorage.get("home-tour-off")) {
return;
}
initSteps();
tour.value.open = val;
};
function initSteps() {
//@ts-ignore
tour.value.steps = [
{
title: "您是第一次使用吗?",
description: "此处可以查看新手教程哦 ↑↑↑↑",
target: () => {
return document.querySelector("header .tutorial-button");
},
},
];
}
return {
tour,
tourHandleOpen,
};
}
const { tour, tourHandleOpen } = useTour();
</script> </script>
<style lang="less"> <style lang="less">
@@ -3,12 +3,35 @@
<a-card> <a-card>
<div class="data-item"> <div class="data-item">
<div class="header"> <div class="header">
<div class="title">{{ title }}</div> <div class="title">
<fs-icon :icon="icon" class="statistic-icon"></fs-icon>
{{ title }}
</div>
<div class="more"></div> <div class="more"></div>
</div> </div>
<div class="content"> <div class="content">
<div v-if="!slots.default" class="statistic"> <div v-if="!slots.default" class="statistic">
<div v-if="count !== 0" class="value">{{ count }}</div> <div v-if="count !== 0" class="value flex items-center w-full">
<div class="total flex-center flex-1 flex-col">
<span>{{ count }}</span>
<span class="sub-title">{{ title }}</span>
</div>
<a-divider type="vertical h-10"></a-divider>
<div class="sub flex-1 flex-col h-[80%] flex-evenly pl-4">
<div v-for="item in subCounts" :key="item.name" class="sub-item flex justify-center w-full" :title="item.title">
<div class="flex items-center w-[60%] ellipsis overflow-hidden">
<div class="status-indicator" :class="`bg-${item.color}`"></div>
{{ item.name }}
</div>
<div class="w-[40%] flex items-center justify-center relative">
<span class="icon-text">{{ item.value }}</span>
<div v-if="item.value !== 0 && item.checkIcon" class="ml-2 flex items-center absolute right-0">
<fs-icon :icon="item.checkIcon" class="fs-icon"></fs-icon>
</div>
</div>
</div>
</div>
</div>
<a-empty v-else></a-empty> <a-empty v-else></a-empty>
</div> </div>
<slot></slot> <slot></slot>
@@ -23,53 +46,126 @@
<script setup lang="ts"> <script setup lang="ts">
import { FsIcon } from "@fast-crud/fast-crud"; import { FsIcon } from "@fast-crud/fast-crud";
const props = defineProps<{ const props = defineProps<{
icon: string;
title: string; title: string;
count?: number; count?: number;
subCounts?: {
name: string;
value: number;
color: string;
checkIcon?: string;
title?: string;
}[];
}>(); }>();
const slots = defineSlots(); const slots = defineSlots();
</script> </script>
<style lang="less"> <style lang="less">
.statistic-card { .statistic-card {
margin-bottom: 10px; margin-bottom: 10px;
.ant-card-body {
padding: 15px 24px;
}
.icon-text { .icon-text {
display: inline-flex; display: inline-flex;
justify-content: left; justify-content: left;
align-items: center; align-items: center;
.fs-icon { .fs-icon {
margin-right: 5px; margin-right: 5px;
font-size: 14px; font-size: 14px;
} }
} }
.data-item { .data-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 188px; height: 200px;
.header { .header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
//padding-bottom: 10px; margin-top: 6px;
color: #8077a4; margin-bottom: 6px;
color: #494949;
align-items: center;
.title {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 600;
font-size: 16px;
}
.more {
display: flex;
align-items: center;
}
.statistic-icon {
font-size: 28px;
margin-right: 5px;
}
} }
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
.statistic { .statistic {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.value { .value {
font-size: 50px; font-size: 50px;
font-weight: 700; font-weight: 700;
color: #2c254e; .total {
color: hsl(var(--primary));
.sub-title {
font-size: 12px;
font-weight: 400;
color: #626262;
}
}
.sub-item {
font-size: 14px;
.status-indicator {
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 12px;
flex-shrink: 0;
}
.bg-green {
background: linear-gradient(90deg, #4caf50, #8bc34a);
}
.bg-red {
background: linear-gradient(90deg, #f44336, #e57373);
}
.bg-yellow {
background: linear-gradient(90deg, #ff9800, #ffc107);
}
.bg-blue {
background: linear-gradient(90deg, #2196f3, #64b5f6);
}
.bg-gray {
background: linear-gradient(90deg, #9e9e9e, #bdbdbd);
}
}
} }
} }
x-vue-echarts {
}
} }
.footer { .footer {
color: #8077a4; color: #8077a4;
font-size: 12px; font-size: 12px;
@@ -81,10 +177,10 @@ const slots = defineSlots();
border-style: dashed; border-style: dashed;
border-width: 1px 0 0; border-width: 1px 0 0;
padding-top: 15px; padding-top: 15px;
> * { > * {
cursor: pointer; cursor: pointer;
} }
margin-bottom: -10px;
} }
} }
} }
@@ -9,9 +9,11 @@
<addon-selector v-model:model-value="formState.public.captchaAddonId" addon-type="captcha" from="sys" @selected-change="onAddonChanged" /> <addon-selector v-model:model-value="formState.public.captchaAddonId" addon-type="captcha" from="sys" @selected-change="onAddonChanged" />
</a-form-item> </a-form-item>
<a-form-item v-if="formState.public.captchaType === settingsStore.sysPublic.captchaType" :label="t('certd.sys.setting.captchaTest')"> <a-form-item v-if="formState.public.captchaType === settingsStore.sysPublic.captchaType" :label="t('certd.sys.setting.captchaTest')">
<div class="flex"> <div class="flex items-center">
<CaptchaInput v-model:model-value="captchaTestForm.captcha" class="w-50%"></CaptchaInput> <CaptchaInput v-model:model-value="captchaTestForm.captcha" class="w-60%"></CaptchaInput>
<a-button class="ml-2" type="primary" @click="doCaptchaValidate">后端验证</a-button> <a-button class="ml-2 mr-2" type="primary" @click="doCaptchaValidate">后端验证</a-button>
<a-tag v-if="captchaTestForm.pass" color="green" class="flex items-center"> <fs-icon icon="material-symbols:check-circle-rounded"></fs-icon> 校验通过</a-tag>
<a-tag v-else class="flex items-center"> <fs-icon icon="material-symbols:info-rounded"></fs-icon> 请先点击验证</a-tag>
</div> </div>
</a-form-item> </a-form-item>
+5 -2
View File
@@ -6,6 +6,9 @@ import { createHtmlPlugin } from "vite-plugin-html";
import { loadEnv } from "vite"; import { loadEnv } from "vite";
import * as path from "path"; import * as path from "path";
import DefineOptions from "unplugin-vue-define-options/vite"; import DefineOptions from "unplugin-vue-define-options/vite";
import { theme } from "ant-design-vue";
const { defaultAlgorithm, defaultSeed } = theme;
const mapToken = defaultAlgorithm(defaultSeed);
// import WindiCSS from "vite-plugin-windicss"; // import WindiCSS from "vite-plugin-windicss";
// import { generateModifyVars } from "./build/modify-vars"; // import { generateModifyVars } from "./build/modify-vars";
// import { configThemePlugin } from "./build/theme-plugin"; // import { configThemePlugin } from "./build/theme-plugin";
@@ -76,7 +79,7 @@ export default ({ command, mode }) => {
// 修改默认主题颜色,配置less变量 // 修改默认主题颜色,配置less变量
// modifyVars: generateModifyVars(), // modifyVars: generateModifyVars(),
javascriptEnabled: true, javascriptEnabled: true,
// modifyVars: mapToken modifyVars: mapToken,
}, },
}, },
}, },
@@ -84,7 +87,7 @@ export default ({ command, mode }) => {
host: "0.0.0.0", host: "0.0.0.0",
port: 3008, port: 3008,
fs: devServerFs, fs: devServerFs,
allowedHosts: ["localhost", "127.0.0.1", "yfy.docmirror.cn"], allowedHosts: ["localhost", "127.0.0.1", "yfy.docmirror.cn", "docmirror.top", "*"],
proxy: { proxy: {
// with options // with options
"/api": { "/api": {
+21
View File
@@ -3,6 +3,27 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.3](https://github.com/certd/certd/compare/v1.38.2...v1.38.3) (2026-01-28)
### Bug Fixes
* 当通知配置被删除时,使用默认通知配置进行发送 ([5398300](https://github.com/certd/certd/commit/53983002b6553a929b72e2c70a26809a9f306e89))
* 站点检查多个ip连接超时的报错显示不出来的bug ([33b284a](https://github.com/certd/certd/commit/33b284afc0ae6391658d573e32b1ce7765e51cb2))
### Performance Improvements
* 部署插件支持ucloud alb ([640950d](https://github.com/certd/certd/commit/640950d4c847c72cae2986e3c2cae10d52a67fdf))
* 多个dns 提供商支持导入域名 ([d3c0914](https://github.com/certd/certd/commit/d3c0914ac16db8ac77f9c60285bb20cfab7a3cb0))
* 输入证书域名时,支持点击导入域名 ([40be424](https://github.com/certd/certd/commit/40be42406c6fd5de11f594fc6913178d9e7d8943))
* 所有的dnsprovider 支持导入域名列表 ([9f21b1a](https://github.com/certd/certd/commit/9f21b1a09797d7dab253e4416c538b55fb8f4488))
* 优化首页统计数据,饼图替换成证书数量统计 ([9fa1c2e](https://github.com/certd/certd/commit/9fa1c2eb3e55ef630333ae24284aa8b54e3414b6))
* 域名导入任务进度条 ([7058d5c](https://github.com/certd/certd/commit/7058d5cb935cab8c75b98493ed497a22dbe70883))
* 证书仓库页面增加到期状态查询条件 ([58c3d70](https://github.com/certd/certd/commit/58c3d7087bb66358d896a741e12005f690b2bd5e))
* 证书流水线创建域名输入框支持获取域名数据进行选择 ([1d5b1c2](https://github.com/certd/certd/commit/1d5b1c239cf350920eb2eb9fd293af74ef412853))
* 支持导入51dns域名 ([7eb9694](https://github.com/certd/certd/commit/7eb96942214aed0dfc9c3c5a669374da67052c49))
* ucloud支持部署到alb ([78004bd](https://github.com/certd/certd/commit/78004bdfb552a3b83298fa09d518ca282a529d90))
* ucloud支持部署到ulbalb、clb统一成一个) ([c408687](https://github.com/certd/certd/commit/c408687af7669afe733b5506720ca795555acdce))
## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22) ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
### Bug Fixes ### Bug Fixes
@@ -1,19 +1,38 @@
name: demo name: demo
title: 授权插件示例 title: 授权插件示例
icon: clarity:plugin-line icon: clarity:plugin-line
desc: '' desc: 这是一个示例授权插件,用于演示如何实现一个授权插件
input: input:
apiType:
title: 授权方式
value: apiKey
component:
name: a-select
vModel: value
options:
- label: API密钥(推荐)
value: apiKey
- label: 账号密码
value: account
placeholder: demoKeyId
required: true
demoKeyId: demoKeyId:
title: 密钥Id title: 密钥Id
component: component:
name: a-input
allowClear: true
placeholder: demoKeyId placeholder: demoKeyId
required: true required: true
demoKeySecret: demoKeySecret:
title: 密钥 title: 密钥
component:
placeholder: demoKeySecret
required: true required: true
encrypt: true encrypt: true
testRequest:
title: 测试
component:
name: api-test
action: TestRequest
helper: 点击测试接口是否正常
pluginType: access pluginType: access
type: builtIn type: builtIn
scriptFilePath: /plugins/plugin-demo/access.js scriptFilePath: /plugins/plugin-demo/access.js
@@ -14,17 +14,18 @@ input:
domains: domains:
title: 证书域名 title: 证书域名
component: component:
name: a-select name: domain-selector
vModel: value vModel: value
mode: tags mode: tags
open: false placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
placeholder: foo.com / *.foo.com / *.bar.com
tokenSeparators: tokenSeparators:
- ',' - ','
- ' ' - ' '
- -
- -
- '|' - '|'
search: true
pager: true
rules: rules:
- type: domains - type: domains
required: true required: true
@@ -424,7 +425,6 @@ input:
helper: 兼容Windows Server各个版本 helper: 兼容Windows Server各个版本
renewDays: renewDays:
title: 更新天数 title: 更新天数
value: 18
component: component:
name: a-input-number name: a-input-number
vModel: value vModel: value
@@ -11,17 +11,18 @@ input:
domains: domains:
title: 证书域名 title: 证书域名
component: component:
name: a-select name: domain-selector
vModel: value vModel: value
mode: tags mode: tags
open: false placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
placeholder: foo.com / *.foo.com / *.bar.com
tokenSeparators: tokenSeparators:
- ',' - ','
- ' ' - ' '
- -
- -
- '|' - '|'
search: true
pager: true
rules: rules:
- type: domains - type: domains
required: true required: true
@@ -109,7 +110,6 @@ input:
helper: 兼容Windows Server各个版本 helper: 兼容Windows Server各个版本
renewDays: renewDays:
title: 更新天数 title: 更新天数
value: 18
component: component:
name: a-input-number name: a-input-number
vModel: value vModel: value
@@ -14,17 +14,18 @@ input:
domains: domains:
title: 证书域名 title: 证书域名
component: component:
name: a-select name: domain-selector
vModel: value vModel: value
mode: tags mode: tags
open: false placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
placeholder: foo.com / *.foo.com / *.bar.com
tokenSeparators: tokenSeparators:
- ',' - ','
- ' ' - ' '
- -
- -
- '|' - '|'
search: true
pager: true
rules: rules:
- type: domains - type: domains
required: true required: true
@@ -145,7 +146,6 @@ input:
helper: 兼容Windows Server各个版本 helper: 兼容Windows Server各个版本
renewDays: renewDays:
title: 更新天数 title: 更新天数
value: 18
component: component:
name: a-input-number name: a-input-number
vModel: value vModel: value
@@ -76,17 +76,18 @@ input:
domains: domains:
title: 证书域名 title: 证书域名
component: component:
name: a-select name: domain-selector
vModel: value vModel: value
mode: tags mode: tags
open: false placeholder: 请输入证书域名,比如:foo.com , *.foo.com , *.sub.foo.com , *.bar.com
placeholder: foo.com / *.foo.com / *.bar.com
tokenSeparators: tokenSeparators:
- ',' - ','
- ' ' - ' '
- -
- -
- '|' - '|'
search: true
pager: true
rules: rules:
- type: domains - type: domains
required: true required: true
@@ -0,0 +1,101 @@
showRunStrategy: false
default:
strategy:
runStrategy: 1
name: UCloudDeployToULB
title: UCloud-部署到负载均衡
desc: 将证书部署到UCloud负载均衡(ULB/ALB/CLB)
icon: svg:icon-ucloud
group: ucloud
needPlus: false
input:
cert:
title: 域名证书
helper: 请选择前置任务输出的域名证书
component:
name: output-selector
from:
- ':cert:'
order: 0
certDomains:
title: 当前证书域名
component:
name: cert-domains-getter
mergeScript: |2-
return {
component:{
inputKey: ctx.compute(({form})=>{
return form.cert
}),
}
}
template: false
required: false
order: 0
accessId:
title: UCloud授权
component:
name: access-selector
type: ucloud
required: true
order: 0
region:
title: 地域
component:
name: remote-select
vModel: value
type: plugin
action: onGetRegionList
search: false
pager: false
watches:
- certDomains
- accessId
required: true
mergeScript: |2-
return {
component:{
form: ctx.compute(({form})=>{
return form
})
},
}
helper: 选择UCloud地域
order: 0
certNameList:
title: 证书列表
component:
name: remote-select
vModel: value
mode: tags
type: plugin
action: onGetCertList
search: false
pager: false
watches:
- certDomains
- accessId
required: true
mergeScript: |2-
return {
component:{
form: ctx.compute(({form})=>{
return form
})
},
}
helper: |-
选择要替换的证书名称
如果证书不存在,可以手动输入证书名称(运行一次后将会自动创建,您可以在ULB控制台进行使用)
请确保证书名称不要重复,如果重复,只会更新创建时间最近的那一条
order: 0
output: {}
pluginType: deploy
type: builtIn
scriptFilePath: /plugins/plugin-ucloud/plugins/plugin-deploy-to-ulb.js
@@ -0,0 +1,99 @@
showRunStrategy: false
default:
strategy:
runStrategy: 1
name: UCloudDeployToUS3
title: UCloud-部署到对象存储(US3)
desc: 将证书部署到UCloud对象存储(US3)
icon: svg:icon-ucloud
group: ucloud
needPlus: false
input:
cert:
title: 域名证书
helper: 请选择前置任务输出的域名证书
component:
name: output-selector
from:
- ':cert:'
order: 0
certDomains:
title: 当前证书域名
component:
name: cert-domains-getter
mergeScript: |2-
return {
component:{
inputKey: ctx.compute(({form})=>{
return form.cert
}),
}
}
template: false
required: false
order: 0
accessId:
title: UCloud授权
component:
name: access-selector
type: ucloud
required: true
order: 0
bucket:
title: 存储桶
component:
name: remote-select
vModel: value
mode: tags
type: plugin
action: onGetBucketList
search: false
pager: false
watches:
- certDomains
- accessId
required: true
mergeScript: |2-
return {
component:{
form: ctx.compute(({form})=>{
return form
})
},
}
helper: 要更新的UCloud存储桶
order: 0
domainList:
title: 域名列表
component:
name: remote-select
vModel: value
mode: tags
type: plugin
action: onGetDomainList
search: false
pager: false
watches:
- certDomains
- accessId
required: true
mergeScript: |2-
return {
component:{
form: ctx.compute(({form})=>{
return form
})
},
}
helper: 要更新的UCloud域名列表
order: 0
output: {}
pluginType: deploy
type: builtIn
scriptFilePath: /plugins/plugin-ucloud/plugins/plugin-deploy-to-us3.js
+18 -16
View File
@@ -1,6 +1,6 @@
{ {
"name": "@certd/ui-server", "name": "@certd/ui-server",
"version": "1.38.2", "version": "1.38.3",
"description": "fast-server base midway", "description": "fast-server base midway",
"private": true, "private": true,
"type": "module", "type": "module",
@@ -48,23 +48,25 @@
"@aws-sdk/client-iam": "^3.964.0", "@aws-sdk/client-iam": "^3.964.0",
"@aws-sdk/client-route-53": "^3.964.0", "@aws-sdk/client-route-53": "^3.964.0",
"@aws-sdk/client-s3": "^3.964.0", "@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.2", "@certd/acme-client": "^1.38.3",
"@certd/basic": "^1.38.2", "@certd/basic": "^1.38.3",
"@certd/commercial-core": "^1.38.2", "@certd/commercial-core": "^1.38.3",
"@certd/cv4pve-api-javascript": "^8.4.2", "@certd/cv4pve-api-javascript": "^8.4.2",
"@certd/jdcloud": "^1.38.2", "@certd/jdcloud": "^1.38.3",
"@certd/lib-huawei": "^1.38.2", "@certd/lib-huawei": "^1.38.3",
"@certd/lib-k8s": "^1.38.2", "@certd/lib-k8s": "^1.38.3",
"@certd/lib-server": "^1.38.2", "@certd/lib-server": "^1.38.3",
"@certd/midway-flyway-js": "^1.38.2", "@certd/midway-flyway-js": "^1.38.3",
"@certd/pipeline": "^1.38.2", "@certd/pipeline": "^1.38.3",
"@certd/plugin-cert": "^1.38.2", "@certd/plugin-cert": "^1.38.3",
"@certd/plugin-lib": "^1.38.2", "@certd/plugin-lib": "^1.38.3",
"@certd/plugin-plus": "^1.38.2", "@certd/plugin-plus": "^1.38.3",
"@certd/plus-core": "^1.38.2", "@certd/plus-core": "^1.38.3",
"@google-cloud/publicca": "^1.3.0", "@google-cloud/publicca": "^1.3.0",
"@huaweicloud/huaweicloud-sdk-cdn": "^3.1.120", "@huaweicloud/huaweicloud-sdk-cdn": "^3.1.185",
"@huaweicloud/huaweicloud-sdk-core": "^3.1.120", "@huaweicloud/huaweicloud-sdk-core": "^3.1.185",
"@huaweicloud/huaweicloud-sdk-elb": "^3.1.185",
"@huaweicloud/huaweicloud-sdk-iam": "^3.1.185",
"@koa/cors": "^5.0.0", "@koa/cors": "^5.0.0",
"@midwayjs/bootstrap": "3.20.11", "@midwayjs/bootstrap": "3.20.11",
"@midwayjs/cache": "3.14.0", "@midwayjs/cache": "3.14.0",
@@ -1,5 +1,5 @@
import { BaseController, Constants, SysSettingsService } from "@certd/lib-server"; import { BaseController, Constants, SysSettingsService } from "@certd/lib-server";
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core"; import { ALL, Body, Controller, Inject, Post, Provide, Query, RequestIP } from "@midwayjs/core";
import { Rule, RuleType } from "@midwayjs/validate"; import { Rule, RuleType } from "@midwayjs/validate";
import { CaptchaService } from "../../modules/basic/service/captcha-service.js"; import { CaptchaService } from "../../modules/basic/service/captcha-service.js";
import { CodeService } from "../../modules/basic/service/code-service.js"; import { CodeService } from "../../modules/basic/service/code-service.js";
@@ -62,7 +62,8 @@ export class BasicController extends BaseController {
@Post('/sendSmsCode', { summary: Constants.per.guest }) @Post('/sendSmsCode', { summary: Constants.per.guest })
public async sendSmsCode( public async sendSmsCode(
@Body(ALL) @Body(ALL)
body: SmsCodeReq body: SmsCodeReq,
@RequestIP() remoteIp: string
) { ) {
const opts = { const opts = {
verificationType: body.verificationType, verificationType: body.verificationType,
@@ -74,7 +75,7 @@ export class BasicController extends BaseController {
// opts.verificationCodeLength = 6; //部分厂商这里会设置参数长度这里就不改了 // opts.verificationCodeLength = 6; //部分厂商这里会设置参数长度这里就不改了
} }
await this.codeService.checkCaptcha(body.captcha); await this.codeService.checkCaptcha(body.captcha,{remoteIp});
await this.codeService.sendSmsCode(body.phoneCode, body.mobile, opts); await this.codeService.sendSmsCode(body.phoneCode, body.mobile, opts);
return this.ok(null); return this.ok(null);
} }
@@ -82,7 +83,8 @@ export class BasicController extends BaseController {
@Post('/sendEmailCode', { summary: Constants.per.guest }) @Post('/sendEmailCode', { summary: Constants.per.guest })
public async sendEmailCode( public async sendEmailCode(
@Body(ALL) @Body(ALL)
body: EmailCodeReq body: EmailCodeReq,
@RequestIP() remoteIp: string
) { ) {
const opts = { const opts = {
verificationType: body.verificationType, verificationType: body.verificationType,
@@ -99,7 +101,7 @@ export class BasicController extends BaseController {
} }
await this.codeService.checkCaptcha(body.captcha); await this.codeService.checkCaptcha(body.captcha,{remoteIp});
await this.codeService.sendEmailCode(body.email, opts); await this.codeService.sendEmailCode(body.email, opts);
// 设置缓存内容 // 设置缓存内容
return this.ok(null); return this.ok(null);
@@ -1,4 +1,4 @@
import { ALL, Body, Controller, Inject, Post, Provide } from "@midwayjs/core"; import { ALL, Body, Controller, Inject, Post, Provide, RequestIP } from "@midwayjs/core";
import { LoginService } from "../../../modules/login/service/login-service.js"; import { LoginService } from "../../../modules/login/service/login-service.js";
import { AddonService, BaseController, Constants, SysPublicSettings, SysSettingsService } from "@certd/lib-server"; import { AddonService, BaseController, Constants, SysPublicSettings, SysSettingsService } from "@certd/lib-server";
import { CodeService } from "../../../modules/basic/service/code-service.js"; import { CodeService } from "../../../modules/basic/service/code-service.js";
@@ -26,11 +26,13 @@ export class LoginController extends BaseController {
@Post('/login', { summary: Constants.per.guest }) @Post('/login', { summary: Constants.per.guest })
public async login( public async login(
@Body(ALL) @Body(ALL)
body: any body: any,
@RequestIP()
remoteIp: string
) { ) {
const settings = await this.sysSettingsService.getPublicSettings() const settings = await this.sysSettingsService.getPublicSettings()
if (settings.captchaEnabled === true) { if (settings.captchaEnabled === true) {
await this.captchaService.doValidate({form:body.captcha,must:false,captchaAddonId:settings.captchaAddonId}) await this.captchaService.doValidate({form:body.captcha,must:false,captchaAddonId:settings.captchaAddonId,req:{remoteIp}})
} }
const token = await this.loginService.loginByPassword(body); const token = await this.loginService.loginByPassword(body);
this.writeTokenCookie(token); this.writeTokenCookie(token);
@@ -1,4 +1,4 @@
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core'; import { ALL, Body, Controller, Inject, Post, Provide, RequestIP } from '@midwayjs/core';
import { BaseController, Constants, SysSettingsService } from '@certd/lib-server'; import { BaseController, Constants, SysSettingsService } from '@certd/lib-server';
import { RegisterType, UserService } from '../../../modules/sys/authority/service/user-service.js'; import { RegisterType, UserService } from '../../../modules/sys/authority/service/user-service.js';
import { CodeService } from '../../../modules/basic/service/code-service.js'; import { CodeService } from '../../../modules/basic/service/code-service.js';
@@ -32,7 +32,8 @@ export class RegisterController extends BaseController {
@Post('/register', { summary: Constants.per.guest }) @Post('/register', { summary: Constants.per.guest })
public async register( public async register(
@Body(ALL) @Body(ALL)
body: RegisterReq body: RegisterReq,
@RequestIP() remoteIp: string
) { ) {
const sysPublicSettings = await this.sysSettingsService.getPublicSettings(); const sysPublicSettings = await this.sysSettingsService.getPublicSettings();
if (sysPublicSettings.registerEnabled === false) { if (sysPublicSettings.registerEnabled === false) {
@@ -51,7 +52,7 @@ export class RegisterController extends BaseController {
throw new Error('用户名不能为空'); throw new Error('用户名不能为空');
} }
await this.codeService.checkCaptcha(body.captcha); await this.codeService.checkCaptcha(body.captcha,{remoteIp});
const newUser = await this.userService.register(body.type, { const newUser = await this.userService.register(body.type, {
username: body.username, username: body.username,
password: body.password, password: body.password,
@@ -1,4 +1,4 @@
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core"; import { ALL, Body, Controller, Inject, Post, Provide, Query, RequestIP } from "@midwayjs/core";
import { import {
addonRegistry, addonRegistry,
AddonService, AddonService,
@@ -218,8 +218,8 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
@Post("/captchaTest", { summary: "sys:settings:edit" }) @Post("/captchaTest", { summary: "sys:settings:edit" })
async captchaTest(@Body(ALL) body: any) { async captchaTest(@Body(ALL) body: any,@RequestIP() remoteIp: string) {
await this.codeService.checkCaptcha(body) await this.codeService.checkCaptcha(body,{remoteIp});
return this.ok({}); return this.ok({});
} }
@@ -1,6 +1,6 @@
import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/core'; import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
import { Constants, CrudController } from '@certd/lib-server'; import { Constants, CrudController } from '@certd/lib-server';
import {DomainService} from "../../../modules/cert/service/domain-service.js"; import { DomainService } from "../../../modules/cert/service/domain-service.js";
import { checkPlus } from '@certd/plus-core'; import { checkPlus } from '@certd/plus-core';
/** /**
@@ -80,23 +80,65 @@ export class DomainController extends CrudController<DomainService> {
} }
@Post('/sync/import', { summary: Constants.per.authOnly }) @Post('/import/start', { summary: Constants.per.authOnly })
async syncImport(@Body(ALL) body: any) { async importStart(@Body(ALL) body: any) {
const { dnsProviderType, dnsProviderAccessId } = body; checkPlus();
const { key } = body;
const req = { const req = {
dnsProviderType, dnsProviderAccessId, userId: this.getUserId(), key, userId: this.getUserId(),
} }
checkPlus() await this.service.startDomainImportTask(req);
await this.service.doSyncFromProvider(req);
return this.ok(); return this.ok();
} }
@Post('/sync/expiration', { summary: Constants.per.authOnly }) @Post('/import/status', { summary: Constants.per.authOnly })
async syncExpiration(@Body(ALL) body: any) { async importStatus() {
await this.service.doSyncDomainsExpirationDate({ const req = {
userId: this.getUserId(),
}
const task = await this.service.getDomainImportTaskStatus(req);
return this.ok(task);
}
@Post('/import/delete', { summary: Constants.per.authOnly })
async importDelete(@Body(ALL) body: any) {
const { key } = body;
const req = {
userId: this.getUserId(),
key,
}
await this.service.deleteDomainImportTask(req);
return this.ok();
}
@Post('/import/save', { summary: Constants.per.authOnly })
async importSave(@Body(ALL) body: any) {
checkPlus();
const { dnsProviderType, dnsProviderAccessId, key } = body;
const req = {
userId: this.getUserId(),
dnsProviderType, dnsProviderAccessId, key
}
const item = await this.service.saveDomainImportTask(req);
return this.ok(item);
}
@Post('/sync/expiration/start', { summary: Constants.per.authOnly })
async syncExpirationStart(@Body(ALL) body: any) {
await this.service.startSyncExpirationTask({
userId: this.getUserId(), userId: this.getUserId(),
}) })
return this.ok(); return this.ok();
} }
@Post('/sync/expiration/status', { summary: Constants.per.authOnly })
async syncExpirationStatus(@Body(ALL) body: any) {
const status = await this.service.getSyncExpirationTaskStatus({
userId: this.getUserId(),
})
return this.ok(status);
}
} }
@@ -4,6 +4,7 @@ import { UserService } from '../../../modules/sys/authority/service/user-service
import { RoleService } from '../../../modules/sys/authority/service/role-service.js'; import { RoleService } from '../../../modules/sys/authority/service/role-service.js';
import { PipelineService } from '../../../modules/pipeline/service/pipeline-service.js'; import { PipelineService } from '../../../modules/pipeline/service/pipeline-service.js';
import { HistoryService } from '../../../modules/pipeline/service/history-service.js'; import { HistoryService } from '../../../modules/pipeline/service/history-service.js';
import { CertInfoService } from '../../../modules/monitor/index.js';
export type ChartItem = { export type ChartItem = {
name: string; name: string;
@@ -12,7 +13,17 @@ export type ChartItem = {
export type UserStatisticCount = { export type UserStatisticCount = {
pipelineCount?: number; pipelineCount?: number;
pipelineStatusCount?: ChartItem[]; pipelineStatusCount?: ChartItem[];
pipelineEnableCount?: {
enabled: number;
disabled: number;
};
historyCountPerDay: ChartItem[]; historyCountPerDay: ChartItem[];
certCount?: {
total: number;
expired: number;
expiring: number;
notExpired: number;
};
expiringList: any[]; expiringList: any[];
}; };
/** /**
@@ -30,15 +41,25 @@ export class StatisticController extends BaseController {
@Inject() @Inject()
historyService: HistoryService; historyService: HistoryService;
@Inject()
certInfoService: CertInfoService;
@Post('/count', { summary: Constants.per.authOnly }) @Post('/count', { summary: Constants.per.authOnly })
public async count() { public async count() {
const pipelineCount = await this.pipelineService.count({ userId: this.getUserId() }); const pipelineCount = await this.pipelineService.count({ userId: this.getUserId() });
const pipelineStatusCount = await this.pipelineService.statusCount({ userId: this.getUserId() }); const pipelineStatusCount = await this.pipelineService.statusCount({ userId: this.getUserId() });
const pipelineEnableCount = await this.pipelineService.enableCount({ userId: this.getUserId() });
const historyCount = await this.historyService.countPerDay({ userId: this.getUserId(), days: 7 }); const historyCount = await this.historyService.countPerDay({ userId: this.getUserId(), days: 7 });
const expiringList = await this.pipelineService.latestExpiringList({ userId: this.getUserId(), count: 5 }); const expiringList = await this.pipelineService.latestExpiringList({ userId: this.getUserId(), count: 5 });
const certCount = await this.certInfoService.count({ userId: this.getUserId() });
const count: UserStatisticCount = { const count: UserStatisticCount = {
pipelineCount, pipelineCount,
pipelineStatusCount, pipelineStatusCount,
pipelineEnableCount,
certCount,
historyCountPerDay: historyCount, historyCountPerDay: historyCount,
expiringList, expiringList,
}; };
@@ -1,11 +1,12 @@
import { ALL, Body, Controller, Get, Inject, Post, Provide, Query } from "@midwayjs/core"; import { ALL, Body, Controller, Get, Inject, Post, Provide, Query } from "@midwayjs/core";
import { CommonException, Constants, CrudController } from "@certd/lib-server"; import { CommonException, Constants, CrudController, SysSettingsService } from "@certd/lib-server";
import { AuthService } from "../../../modules/sys/authority/service/auth-service.js"; import { AuthService } from "../../../modules/sys/authority/service/auth-service.js";
import { CertInfoService } from "../../../modules/monitor/index.js"; import { CertInfoService } from "../../../modules/monitor/index.js";
import { PipelineService } from "../../../modules/pipeline/service/pipeline-service.js"; import { PipelineService } from "../../../modules/pipeline/service/pipeline-service.js";
import { SelectQueryBuilder } from "typeorm"; import { SelectQueryBuilder } from "typeorm";
import { logger } from "@certd/basic"; import { logger } from "@certd/basic";
import fs from "fs"; import fs from "fs";
import dayjs from "dayjs";
/** /**
*/ */
@@ -19,6 +20,9 @@ export class CertInfoController extends CrudController<CertInfoService> {
@Inject() @Inject()
pipelineService: PipelineService; pipelineService: PipelineService;
@Inject()
sysSettingService: SysSettingsService;
getService(): CertInfoService { getService(): CertInfoService {
return this.service; return this.service;
} }
@@ -29,6 +33,12 @@ export class CertInfoController extends CrudController<CertInfoService> {
body.query.userId = this.getUserId(); body.query.userId = this.getUserId();
const domains = body.query?.domains; const domains = body.query?.domains;
delete body.query.domains; delete body.query.domains;
const expiresLeft = body.query?.expiresLeft;
delete body.query.expiresLeft;
const sysSetting = await this.sysSettingService.getPublicSettings();
const DEFAULT_WILL_EXPIRE_DAYS = sysSetting?.defaultWillExpireDays || sysSetting?.defaultCertRenewDays || 15;
const res = await this.service.page({ const res = await this.service.page({
query: body.query, query: body.query,
page: body.page, page: body.page,
@@ -37,6 +47,16 @@ export class CertInfoController extends CrudController<CertInfoService> {
if (domains) { if (domains) {
bq.andWhere('domains like :domains', { domains: `%${domains}%` }); bq.andWhere('domains like :domains', { domains: `%${domains}%` });
} }
if (expiresLeft) {
const willExpire = dayjs().add(DEFAULT_WILL_EXPIRE_DAYS, 'day').valueOf();
if (expiresLeft === "expired") {
bq.andWhere('expires_time < :now', { now: Date.now() });
} else if (expiresLeft === "expiring") {
bq.andWhere('expires_time <= :willExpire and expires_time > :now', { willExpire, now: Date.now() });
} else if (expiresLeft === "noExpired") {
bq.andWhere('expires_time > :willExpire', { willExpire });
}
}
} }
}); });
@@ -1,10 +1,10 @@
import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
import { logger } from '@certd/basic'; import { logger } from '@certd/basic';
import { UserService } from '../sys/authority/service/user-service.js';
import { PlusService, SysInstallInfo, SysPrivateSettings, SysSettingsService } from '@certd/lib-server'; import { PlusService, SysInstallInfo, SysPrivateSettings, SysSettingsService } from '@certd/lib-server';
import { nanoid } from 'nanoid'; import { Autoload, Config, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
import crypto from 'crypto'; import crypto from 'crypto';
import {SafeService} from "../sys/settings/safe-service.js"; import { nanoid } from 'nanoid';
import { UserService } from '../sys/authority/service/user-service.js';
import { SafeService } from "../sys/settings/safe-service.js";
@Autoload() @Autoload()
@Scope(ScopeEnum.Request, { allowDowngrade: true }) @Scope(ScopeEnum.Request, { allowDowngrade: true })
@@ -220,7 +220,7 @@ export class AutoCRegisterCron {
name: 'domain-expire-check', name: 'domain-expire-check',
cron: `0 ${randomMinute} ${randomHour} ? * ${randomWeek}`, // 每周随机一天检查一次 cron: `0 ${randomMinute} ${randomHour} ? * ${randomWeek}`, // 每周随机一天检查一次
job: async () => { job: async () => {
await this.domainService.doSyncDomainsExpirationDate({}) await this.domainService.startSyncExpirationTask({})
} }
}) })
} }

Some files were not shown because too many files have changed in this diff Show More