mirror of
https://github.com/certd/certd.git
synced 2026-04-04 06:30:51 +08:00
Compare commits
133 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4b6580247 | ||
|
|
84fb1c5127 | ||
|
|
ddfd0fb81d | ||
|
|
37edbf5824 | ||
|
|
e15212bf49 | ||
|
|
6a0cc1b1f3 | ||
|
|
0e8339c701 | ||
|
|
5d71a4dbde | ||
|
|
0b78030c59 | ||
|
|
24237c16bf | ||
|
|
c48da5dea7 | ||
|
|
a12b824339 | ||
|
|
c4a743189e | ||
|
|
85f9ef35f6 | ||
|
|
6de220e38a | ||
|
|
0d455d8c2f | ||
|
|
f7b0b44ef6 | ||
|
|
81282a9c88 | ||
|
|
a9b302e38d | ||
|
|
1fe4c367f7 | ||
|
|
2de7583900 | ||
|
|
356703c83e | ||
|
|
1cae709b2b | ||
|
|
46a492248f | ||
|
|
d876ea6711 | ||
|
|
b40b4c3cfd | ||
|
|
44980d6c46 | ||
|
|
442f9647a2 | ||
|
|
a06ef07178 | ||
|
|
0c2ea5da4c | ||
|
|
45814ceb49 | ||
|
|
41f4617e66 | ||
|
|
a463711b03 | ||
|
|
3a147141b1 | ||
|
|
aea1c13bd3 | ||
|
|
9cc4c017ae | ||
|
|
88022747be | ||
|
|
ebb292a2f7 | ||
|
|
818998259d | ||
|
|
36b02c2cec | ||
|
|
e6195ade3e | ||
|
|
231a875bb4 | ||
|
|
378c777a38 | ||
|
|
8ef63916ef | ||
|
|
f32ecdf5f1 | ||
|
|
94739b9b8e | ||
|
|
023db4e04e | ||
|
|
5a4b95f5fe | ||
|
|
b091657b5c | ||
|
|
f7bf5c9328 | ||
|
|
86e521b9aa | ||
|
|
e08cf57b72 | ||
|
|
9e06cb9a83 | ||
|
|
c65e8622b8 | ||
|
|
7795efeb7a | ||
|
|
e725e0020e | ||
|
|
8478ce25f1 | ||
|
|
22cdac6210 | ||
|
|
3422a1a59f | ||
|
|
f807b8cb46 | ||
|
|
e1e510ce1e | ||
|
|
36bc3ff22d | ||
|
|
1db1ffde99 | ||
|
|
7984b625ba | ||
|
|
bb22f062ed | ||
|
|
a3086e6a5b | ||
|
|
1eb9bd34fd | ||
|
|
cff7baaaad | ||
|
|
47af700375 | ||
|
|
eb7f53a1e3 | ||
|
|
d23792fda2 | ||
|
|
b5cbb8e450 | ||
|
|
fc037b4518 | ||
|
|
c04921f42b | ||
|
|
8af3463668 | ||
|
|
094565ccd6 | ||
|
|
07b9769504 | ||
|
|
566b12f5d1 | ||
|
|
a560999d13 | ||
|
|
a818a3d293 | ||
|
|
4d68a174cb | ||
|
|
905219e523 | ||
|
|
c675b87040 | ||
|
|
e2dadfdc40 | ||
|
|
a66f9aa04d | ||
|
|
863e74dd2e | ||
|
|
aebb07c5cc | ||
|
|
677fec0a0b | ||
|
|
61f06faaf5 | ||
|
|
fcf8309c23 | ||
|
|
76b19a4980 | ||
|
|
ed1a9fc7aa | ||
|
|
b71e30755d | ||
|
|
fe196d1b20 | ||
|
|
0b152a3cb8 | ||
|
|
1a0e096ddb | ||
|
|
bf040d4c42 | ||
|
|
3e2101aa5b | ||
|
|
44f11b38e7 | ||
|
|
06f8514bc1 | ||
|
|
d9a9f1c25c | ||
|
|
e77f7244ba | ||
|
|
09779cd1e1 | ||
|
|
11024168db | ||
|
|
304914513e | ||
|
|
03d0efcfc6 | ||
|
|
0c2bdc9146 | ||
|
|
188450b0c0 | ||
|
|
ddf6bbfa46 | ||
|
|
2c7c98a152 | ||
|
|
d31ac75718 | ||
|
|
4b28c659de | ||
|
|
00b937e52a | ||
|
|
68f333fb87 | ||
|
|
085b4d9319 | ||
|
|
b8edd14f39 | ||
|
|
61a19d694b | ||
|
|
aa96859798 | ||
|
|
abf015f485 | ||
|
|
0b9a02afde | ||
|
|
e332ce28f8 | ||
|
|
08e779f9f1 | ||
|
|
a53b6cd28f | ||
|
|
47ebab237b | ||
|
|
5a5af60f97 | ||
|
|
50cc17c7cb | ||
|
|
f9553e7d44 | ||
|
|
ae51676471 | ||
|
|
f933fb705c | ||
|
|
918ea59b9a | ||
|
|
b9dab77c8b | ||
|
|
4159534a64 | ||
|
|
d00177a9b6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@ gen
|
||||
/test/*.private.*
|
||||
|
||||
/*.log
|
||||
nohup.out
|
||||
|
||||
/packages/ui/*/.idea
|
||||
/packages/ui/*/node_modules
|
||||
|
||||
100
CHANGELOG.md
100
CHANGELOG.md
@@ -3,6 +3,106 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **flexcdn:** fix cert upload and skipSslVerify required ([c48da5d](https://github.com/certd/certd/commit/c48da5dea7f0f0cdeae643b106b4a678acc3b14b))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 阿里云CLB支持部署到扩展域名 ([0e8339c](https://github.com/certd/certd/commit/0e8339c70190890d449099e1d26e5ed06ff135fb))
|
||||
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
|
||||
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
|
||||
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复Farcdn证书有效期错误的问题 ([1fe4c36](https://github.com/certd/certd/commit/1fe4c367f7128de9ba5e3395ae06bc81e63a7d5a))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 不止证书自动化,插件解锁无限可能 ([a9b302e](https://github.com/certd/certd/commit/a9b302e38d3328d75df8b2da3d8b914851e55e9c))
|
||||
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
|
||||
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 更新 1panel API 版本支持v1/v2设置 ([e6195ad](https://github.com/certd/certd/commit/e6195ade3ec54b138825b8d6738f86eb8afdd720))
|
||||
* 同步更新namesilo接口,修复无法创建和删除dns记录的问题 ([36b02c2](https://github.com/certd/certd/commit/36b02c2cec145c13d4ef29d49aba5b6b4f697df2))
|
||||
* 修复阿里云 esa 证书获取站点列表错误的问题 ([0c2ea5d](https://github.com/certd/certd/commit/0c2ea5da4c836f8a0df132a3f22d399bd9ee1de9))
|
||||
* 修复部署到华为cdn,子账号ak查询不到域名的bug ([ebb292a](https://github.com/certd/certd/commit/ebb292a2f7a425c1bc810f59468beb3f1d5bc3f0))
|
||||
* 修复证书申请任务无法修改dns提供商类型的bug ([8802274](https://github.com/certd/certd/commit/88022747bebe2054223e0241d68d410771405e68))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 关闭腾讯云证书通知提醒 ([231a875](https://github.com/certd/certd/commit/231a875bb481420c39bf76ec9ff4e50954ab9fe4))
|
||||
* 优化站点选择组件,切换选择时不刷新列表 ([3a14714](https://github.com/certd/certd/commit/3a147141b1a5d67c92a5ce88a5313eaa62859e03))
|
||||
* 优化站点ip检查 ([a463711](https://github.com/certd/certd/commit/a463711b03a20120f2a298be15d71ca152d27f21))
|
||||
* 站点监控支持监控IP ([9cc4c01](https://github.com/certd/certd/commit/9cc4c017ae646a18284e732769b82636feda01d3))
|
||||
* 支持批量重新运行 ([8189982](https://github.com/certd/certd/commit/818998259ddc75e722196ac5c365038818539b9b))
|
||||
* farcdn优化 ([a06ef07](https://github.com/certd/certd/commit/a06ef07178ed73c537e21c7d57e5e5144d2c056d))
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化阿里云DCDN插件,支持多选 ([b091657](https://github.com/certd/certd/commit/b091657b5c537acf2442a2bfc345d0a77f5e2c50))
|
||||
* 支持部署到farcdn ([e08cf57](https://github.com/certd/certd/commit/e08cf57b72128998f487ab6469868052fbce0dba))
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
|
||||
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
|
||||
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
|
||||
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
|
||||
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
|
||||
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
|
||||
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 1panel增加授权测试按钮 ([566b12f](https://github.com/certd/certd/commit/566b12f5d14ce10e8f5cf1807c58f7bf27f0d199))
|
||||
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
|
||||
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
|
||||
* 支持部署到宝塔aaWAF ([094565c](https://github.com/certd/certd/commit/094565ccd619ef671c6c11ce5fb7fd54a7a21d1c))
|
||||
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复部署flexcdn问题 ([76b19a4](https://github.com/certd/certd/commit/76b19a4980f8edba5238543b82a7811e1003746c))
|
||||
* 修复插件导入的bug ([677fec0](https://github.com/certd/certd/commit/677fec0a0b6fceb4966705e471bbfeeda91610c7))
|
||||
* 修复导入在线插件不生效的bug ([fcf8309](https://github.com/certd/certd/commit/fcf8309c238208281ecb4575b2c3cfe50c11d783))
|
||||
* 修复自建插件保存丢失部署策略的bug ([863e74d](https://github.com/certd/certd/commit/863e74dd2e3912f950ff5025b5ed0070aeb37035))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 调整小助手,仅在登录之后显示 ([aebb07c](https://github.com/certd/certd/commit/aebb07c5cc8b1f233b9d203ff017ac60e6971a85))
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 宝塔插件、1panel 改成完全免费版 ([a53b6cd](https://github.com/certd/certd/commit/a53b6cd28ff2ce5662ada82379ea44a06b179b81))
|
||||
* 添加 FlexCDN 更新证书插件 ([bf040d4](https://github.com/certd/certd/commit/bf040d4c428d29c06fbaca5e29100e0c583b2b0b))
|
||||
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
|
||||
* 支持部署到maoyun cdn ([68f333f](https://github.com/certd/certd/commit/68f333fb87ce85eed27436ecb0f76351c0ccb0d1))
|
||||
* 支持AI分析报错 ([aa96859](https://github.com/certd/certd/commit/aa96859798166426e485947a6590464de189de05))
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
19
README.md
19
README.md
@@ -110,8 +110,7 @@ https://certd.handfree.work/
|
||||
> * 请务必使用web应用防火墙防护本应用,防止XSS、SQL注入等攻击
|
||||
> * 请务必做好服务器本身的安全防护,防止数据库泄露
|
||||
> * 请务必做好数据备份,避免数据丢失
|
||||
|
||||
|
||||
> * [更多安全生产建议点我](https://certd.docmirror.cn/guide/feature/safe/)
|
||||
|
||||
|
||||
## 五、更多帮助
|
||||
@@ -150,14 +149,14 @@ https://afdian.com/a/greper
|
||||
|
||||
专业版特权对比
|
||||
|
||||
| 功能 | 免费版 | 专业版 |
|
||||
|---------|--------------------|-----------------------------|
|
||||
| 免费证书申请 | 免费无限制 | 免费无限制 |
|
||||
| 域名数量 | 无限制 | 无限制 |
|
||||
| 证书流水线条数 | 无限制 | 无限制 |
|
||||
| 站点证书监控 | 限制1条 | 无限制 |
|
||||
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署等 | 支持群晖、宝塔、1Panel等,持续开发中 |
|
||||
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、飞书、anpush、server酱等 |
|
||||
| 功能 | 免费版 | 专业版 |
|
||||
|---------|---------------------------------------|--------------------------------|
|
||||
| 免费证书申请 | 免费无限制 | 免费无限制 |
|
||||
| 域名数量 | 无限制 | 无限制 |
|
||||
| 证书流水线条数 | 无限制 | 无限制 |
|
||||
| 站点证书监控 | 限制1条 | 无限制 |
|
||||
| 自动部署插件 | 阿里云CDN、腾讯云、七牛CDN、主机部署、宝塔、1Panel等大部分插件 | 群晖 |
|
||||
| 通知 | 邮件通知、自定义webhook | 邮件免配置、企微、钉钉、飞书、anpush、server酱等 |
|
||||
|
||||
|
||||
************************
|
||||
|
||||
@@ -1 +1 @@
|
||||
00:32
|
||||
00:57
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- "7001:7001"
|
||||
# ↓↓↓↓ ---------------------------------------------------------- https端口,可以根据实际情况,是否暴露该端口
|
||||
- "7002:7002"
|
||||
#↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo ENOTFOUND错误,可以尝试设置dns
|
||||
#↓↓↓↓ -------------------------------------------------------------- 如果出现getaddrinfo EAI_AGAIN 或 getaddrinfo ENOTFOUND 错误,可以尝试设置dns
|
||||
# dns:
|
||||
# - 223.5.5.5 # 阿里云公共dns
|
||||
# - 223.6.6.6
|
||||
|
||||
@@ -91,14 +91,14 @@ export default defineConfig({
|
||||
{text: "多数据库支持", link: "/guide/install/database.md"},
|
||||
{text: "开放接口", link: "/guide/open/index.md"},
|
||||
{
|
||||
text: "站点安全", link: "/guide/feature/safe"
|
||||
text: "站点安全", link: "/guide/feature/safe/"
|
||||
},
|
||||
{
|
||||
text: "插件列表", items: [
|
||||
{text: "授权提供商", link: "/guide/plugins/access"},
|
||||
{text: "DNS提供商", link: "/guide/plugins/dns-provider"},
|
||||
{text: "任务插件", link: "/guide/plugins/deploy"},
|
||||
{text: "通知插件", link: "/guide/plugins/notification"},
|
||||
{text: "授权提供商", link: "/guide/plugins/access.md"},
|
||||
{text: "DNS提供商", link: "/guide/plugins/dns-provider.md"},
|
||||
{text: "任务插件", link: "/guide/plugins/deploy.md"},
|
||||
{text: "通知插件", link: "/guide/plugins/notification.md"},
|
||||
]
|
||||
},
|
||||
]
|
||||
@@ -106,6 +106,7 @@ export default defineConfig({
|
||||
{
|
||||
text: "常见问题",
|
||||
items: [
|
||||
{text: "QA", link: "/guide/qa/use.md"},
|
||||
{text: "常见报错处理", link: "/guide/qa/"},
|
||||
{text: "群晖证书部署", link: "/guide/use/synology/"},
|
||||
{text: "腾讯云密钥获取", link: "/guide/use/tencent/"},
|
||||
@@ -138,7 +139,6 @@ export default defineConfig({
|
||||
{text: "捐赠", link: "/guide/donate/"},
|
||||
{text: "开源协议", link: "/guide/license/"},
|
||||
{text: "我的其他开源项目", link: "/guide/link/"},
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -3,6 +3,106 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复Farcdn证书有效期错误的问题 ([1fe4c36](https://github.com/certd/certd/commit/1fe4c367f7128de9ba5e3395ae06bc81e63a7d5a))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 不止证书自动化,插件解锁无限可能 ([a9b302e](https://github.com/certd/certd/commit/a9b302e38d3328d75df8b2da3d8b914851e55e9c))
|
||||
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
|
||||
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 更新 1panel API 版本支持v1/v2设置 ([e6195ad](https://github.com/certd/certd/commit/e6195ade3ec54b138825b8d6738f86eb8afdd720))
|
||||
* 同步更新namesilo接口,修复无法创建和删除dns记录的问题 ([36b02c2](https://github.com/certd/certd/commit/36b02c2cec145c13d4ef29d49aba5b6b4f697df2))
|
||||
* 修复阿里云 esa 证书获取站点列表错误的问题 ([0c2ea5d](https://github.com/certd/certd/commit/0c2ea5da4c836f8a0df132a3f22d399bd9ee1de9))
|
||||
* 修复部署到华为cdn,子账号ak查询不到域名的bug ([ebb292a](https://github.com/certd/certd/commit/ebb292a2f7a425c1bc810f59468beb3f1d5bc3f0))
|
||||
* 修复证书申请任务无法修改dns提供商类型的bug ([8802274](https://github.com/certd/certd/commit/88022747bebe2054223e0241d68d410771405e68))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 关闭腾讯云证书通知提醒 ([231a875](https://github.com/certd/certd/commit/231a875bb481420c39bf76ec9ff4e50954ab9fe4))
|
||||
* 优化站点选择组件,切换选择时不刷新列表 ([3a14714](https://github.com/certd/certd/commit/3a147141b1a5d67c92a5ce88a5313eaa62859e03))
|
||||
* 优化站点ip检查 ([a463711](https://github.com/certd/certd/commit/a463711b03a20120f2a298be15d71ca152d27f21))
|
||||
* 站点监控支持监控IP ([9cc4c01](https://github.com/certd/certd/commit/9cc4c017ae646a18284e732769b82636feda01d3))
|
||||
* 支持批量重新运行 ([8189982](https://github.com/certd/certd/commit/818998259ddc75e722196ac5c365038818539b9b))
|
||||
* farcdn优化 ([a06ef07](https://github.com/certd/certd/commit/a06ef07178ed73c537e21c7d57e5e5144d2c056d))
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化阿里云DCDN插件,支持多选 ([b091657](https://github.com/certd/certd/commit/b091657b5c537acf2442a2bfc345d0a77f5e2c50))
|
||||
* 支持部署到farcdn ([e08cf57](https://github.com/certd/certd/commit/e08cf57b72128998f487ab6469868052fbce0dba))
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
|
||||
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
|
||||
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
|
||||
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
|
||||
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
|
||||
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
|
||||
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 1panel增加授权测试按钮 ([566b12f](https://github.com/certd/certd/commit/566b12f5d14ce10e8f5cf1807c58f7bf27f0d199))
|
||||
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
|
||||
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
|
||||
* 支持部署到宝塔aaWAF ([094565c](https://github.com/certd/certd/commit/094565ccd619ef671c6c11ce5fb7fd54a7a21d1c))
|
||||
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复部署flexcdn问题 ([76b19a4](https://github.com/certd/certd/commit/76b19a4980f8edba5238543b82a7811e1003746c))
|
||||
* 修复插件导入的bug ([677fec0](https://github.com/certd/certd/commit/677fec0a0b6fceb4966705e471bbfeeda91610c7))
|
||||
* 修复导入在线插件不生效的bug ([fcf8309](https://github.com/certd/certd/commit/fcf8309c238208281ecb4575b2c3cfe50c11d783))
|
||||
* 修复自建插件保存丢失部署策略的bug ([863e74d](https://github.com/certd/certd/commit/863e74dd2e3912f950ff5025b5ed0070aeb37035))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 调整小助手,仅在登录之后显示 ([aebb07c](https://github.com/certd/certd/commit/aebb07c5cc8b1f233b9d203ff017ac60e6971a85))
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 宝塔插件、1panel 改成完全免费版 ([a53b6cd](https://github.com/certd/certd/commit/a53b6cd28ff2ce5662ada82379ea44a06b179b81))
|
||||
* 添加 FlexCDN 更新证书插件 ([bf040d4](https://github.com/certd/certd/commit/bf040d4c428d29c06fbaca5e29100e0c583b2b0b))
|
||||
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
|
||||
* 支持部署到maoyun cdn ([68f333f](https://github.com/certd/certd/commit/68f333fb87ce85eed27436ecb0f76351c0ccb0d1))
|
||||
* 支持AI分析报错 ([aa96859](https://github.com/certd/certd/commit/aa96859798166426e485947a6590464de189de05))
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复部署到又拍云强制https无效的bug ([2397097](https://github.com/certd/certd/commit/2397097e4ddcb6f593210598e8779ffd44ac3f8f))
|
||||
* 修复刷新流水线页面后,日志不自动更新的bug ([0b2e28b](https://github.com/certd/certd/commit/0b2e28b62dd5eb6804c602083e65c87a9d1d72d2))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 集成智能问答机器人 ([9dd4905](https://github.com/certd/certd/commit/9dd49054d18ec436a5029444ca55a38adc682933))
|
||||
* 支持设置网安备案号 ([d18e431](https://github.com/certd/certd/commit/d18e431e2f08e6b37704032c4ea6fbdd8e971442))
|
||||
* http方式支持校验443端口 ([d75fcb7](https://github.com/certd/certd/commit/d75fcb7fec421a9a638eaa27fe9378c84b5e0f19))
|
||||
|
||||
## [1.34.1](https://github.com/certd/certd/compare/v1.34.0...v1.34.1) (2025-05-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
88
docs/guide/development/demo/access.md
Normal file
88
docs/guide/development/demo/access.md
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
# 授权插件Demo
|
||||
|
||||
```ts
|
||||
import { AccessInput, BaseAccess, IsAccess } from '@certd/pipeline';
|
||||
import { isDev } from '../../utils/env.js';
|
||||
|
||||
/**
|
||||
* 这个注解将注册一个授权配置
|
||||
* 在certd的后台管理系统中,用户可以选择添加此类型的授权
|
||||
*/
|
||||
@IsAccess({
|
||||
name: 'demo',
|
||||
title: '授权插件示例',
|
||||
icon: 'clarity:plugin-line',
|
||||
desc: '',
|
||||
})
|
||||
export class DemoAccess extends BaseAccess {
|
||||
/**
|
||||
* 授权属性配置
|
||||
*/
|
||||
@AccessInput({
|
||||
title: '密钥Id',
|
||||
component: {
|
||||
placeholder: 'demoKeyId',
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
demoKeyId = '';
|
||||
|
||||
/**
|
||||
* 授权属性配置
|
||||
*/
|
||||
@AccessInput({
|
||||
//标题
|
||||
title: '密钥串',
|
||||
component: {
|
||||
//input组件的placeholder
|
||||
placeholder: 'demoKeySecret',
|
||||
},
|
||||
//是否必填
|
||||
required: true,
|
||||
//改属性是否需要加密
|
||||
encrypt: true,
|
||||
})
|
||||
//属性名称
|
||||
demoKeySecret = '';
|
||||
}
|
||||
new DemoAccess();
|
||||
```
|
||||
|
||||
|
||||
# 阿里云授权
|
||||
```ts
|
||||
|
||||
import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
|
||||
|
||||
@IsAccess({
|
||||
name: "aliyun",
|
||||
title: "阿里云授权",
|
||||
desc: "",
|
||||
icon: "ant-design:aliyun-outlined",
|
||||
order: 0,
|
||||
})
|
||||
export class AliyunAccess extends BaseAccess {
|
||||
@AccessInput({
|
||||
title: "accessKeyId",
|
||||
component: {
|
||||
placeholder: "accessKeyId",
|
||||
},
|
||||
helper: "登录阿里云控制台->AccessKey管理页面获取。",
|
||||
required: true,
|
||||
})
|
||||
accessKeyId = "";
|
||||
@AccessInput({
|
||||
title: "accessKeySecret",
|
||||
component: {
|
||||
placeholder: "accessKeySecret",
|
||||
},
|
||||
required: true,
|
||||
encrypt: true,
|
||||
helper: "注意:证书申请需要dns解析权限;其他阿里云插件,需要对应的权限,比如证书上传需要证书管理权限;嫌麻烦就用主账号的全量权限的accessKey",
|
||||
})
|
||||
accessKeySecret = "";
|
||||
}
|
||||
|
||||
new AliyunAccess();
|
||||
```
|
||||
@@ -45,4 +45,5 @@ Certd 存储了证书以及授权等敏感数据,所以需要严格保障安
|
||||
* 请`务必`使用`web应用防火墙`防护本应用,防止XSS、SQL注入等攻击
|
||||
* 请`务必`做好`服务器本身`的安全防护,防止数据库泄露
|
||||
* 请`务必`做好[`数据备份`](../../use/backup/),避免数据丢失
|
||||
* 请`务必`修改管理员账号用户名,且建议将admin注册为普通用户,且设置为禁用。
|
||||
* 建议开启[`站点隐藏`](./hidden/)功能
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# 源码部署
|
||||
如果没有`git`和`nodejs`基础,则不推荐
|
||||
如果没有开发基础、没有运维基础、没有`git`和`nodejs`基础,强烈不推荐此方式
|
||||
|
||||
## 一、源码安装
|
||||
|
||||
### 环境要求
|
||||
@@ -42,8 +43,8 @@ git pull
|
||||
kill -9 $(lsof -t -i:7001)
|
||||
# 重新编译启动
|
||||
./start.sh
|
||||
```
|
||||
|
||||
```
|
||||
::: warning
|
||||
升级certd版本前,切记切记先备份一下数据
|
||||
:::
|
||||
|
||||
BIN
docs/guide/qa/images/baota-net.png
Normal file
BIN
docs/guide/qa/images/baota-net.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
@@ -1,12 +1,12 @@
|
||||
# 常见报错解决
|
||||
|
||||
## 1. getaddrinfo ENOTFOUND错误
|
||||
如果出现`getaddrinfo ENOTFOUND`错误,可以尝试在`docker-compose.yaml`中设置dns
|
||||
如果出现`getaddrinfo ENOTFOUND`/`getaddrinfo EAI_AGAIN`错误,可以尝试在`docker-compose.yaml`中设置dns
|
||||
```yaml
|
||||
version: '3.3' # 兼容旧版docker-compose
|
||||
services:
|
||||
certd:
|
||||
#↓↓↓↓ ------------ # 如果出现getaddrinfo ENOTFOUND错误,可以尝试设置dns
|
||||
#↓↓↓↓ ------------ # 如果出现getaddrinfo ENOTFOUND 或 EAI_AGAIN错误,可以尝试设置dns
|
||||
dns:
|
||||
- 223.5.5.5 # 阿里云公共dns
|
||||
- 223.6.6.6
|
||||
@@ -16,4 +16,58 @@ services:
|
||||
# # ↓↓↓↓ ------- # 如果你服务器部署在国外,可以用这个替换上面阿里云的公共dns
|
||||
# - 8.8.8.8 # 谷歌公共dns
|
||||
# - 8.8.4.4
|
||||
```
|
||||
```
|
||||
|
||||
如果仍然有问题,按如下步骤检查是否能够ping通域名
|
||||
```shell
|
||||
docker exec -it certd /bin/sh
|
||||
ping www.baidu.com
|
||||
ping gg.px.certd.handfree.work
|
||||
ping app.handfree.work
|
||||
```
|
||||
|
||||
如果您是宝塔部署的
|
||||
可以试试将容器网络加入brige网络,看是否解决问题
|
||||

|
||||
|
||||
如果还是不行,请联系我们
|
||||
|
||||
|
||||
## 2. 连接IPv6超时
|
||||
docker-compose 需要放开IPv6网络的配置
|
||||
```yaml
|
||||
services:
|
||||
certd:
|
||||
networks:
|
||||
- ip6net
|
||||
# ↓↓↓↓ -------------------------------------------------------------- 启用ipv6网络,还需要把上面networks的注释放开
|
||||
networks:
|
||||
ip6net:
|
||||
enable_ipv6: true
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 2001:db8::/64
|
||||
|
||||
```
|
||||
|
||||
## 3. SSL_CERT_NOT_MATCH_DOMAIN_ERROR
|
||||
部署证书任务报类似 `SSL_CERT_NOT_MATCH_DOMAIN_ERROR`错误
|
||||
这是由于当前流水线的证书域名与要部署的目标站点的域名不匹配导致的,在申请证书任务中,增加目标站点域名,重新运行流水线即可
|
||||
|
||||
|
||||
## 4. 没有服务器配置文件,请检查是否开启了外网映射!
|
||||
宝塔网站证书部署报错:`Error: 没有服务器配置文件,请检查是否开启了外网映射!`
|
||||
解决方案:先手动在宝塔网站中设置一次证书
|
||||
|
||||
|
||||
## 5. 如何查看容器日志
|
||||
```shell
|
||||
docker logs -f --tail 200 certd
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
14
docs/guide/qa/use.md
Normal file
14
docs/guide/qa/use.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# 使用问题
|
||||
|
||||
|
||||
## 1. 是否支持IP证书
|
||||
|
||||
因为ACME协议不支持IP证书,所以certd目前也不支持IP证书
|
||||
|
||||
|
||||
## 2. 建议设置多长时间运行一次流水线
|
||||
建议每天运行一次,检查证书过期时间
|
||||
当证书没过期时,自动跳过部署
|
||||
当证书到期前35天(创建流水线时可以修改),将会自动重新申请证书,自动部署
|
||||
|
||||
|
||||
@@ -17,7 +17,9 @@ CERTD_HTTPS_port=7002
|
||||
参考Certd顶部的创建证书流水线教程
|
||||
|
||||
### 2、配置复制到本机任务
|
||||
将证书复制到certd的证书安装位置
|
||||
将证书复制到certd的证书安装位置
|
||||
证书路径:`ssl/cert.crt`
|
||||
私钥路径:`ssl/cert.key`
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.34.2"
|
||||
"version": "1.34.10"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/publishlab/node-acme-client/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.9](https://github.com/publishlab/node-acme-client/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.8](https://github.com/publishlab/node-acme-client/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.7](https://github.com/publishlab/node-acme-client/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.6](https://github.com/publishlab/node-acme-client/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.5](https://github.com/publishlab/node-acme-client/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.4](https://github.com/publishlab/node-acme-client/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.3](https://github.com/publishlab/node-acme-client/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/acme-client
|
||||
|
||||
## [1.34.2](https://github.com/publishlab/node-acme-client/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.2",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@peculiar/x509": "^1.11.0",
|
||||
"asn1js": "^3.0.5",
|
||||
"axios": "^1.7.2",
|
||||
@@ -69,5 +69,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/publishlab/node-acme-client/issues"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,46 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
|
||||
* 支持日志写入文件 ([37edbf5](https://github.com/certd/certd/commit/37edbf5824d6aaae68ea1ef7259c6f739d418d2c))
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署到宝塔aaWAF ([094565c](https://github.com/certd/certd/commit/094565ccd619ef671c6c11ce5fb7fd54a7a21d1c))
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复导入在线插件不生效的bug ([fcf8309](https://github.com/certd/certd/commit/fcf8309c238208281ecb4575b2c3cfe50c11d783))
|
||||
* 修复自建插件保存丢失部署策略的bug ([863e74d](https://github.com/certd/certd/commit/863e74dd2e3912f950ff5025b5ed0070aeb37035))
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/basic
|
||||
|
||||
@@ -1 +1 @@
|
||||
20:23
|
||||
23:54
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -45,5 +45,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
export * from './util.request.js';
|
||||
export * from './util.env.js';
|
||||
export * from './util.log.js';
|
||||
export * from './util.file.js';
|
||||
export * from './util.sp.js';
|
||||
export * from './util.promise.js';
|
||||
export * from './util.hash.js';
|
||||
export * from './util.merge.js';
|
||||
export * from './util.cache.js';
|
||||
export * from './util.string.js';
|
||||
export * from './util.lock.js';
|
||||
export * from './util.mitter.js';
|
||||
export * from './util.id.js';
|
||||
export * from './util.domain.js';
|
||||
export * from './util.amount.js';
|
||||
import { stringUtils } from './util.string.js';
|
||||
import sleep from './util.sleep.js';
|
||||
import { http, download } from './util.request.js';
|
||||
export * from "./util.request.js";
|
||||
export * from "./util.env.js";
|
||||
export * from "./util.log.js";
|
||||
export * from "./util.file.js";
|
||||
export * from "./util.sp.js";
|
||||
export * from "./util.promise.js";
|
||||
export * from "./util.hash.js";
|
||||
export * from "./util.merge.js";
|
||||
export * from "./util.cache.js";
|
||||
export * from "./util.string.js";
|
||||
export * from "./util.lock.js";
|
||||
export * from "./util.mitter.js";
|
||||
export * from "./util.id.js";
|
||||
export * from "./util.domain.js";
|
||||
export * from "./util.amount.js";
|
||||
import { stringUtils } from "./util.string.js";
|
||||
import sleep from "./util.sleep.js";
|
||||
import { http, download } from "./util.request.js";
|
||||
|
||||
import { mergeUtils } from './util.merge.js';
|
||||
import { sp } from './util.sp.js';
|
||||
import { hashUtils } from './util.hash.js';
|
||||
import { promises } from './util.promise.js';
|
||||
import { fileUtils } from './util.file.js';
|
||||
import * as _ from 'lodash-es';
|
||||
import { cache } from './util.cache.js';
|
||||
import dayjs from 'dayjs';
|
||||
import { domainUtils } from './util.domain.js';
|
||||
import { optionsUtils } from './util.options.js';
|
||||
import { amountUtils } from './util.amount.js';
|
||||
import { nanoid } from 'nanoid';
|
||||
import * as id from './util.id.js';
|
||||
import { locker } from './util.lock.js';
|
||||
import { mitter } from './util.mitter.js';
|
||||
import { mergeUtils } from "./util.merge.js";
|
||||
import { sp } from "./util.sp.js";
|
||||
import { hashUtils } from "./util.hash.js";
|
||||
import { promises } from "./util.promise.js";
|
||||
import { fileUtils } from "./util.file.js";
|
||||
import * as _ from "lodash-es";
|
||||
import { cache } from "./util.cache.js";
|
||||
import dayjs from "dayjs";
|
||||
import { domainUtils } from "./util.domain.js";
|
||||
import { optionsUtils } from "./util.options.js";
|
||||
import { amountUtils } from "./util.amount.js";
|
||||
import { nanoid } from "nanoid";
|
||||
import * as id from "./util.id.js";
|
||||
import { locker } from "./util.lock.js";
|
||||
import { mitter } from "./util.mitter.js";
|
||||
|
||||
import * as request from './util.request.js';
|
||||
import * as request from "./util.request.js";
|
||||
export const utils = {
|
||||
sleep,
|
||||
http,
|
||||
|
||||
@@ -14,9 +14,13 @@ function hmacSha256(data: string, digest: BinaryToTextEncoding = "base64") {
|
||||
function base64(data: string) {
|
||||
return Buffer.from(data).toString("base64");
|
||||
}
|
||||
function base64Decode(data: string) {
|
||||
return Buffer.from(data, "base64").toString("utf8");
|
||||
}
|
||||
export const hashUtils = {
|
||||
md5,
|
||||
sha256,
|
||||
base64,
|
||||
base64Decode,
|
||||
hmacSha256,
|
||||
};
|
||||
|
||||
@@ -18,16 +18,31 @@ const OutputAppender = {
|
||||
},
|
||||
};
|
||||
|
||||
let logFilePath = "./logs/app.log";
|
||||
export function resetLogConfigure() {
|
||||
// @ts-ignore
|
||||
log4js.configure({
|
||||
appenders: { std: { type: "stdout" }, output: { type: OutputAppender } },
|
||||
categories: { default: { appenders: ["std"], level: "info" }, pipeline: { appenders: ["std", "output"], level: "info" } },
|
||||
appenders: {
|
||||
std: { type: "stdout" },
|
||||
output: { type: OutputAppender },
|
||||
file: {
|
||||
type: "dateFile",
|
||||
filename: logFilePath,
|
||||
keepFileExt: true,
|
||||
compress: true,
|
||||
numBackups: 3,
|
||||
},
|
||||
},
|
||||
categories: { default: { appenders: ["std", "file"], level: "info" }, pipeline: { appenders: ["std", "file", "output"], level: "info" } },
|
||||
});
|
||||
}
|
||||
resetLogConfigure();
|
||||
export const logger = log4js.getLogger("default");
|
||||
|
||||
export function resetLogFilePath(filePath: string) {
|
||||
logFilePath = filePath;
|
||||
resetLogConfigure();
|
||||
}
|
||||
export function buildLogger(write: (text: string) => void) {
|
||||
const logger = log4js.getLogger("pipeline");
|
||||
const _secrets: string[] = [];
|
||||
@@ -41,8 +56,15 @@ export function buildLogger(write: (text: string) => void) {
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
//换成同长度的*号, item可能有多行
|
||||
text = text.replaceAll(item, "*".repeat(item.length));
|
||||
if (item.includes(text)) {
|
||||
//整个包含
|
||||
text = "*".repeat(text.length);
|
||||
continue;
|
||||
}
|
||||
if (text.includes(item)) {
|
||||
//换成同长度的*号, item可能有多行
|
||||
text = text.replaceAll(item, "*".repeat(item.length));
|
||||
}
|
||||
}
|
||||
write(text);
|
||||
},
|
||||
|
||||
@@ -91,10 +91,23 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
||||
// 请求拦截
|
||||
service.interceptors.request.use(
|
||||
(config: any) => {
|
||||
if (config.logParams == null) {
|
||||
config.logParams = false;
|
||||
}
|
||||
if (config.logRes == null) {
|
||||
config.logRes = false;
|
||||
}
|
||||
if (config.logData == null) {
|
||||
config.logData = false;
|
||||
}
|
||||
|
||||
logger.info(`http request:${config.url},method:${config.method}`);
|
||||
if (config.logParams !== false && config.params) {
|
||||
logger.info(`params:${JSON.stringify(config.params)}`);
|
||||
}
|
||||
if (config.logData !== false && config.data) {
|
||||
logger.info(`data:${JSON.stringify(config.data)}`);
|
||||
}
|
||||
if (config.timeout == null) {
|
||||
config.timeout = 15000;
|
||||
}
|
||||
@@ -202,6 +215,10 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
||||
logger.error("AggregateError", error);
|
||||
}
|
||||
const err = new HttpError(error);
|
||||
if (error.response?.config?.logParams === false) {
|
||||
delete err.request?.params;
|
||||
delete err.request?.data;
|
||||
}
|
||||
return Promise.reject(err);
|
||||
}
|
||||
);
|
||||
@@ -215,6 +232,7 @@ export type HttpRequestConfig<D = any> = {
|
||||
skipCheckRes?: boolean;
|
||||
logParams?: boolean;
|
||||
logRes?: boolean;
|
||||
logData?: boolean;
|
||||
httpProxy?: string;
|
||||
returnOriginRes?: boolean;
|
||||
} & AxiosRequestConfig<D>;
|
||||
|
||||
@@ -3,6 +3,56 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化站点选择组件,切换选择时不刷新列表 ([3a14714](https://github.com/certd/certd/commit/3a147141b1a5d67c92a5ce88a5313eaa62859e03))
|
||||
* 站点监控支持监控IP ([9cc4c01](https://github.com/certd/certd/commit/9cc4c017ae646a18284e732769b82636feda01d3))
|
||||
* 支持批量重新运行 ([8189982](https://github.com/certd/certd/commit/818998259ddc75e722196ac5c365038818539b9b))
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
|
||||
* 优化 RunnableError错误信息展示 ([36bc3ff](https://github.com/certd/certd/commit/36bc3ff22da93ba342c3c1103d7ee2bbcecf44f2))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化钉钉通知标题颜色 ([a560999](https://github.com/certd/certd/commit/a560999d13eed18d08dd32ee530166569e3f8746))
|
||||
* 优化飞书通知为卡片模式 ([a818a3d](https://github.com/certd/certd/commit/a818a3d293e22fb46979bc77055c05621a6fed81))
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复导入在线插件不生效的bug ([fcf8309](https://github.com/certd/certd/commit/fcf8309c238208281ecb4575b2c3cfe50c11d783))
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/pipeline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,8 +17,8 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.2",
|
||||
"@certd/plus-core": "^1.34.2",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/plus-core": "^1.34.10",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
@@ -44,5 +44,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -2,3 +2,18 @@ import { IContext } from "../core/index.js";
|
||||
|
||||
export type UserContext = IContext;
|
||||
export type PipelineContext = IContext;
|
||||
|
||||
export type PageReq = {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
searchKey?: string;
|
||||
// sortBy?: string;
|
||||
// sortOrder?: "asc" | "desc";
|
||||
};
|
||||
|
||||
export type PageRes = {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
total?: string;
|
||||
list: any[];
|
||||
};
|
||||
|
||||
@@ -218,7 +218,7 @@ export class Executor {
|
||||
returnType: ResultType.error,
|
||||
runnable: t,
|
||||
});
|
||||
errorMessage += `任务${t.title}执行失败,错误详情:${e.message};`;
|
||||
errorMessage += `任务${t.title}执行失败,错误详情:${e.message};`;
|
||||
}
|
||||
}
|
||||
if (errorList.length > 0) {
|
||||
@@ -295,6 +295,12 @@ export class Executor {
|
||||
const pluginConfig = await this.options.pluginConfigService.getPluginConfig(pluginName);
|
||||
//从outputContext读取输入参数
|
||||
const input = cloneDeep(step.input);
|
||||
const sysInput = pluginConfig.sysSetting?.input || {};
|
||||
//注入系统设置参数
|
||||
for (const sysInputKey in sysInput) {
|
||||
input[sysInputKey] = sysInput[sysInputKey];
|
||||
}
|
||||
|
||||
Decorator.inject(define.input, instance, input, (item, key) => {
|
||||
if (item.component?.name === "output-selector") {
|
||||
const contextKey = input[key];
|
||||
@@ -314,12 +320,6 @@ export class Executor {
|
||||
}
|
||||
});
|
||||
|
||||
const sysInput = pluginConfig.sysSetting?.input || {};
|
||||
//注入系统设置参数
|
||||
for (const sysInputKey in sysInput) {
|
||||
input[sysInputKey] = sysInput[sysInputKey];
|
||||
}
|
||||
|
||||
const newInputHash = hashUtils.md5(JSON.stringify(input));
|
||||
step.status!.inputHash = newInputHash;
|
||||
//判断是否需要跳过
|
||||
@@ -438,7 +438,7 @@ export class Executor {
|
||||
const runnableError = error as RunnableError;
|
||||
content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n`;
|
||||
for (const re of runnableError.errors) {
|
||||
content += ` - ${re.runnable.title} 执行失败\n 错误详情:${re.e.message}\n\n`;
|
||||
content += ` - ${re.runnable.title} 执行失败,错误详情:${re.e?.message || re.e?.error?.message}\n\n`;
|
||||
}
|
||||
} else {
|
||||
content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n${this.currentStatusMap?.currentStep?.title} 执行失败\n\n错误详情:${error.message}`;
|
||||
@@ -489,7 +489,15 @@ export class Executor {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stepId 如果==ALL 清除所有
|
||||
*/
|
||||
clearLastStatus(stepId: string) {
|
||||
if (stepId === "ALL") {
|
||||
this.lastStatusMap.clear();
|
||||
return;
|
||||
}
|
||||
this.lastStatusMap.clearById(stepId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,6 +203,7 @@ export class RunnableCollection {
|
||||
if (runnable?.status) {
|
||||
runnable.status.status = ResultType.none;
|
||||
runnable.status.result = ResultType.none;
|
||||
runnable.status.output = {};
|
||||
runnable.status.inputHash = "";
|
||||
// @ts-ignore
|
||||
runnable.input = {};
|
||||
|
||||
@@ -152,6 +152,16 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
this.logger = ctx.logger;
|
||||
this.accessService = ctx.accessService;
|
||||
this.http = ctx.http;
|
||||
// 将证书加入secret
|
||||
// @ts-ignore
|
||||
if (this.cert && this.cert.crt && this.cert.key) {
|
||||
//有证书
|
||||
// @ts-ignore
|
||||
const cert: any = this.cert;
|
||||
this.registerSecret(cert.crt);
|
||||
this.registerSecret(cert.key);
|
||||
this.registerSecret(cert.one);
|
||||
}
|
||||
}
|
||||
|
||||
async getAccess<T = any>(accessId: string | number, isCommon = false) {
|
||||
@@ -186,6 +196,14 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
return res as T;
|
||||
}
|
||||
|
||||
registerSecret(value: string) {
|
||||
// @ts-ignore
|
||||
if (this.logger?.addSecret) {
|
||||
// @ts-ignore
|
||||
this.logger.addSecret(value);
|
||||
}
|
||||
}
|
||||
|
||||
randomFileId() {
|
||||
return Math.random().toString(36).substring(2, 9);
|
||||
}
|
||||
@@ -227,6 +245,11 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
|
||||
return name + "_" + dayjs().format("YYYYMMDDHHmmssSSS");
|
||||
}
|
||||
|
||||
buildCertName(domain: string) {
|
||||
domain = domain.replaceAll("*", "_").replaceAll(".", "_");
|
||||
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
|
||||
}
|
||||
|
||||
async onRequest(req: PluginRequestHandleReq<any>) {
|
||||
if (!req.action) {
|
||||
throw new Error("action is required");
|
||||
|
||||
@@ -48,6 +48,11 @@ export class Registry<T = any> {
|
||||
logger.info(`注册插件:${this.type}:${key}`);
|
||||
}
|
||||
|
||||
unRegister(key: string) {
|
||||
delete this.storage[key];
|
||||
logger.info(`反注册插件:${this.type}:${key}`);
|
||||
}
|
||||
|
||||
get(name: string): RegistryItem<T> {
|
||||
if (!name) {
|
||||
throw new Error("插件名称不能为空");
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-huawei
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
"types": "./dist/d/index.d.ts",
|
||||
@@ -24,5 +24,5 @@
|
||||
"prettier": "^2.8.8",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-iframe
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/jdcloud
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -61,5 +61,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-k8s
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.34.2",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,44 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/lib-server
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -27,10 +27,10 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.2",
|
||||
"@certd/basic": "^1.34.2",
|
||||
"@certd/pipeline": "^1.34.2",
|
||||
"@certd/plus-core": "^1.34.2",
|
||||
"@certd/acme-client": "^1.34.10",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/plus-core": "^1.34.10",
|
||||
"@midwayjs/cache": "~3.14.0",
|
||||
"@midwayjs/core": "~3.20.3",
|
||||
"@midwayjs/i18n": "~3.20.3",
|
||||
@@ -61,5 +61,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ export class SysPublicSettings extends BaseSettings {
|
||||
icpNo?: string;
|
||||
mpsNo?: string;
|
||||
robots?: boolean = true;
|
||||
aiChatEnabled = true;
|
||||
}
|
||||
|
||||
export class SysPrivateSettings extends BaseSettings {
|
||||
@@ -203,3 +204,5 @@ export class SysSafeSetting extends BaseSettings {
|
||||
autoHiddenTimes: 5,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,11 +3,12 @@ import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { SysSettingsEntity } from '../entity/sys-settings.js';
|
||||
import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, SysSecret, SysSecretBackup } from './models.js';
|
||||
import * as _ from 'lodash-es';
|
||||
|
||||
import { BaseService } from '../../../basic/index.js';
|
||||
import { cache, logger, setGlobalProxy } from '@certd/basic';
|
||||
import * as dns from 'node:dns';
|
||||
|
||||
import {mergeUtils} from "@certd/basic";
|
||||
const {merge} = mergeUtils;
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
@@ -75,7 +76,7 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
||||
}
|
||||
let newSetting: T = new type();
|
||||
const savedSettings = await this.getSettingByKey(key);
|
||||
newSetting = _.merge(newSetting, savedSettings);
|
||||
newSetting = merge(newSetting, savedSettings);
|
||||
await this.saveSetting(newSetting);
|
||||
cache.set(cacheKey, newSetting);
|
||||
return newSetting;
|
||||
|
||||
@@ -3,6 +3,38 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/midway-flyway-js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,50 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复证书申请任务无法修改dns提供商类型的bug ([8802274](https://github.com/certd/certd/commit/88022747bebe2054223e0241d68d410771405e68))
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机 ([e1e510c](https://github.com/certd/certd/commit/e1e510ce1e37a5ae82478226b6987a83f22d1ecb))
|
||||
* 修复lego模式下每次都重新申请证书的bug ([f807b8c](https://github.com/certd/certd/commit/f807b8cb465cc329fa034ecbef94e18ef394f870))
|
||||
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -16,10 +16,10 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.34.2",
|
||||
"@certd/basic": "^1.34.2",
|
||||
"@certd/pipeline": "^1.34.2",
|
||||
"@certd/plugin-lib": "^1.34.2",
|
||||
"@certd/acme-client": "^1.34.10",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@certd/plugin-lib": "^1.34.10",
|
||||
"@google-cloud/publicca": "^1.3.0",
|
||||
"dayjs": "^1.11.7",
|
||||
"jszip": "^3.10.1",
|
||||
@@ -43,5 +43,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
@TaskInput({
|
||||
title: "邮箱",
|
||||
component: {
|
||||
name: "a-input",
|
||||
name: "email-selector",
|
||||
vModel: "value",
|
||||
},
|
||||
rules: [{ type: "email", message: "请输入正确的邮箱" }],
|
||||
@@ -81,6 +81,10 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
getCheckChangeInputKeys() {
|
||||
//插件哪些字段参与校验是否需要更新
|
||||
return ["domains", "sslProvider", "privateKeyType", "dnsProviderType", "pfxPassword"];
|
||||
}
|
||||
/**
|
||||
* 是否更新证书
|
||||
*/
|
||||
@@ -91,7 +95,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
const checkInputChanges = ["domains", "sslProvider", "privateKeyType", "dnsProviderType", "pfxPassword"];
|
||||
const checkInputChanges = this.getCheckChangeInputKeys();
|
||||
const oldInput = JSON.stringify(pick(this.lastStatus?.input, checkInputChanges));
|
||||
const thisInput = JSON.stringify(pick(this, checkInputChanges));
|
||||
const inputChanged = oldInput !== thisInput;
|
||||
@@ -145,7 +149,8 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
throw new Error("过期时间不能为空");
|
||||
}
|
||||
// 检查有效期
|
||||
const leftDays = dayjs(expires).diff(dayjs(), "day");
|
||||
const leftDays = Math.floor((expires - dayjs().valueOf()) / (1000 * 60 * 60 * 24));
|
||||
this.logger.info(`证书剩余天数:${leftDays}`);
|
||||
return {
|
||||
isWillExpire: leftDays <= maxDays,
|
||||
leftDays,
|
||||
|
||||
@@ -93,6 +93,21 @@ export class CertReader {
|
||||
return domains;
|
||||
}
|
||||
|
||||
getAltNames() {
|
||||
const { detail } = this.getCrtDetail();
|
||||
return detail.domains.altNames;
|
||||
}
|
||||
|
||||
static getMainDomain(crt: string) {
|
||||
const { detail } = CertReader.readCertDetail(crt);
|
||||
return detail.domains.commonName;
|
||||
}
|
||||
|
||||
getMainDomain() {
|
||||
const { detail } = this.getCrtDetail();
|
||||
return detail.domains.commonName;
|
||||
}
|
||||
|
||||
saveToFile(type: "crt" | "key" | "pfx" | "der" | "oc" | "one" | "ic" | "jks", filepath?: string) {
|
||||
if (!this.cert[type]) {
|
||||
return;
|
||||
@@ -164,8 +179,14 @@ export class CertReader {
|
||||
buildCertFileName(suffix: string, applyTime: any, prefix = "cert") {
|
||||
const detail = this.getCrtDetail();
|
||||
let domain = detail.detail.domains.commonName;
|
||||
domain = domain.replace(".", "_").replace("*", "_");
|
||||
domain = domain.replaceAll(".", "_").replaceAll("*", "_");
|
||||
const timeStr = dayjs(applyTime).format("YYYYMMDDHHmmss");
|
||||
return `${prefix}_${domain}_${timeStr}.${suffix}`;
|
||||
}
|
||||
|
||||
buildCertName() {
|
||||
let domain = this.getMainDomain();
|
||||
domain = domain.replaceAll("*", "_").replaceAll("*", "_");
|
||||
return `${domain}_${dayjs().format("YYYYMMDDHHmmssSSS")}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,11 +102,11 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
return form.challengeType === 'dns'
|
||||
}),
|
||||
component:{
|
||||
on:{
|
||||
selectedChange({form,$event}){
|
||||
form.dnsProviderAccessType = $event.accessType
|
||||
onSelectedChange: ctx.compute(({form})=>{
|
||||
return ($event)=>{
|
||||
form.dnsProviderAccessType = $event.accessType
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
`,
|
||||
@@ -320,7 +320,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
|
||||
this.logger.info("当前正在使用 google EAB授权");
|
||||
eab = await this.getAccess(this.eabAccessId);
|
||||
} else if (this.googleCommonEabAccessId) {
|
||||
this.logger.info("当前正在使用 google公共EAB授权");
|
||||
this.logger.info("当前正在使用 google 公共EAB授权");
|
||||
eab = await this.getAccess(this.googleCommonEabAccessId, true);
|
||||
} else {
|
||||
throw new Error("google需要配置EAB授权或服务账号授权");
|
||||
|
||||
@@ -112,9 +112,12 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
|
||||
})
|
||||
privateKeyType!: PrivateKeyType;
|
||||
|
||||
|
||||
eab?: EabAccess;
|
||||
|
||||
getCheckChangeInputKeys() {
|
||||
return ["domains", "privateKeyType", "dnsType"];
|
||||
}
|
||||
|
||||
async onInstance() {
|
||||
this.accessService = this.ctx.accessService;
|
||||
this.logger = this.ctx.logger;
|
||||
|
||||
27
packages/plugins/plugin-cert/test/cert-plugin.test.mjs
Normal file
27
packages/plugins/plugin-cert/test/cert-plugin.test.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
import { expect } from "chai";
|
||||
import { CertApplyPlugin } from "../dist/index.js";
|
||||
import dayjs from "dayjs";
|
||||
import { logger } from "@certd/basic";
|
||||
|
||||
describe("test/cert-plugin.ts", () => {
|
||||
const certApplyPlugin = new CertApplyPlugin();
|
||||
certApplyPlugin.logger = logger;
|
||||
it("should throw error when expires is null or undefined", () => {
|
||||
expect(() => {
|
||||
// @ts-ignore
|
||||
certApplyPlugin.isWillExpire(undefined);
|
||||
}).throw("过期时间不能为空");
|
||||
|
||||
expect(() => {
|
||||
// @ts-ignore
|
||||
certApplyPlugin.isWillExpire(null);
|
||||
}).throw("过期时间不能为空");
|
||||
});
|
||||
|
||||
it("isWillExpire", () => {
|
||||
const now = dayjs().add(36, "day") - 10000;
|
||||
const res = certApplyPlugin.isWillExpire(now.valueOf(), 35);
|
||||
console.log(res);
|
||||
expect(res.isWillExpire).eq(true);
|
||||
});
|
||||
});
|
||||
@@ -3,6 +3,53 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署到飞牛OS ([ddfd0fb](https://github.com/certd/certd/commit/ddfd0fb81d6638352920261065f1ab8e27bdd564))
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复阿里云 esa 证书获取站点列表错误的问题 ([0c2ea5d](https://github.com/certd/certd/commit/0c2ea5da4c836f8a0df132a3f22d399bd9ee1de9))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 关闭腾讯云证书通知提醒 ([231a875](https://github.com/certd/certd/commit/231a875bb481420c39bf76ec9ff4e50954ab9fe4))
|
||||
* 优化站点选择组件,切换选择时不刷新列表 ([3a14714](https://github.com/certd/certd/commit/3a147141b1a5d67c92a5ce88a5313eaa62859e03))
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 添加阿里云 ESA证书部署插件 ([1db1ffd](https://github.com/certd/certd/commit/1db1ffde99ac7e4684fa606ebc4c327f829b3a26))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
**Note:** Version bump only for package @certd/plugin-lib
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 支持部署到maoyun cdn ([68f333f](https://github.com/certd/certd/commit/68f333fb87ce85eed27436ecb0f76351c0ccb0d1))
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -16,10 +16,12 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/openapi-client": "^0.4.14",
|
||||
"@alicloud/pop-core": "^1.7.10",
|
||||
"@alicloud/tea-util": "^1.4.10",
|
||||
"@aws-sdk/client-s3": "^3.787.0",
|
||||
"@certd/basic": "^1.34.2",
|
||||
"@certd/pipeline": "^1.34.2",
|
||||
"@certd/basic": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@kubernetes/client-node": "0.21.0",
|
||||
"ali-oss": "^6.22.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
@@ -50,5 +52,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "6c74148c277432f91014bf1eebd824e7423c6f4b"
|
||||
"gitHead": "85f9ef35f650d6ed1125f9d5eecee08cabc7fe8a"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,90 @@
|
||||
import { IsAccess, AccessInput, BaseAccess } from "@certd/pipeline";
|
||||
import { ILogger } from "@certd/basic";
|
||||
|
||||
export type AliyunClientV2Req = {
|
||||
action: string;
|
||||
version: string;
|
||||
protocol?: "HTTPS";
|
||||
// 接口 HTTP 方法
|
||||
method?: "GET" | "POST";
|
||||
authType?: "AK";
|
||||
style?: "RPC";
|
||||
// 接口 PATH
|
||||
pathname?: `/`;
|
||||
|
||||
data?: any;
|
||||
};
|
||||
export class AliyunClientV2 {
|
||||
access: AliyunAccess;
|
||||
logger: ILogger;
|
||||
endpoint: string;
|
||||
|
||||
client: any;
|
||||
constructor(opts: { access: AliyunAccess; logger: ILogger; endpoint: string }) {
|
||||
this.access = opts.access;
|
||||
this.logger = opts.logger;
|
||||
this.endpoint = opts.endpoint;
|
||||
}
|
||||
|
||||
async getClient() {
|
||||
if (this.client) {
|
||||
return this.client;
|
||||
}
|
||||
const $OpenApi = await import("@alicloud/openapi-client");
|
||||
// const Credential = await import("@alicloud/credentials");
|
||||
// //@ts-ignore
|
||||
// const credential = new Credential.default.default({
|
||||
//
|
||||
// type: "access_key",
|
||||
// });
|
||||
const config = new $OpenApi.Config({
|
||||
accessKeyId: this.access.accessKeyId,
|
||||
accessKeySecret: this.access.accessKeySecret,
|
||||
});
|
||||
// Endpoint 请参考 https://api.aliyun.com/product/FC
|
||||
// config.endpoint = `esa.${this.regionId}.aliyuncs.com`;
|
||||
config.endpoint = this.endpoint;
|
||||
//@ts-ignore
|
||||
this.client = new $OpenApi.default.default(config);
|
||||
return this.client;
|
||||
}
|
||||
|
||||
async doRequest(req: AliyunClientV2Req) {
|
||||
const client = await this.getClient();
|
||||
|
||||
const $OpenApi = await import("@alicloud/openapi-client");
|
||||
const $Util = await import("@alicloud/tea-util");
|
||||
|
||||
const params = new $OpenApi.Params({
|
||||
// 接口名称
|
||||
action: req.action,
|
||||
// 接口版本
|
||||
version: req.version,
|
||||
// 接口协议
|
||||
protocol: "HTTPS",
|
||||
// 接口 HTTP 方法
|
||||
method: req.method ?? "POST",
|
||||
authType: "AK",
|
||||
style: "RPC",
|
||||
// 接口 PATH
|
||||
pathname: `/`,
|
||||
// 接口请求体内容格式
|
||||
reqBodyType: "json",
|
||||
// 接口响应体内容格式
|
||||
bodyType: "json",
|
||||
});
|
||||
|
||||
const runtime = new $Util.RuntimeOptions({});
|
||||
const request = new $OpenApi.OpenApiRequest(req.data);
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
// 返回值实际为 Map 类型,可从 Map 中获得三类数据:响应体 body、响应头 headers、HTTP 返回的状态码 statusCode。
|
||||
const res = await client.callApi(params, request, runtime);
|
||||
/**
|
||||
* res?.body?.
|
||||
*/
|
||||
return res?.body;
|
||||
}
|
||||
}
|
||||
|
||||
@IsAccess({
|
||||
name: "aliyun",
|
||||
@@ -27,6 +113,14 @@ export class AliyunAccess extends BaseAccess {
|
||||
helper: "注意:证书申请需要dns解析权限;其他阿里云插件,需要对应的权限,比如证书上传需要证书管理权限;嫌麻烦就用主账号的全量权限的accessKey",
|
||||
})
|
||||
accessKeySecret = "";
|
||||
|
||||
getClient(endpoint: string) {
|
||||
return new AliyunClientV2({
|
||||
access: this,
|
||||
logger: this.ctx.logger,
|
||||
endpoint: endpoint,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
new AliyunAccess();
|
||||
|
||||
@@ -83,7 +83,7 @@ export class AliyunSslClient {
|
||||
method: "POST",
|
||||
};
|
||||
|
||||
this.opts.logger.info("开始上传证书");
|
||||
this.opts.logger.info(`开始上传证书:${req.name}`);
|
||||
const ret: any = await client.request("UploadUserCertificate", params, requestOption);
|
||||
this.checkRet(ret);
|
||||
this.opts.logger.info("证书上传成功:aliyunCertId=", ret.CertId);
|
||||
|
||||
@@ -1,87 +1 @@
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
export function createCertDomainGetterInputDefine(opts?: { certInputKey?: string; props?: any }) {
|
||||
const certInputKey = opts?.certInputKey || "cert";
|
||||
return merge(
|
||||
{
|
||||
title: "当前证书域名",
|
||||
component: {
|
||||
name: "cert-domains-getter",
|
||||
},
|
||||
mergeScript: `
|
||||
return {
|
||||
component:{
|
||||
inputKey: ctx.compute(({form})=>{
|
||||
return form.${certInputKey}
|
||||
}),
|
||||
}
|
||||
}
|
||||
`,
|
||||
required: true,
|
||||
},
|
||||
opts?.props
|
||||
);
|
||||
}
|
||||
|
||||
export function createRemoteSelectInputDefine(opts?: {
|
||||
title: string;
|
||||
certDomainsInputKey?: string;
|
||||
accessIdInputKey?: string;
|
||||
typeName?: string;
|
||||
action: string;
|
||||
type?: string;
|
||||
watches?: string[];
|
||||
helper?: string;
|
||||
formItem?: any;
|
||||
mode?: string;
|
||||
multi?: boolean;
|
||||
required?: boolean;
|
||||
rules?: any;
|
||||
mergeScript?: string;
|
||||
}) {
|
||||
const title = opts?.title || "请选择";
|
||||
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
|
||||
const accessIdInputKey = opts?.accessIdInputKey || "accessId";
|
||||
const typeName = opts?.typeName;
|
||||
const action = opts?.action;
|
||||
const type = opts?.type || "plugin";
|
||||
const watches = opts?.watches || [];
|
||||
const helper = opts?.helper || "请选择";
|
||||
let mode = "tags";
|
||||
if (opts.multi === false) {
|
||||
mode = undefined;
|
||||
} else {
|
||||
mode = opts?.mode ?? "tags";
|
||||
}
|
||||
|
||||
const item = {
|
||||
title,
|
||||
component: {
|
||||
name: "remote-select",
|
||||
vModel: "value",
|
||||
mode,
|
||||
type,
|
||||
typeName,
|
||||
action,
|
||||
watches: [certDomainsInputKey, accessIdInputKey, ...watches],
|
||||
},
|
||||
rules: opts?.rules,
|
||||
required: opts.required ?? true,
|
||||
mergeScript:
|
||||
opts.mergeScript ??
|
||||
`
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
return form
|
||||
})
|
||||
},
|
||||
}
|
||||
`,
|
||||
helper,
|
||||
};
|
||||
|
||||
return merge(item, opts?.formItem);
|
||||
}
|
||||
|
||||
|
||||
export * from "./util.js";
|
||||
|
||||
93
packages/plugins/plugin-lib/src/common/util.ts
Normal file
93
packages/plugins/plugin-lib/src/common/util.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
export function createCertDomainGetterInputDefine(opts?: { certInputKey?: string; props?: any }) {
|
||||
const certInputKey = opts?.certInputKey || "cert";
|
||||
return merge(
|
||||
{
|
||||
title: "当前证书域名",
|
||||
component: {
|
||||
name: "cert-domains-getter",
|
||||
},
|
||||
mergeScript: `
|
||||
return {
|
||||
component:{
|
||||
inputKey: ctx.compute(({form})=>{
|
||||
return form.${certInputKey}
|
||||
}),
|
||||
}
|
||||
}
|
||||
`,
|
||||
required: true,
|
||||
},
|
||||
opts?.props
|
||||
);
|
||||
}
|
||||
|
||||
export function createRemoteSelectInputDefine(opts?: {
|
||||
title: string;
|
||||
certDomainsInputKey?: string;
|
||||
accessIdInputKey?: string;
|
||||
typeName?: string;
|
||||
action: string;
|
||||
type?: string;
|
||||
watches?: string[];
|
||||
helper?: string;
|
||||
formItem?: any;
|
||||
mode?: string;
|
||||
multi?: boolean;
|
||||
required?: boolean;
|
||||
rules?: any;
|
||||
mergeScript?: string;
|
||||
search?: boolean;
|
||||
pager?: boolean;
|
||||
component?: any;
|
||||
}) {
|
||||
const title = opts?.title || "请选择";
|
||||
const certDomainsInputKey = opts?.certDomainsInputKey || "certDomains";
|
||||
const accessIdInputKey = opts?.accessIdInputKey || "accessId";
|
||||
const typeName = opts?.typeName;
|
||||
const action = opts?.action;
|
||||
const type = opts?.type || "plugin";
|
||||
const watches = opts?.watches || [];
|
||||
const helper = opts?.helper || "请选择";
|
||||
const search = opts?.search ?? false;
|
||||
const pager = opts?.pager ?? false;
|
||||
let mode = "tags";
|
||||
if (opts.multi === false) {
|
||||
mode = undefined;
|
||||
} else {
|
||||
mode = opts?.mode ?? "tags";
|
||||
}
|
||||
|
||||
const item = {
|
||||
title,
|
||||
component: {
|
||||
name: "remote-select",
|
||||
vModel: "value",
|
||||
mode,
|
||||
type,
|
||||
typeName,
|
||||
action,
|
||||
search,
|
||||
pager,
|
||||
watches: [certDomainsInputKey, accessIdInputKey, ...watches],
|
||||
...opts.component,
|
||||
},
|
||||
rules: opts?.rules,
|
||||
required: opts.required ?? true,
|
||||
mergeScript:
|
||||
opts.mergeScript ??
|
||||
`
|
||||
return {
|
||||
component:{
|
||||
form: ctx.compute(({form})=>{
|
||||
return form
|
||||
})
|
||||
},
|
||||
}
|
||||
`,
|
||||
helper,
|
||||
};
|
||||
|
||||
return merge(item, opts?.formItem);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export class FtpAccess extends BaseAccess {
|
||||
host!: string;
|
||||
|
||||
@AccessInput({
|
||||
title: "host",
|
||||
title: "端口",
|
||||
value: 21,
|
||||
component: {
|
||||
placeholder: "21",
|
||||
|
||||
@@ -165,10 +165,16 @@ export class AsyncSsh2Client {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param script
|
||||
* @param opts {withStdErr 返回{stdOut,stdErr}}
|
||||
*/
|
||||
async exec(
|
||||
script: string,
|
||||
opts: {
|
||||
throwOnStdErr?: boolean;
|
||||
withStdErr?: boolean;
|
||||
env?: any;
|
||||
} = {}
|
||||
): Promise<string> {
|
||||
@@ -193,6 +199,7 @@ export class AsyncSsh2Client {
|
||||
return;
|
||||
}
|
||||
let data = "";
|
||||
let stdErr = "";
|
||||
let hasErrorLog = false;
|
||||
stream
|
||||
.on("close", (code: any, signal: any) => {
|
||||
@@ -205,7 +212,15 @@ export class AsyncSsh2Client {
|
||||
}
|
||||
|
||||
if (code === 0) {
|
||||
resolve(data);
|
||||
if (opts.withStdErr === true) {
|
||||
//@ts-ignore
|
||||
resolve({
|
||||
stdErr,
|
||||
stdOut: data,
|
||||
});
|
||||
} else {
|
||||
resolve(data);
|
||||
}
|
||||
} else {
|
||||
reject(new Error(data));
|
||||
}
|
||||
@@ -221,7 +236,7 @@ export class AsyncSsh2Client {
|
||||
})
|
||||
.stderr.on("data", (ret: Buffer) => {
|
||||
const err = this.convert(iconv, ret);
|
||||
data += err;
|
||||
stdErr += err;
|
||||
hasErrorLog = true;
|
||||
this.logger.error(`[${this.connConf.host}][error]: ` + err.trimEnd());
|
||||
});
|
||||
@@ -323,9 +338,6 @@ export class AsyncSsh2Client {
|
||||
|
||||
export class SshClient {
|
||||
logger: ILogger;
|
||||
constructor(logger: ILogger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param connectConf
|
||||
@@ -382,6 +394,9 @@ export class SshClient {
|
||||
},
|
||||
});
|
||||
}
|
||||
constructor(logger: ILogger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
async scpUpload(options: { conn: any; localPath: string; remotePath: string; opts?: { mode?: string } }) {
|
||||
const { conn, localPath, remotePath } = options;
|
||||
|
||||
@@ -49,10 +49,23 @@ export class TencentSslClient {
|
||||
};
|
||||
const ret = await client.UploadCertificate(params);
|
||||
this.checkRet(ret);
|
||||
this.logger.info("证书上传成功:tencentCertId=", ret.CertificateId);
|
||||
this.logger.info(`证书[${opts.certName}]上传成功:tencentCertId=`, ret.CertificateId);
|
||||
await this.switchCertNotify([ret.CertificateId], true);
|
||||
return ret.CertificateId;
|
||||
}
|
||||
|
||||
async switchCertNotify(certIds: string[], disabled: boolean) {
|
||||
const client = await this.getSslClient();
|
||||
const params = {
|
||||
CertificateIds: certIds,
|
||||
SwitchStatus: disabled ? 1 : 0, //1是忽略通知,0是不忽略
|
||||
};
|
||||
const ret = await client.ModifyCertificatesExpiringNotificationSwitch(params);
|
||||
this.checkRet(ret);
|
||||
this.logger.info(`关闭证书${certIds}过期通知成功`);
|
||||
return ret.RequestId;
|
||||
}
|
||||
|
||||
async deployCertificateInstance(params: any) {
|
||||
const client = await this.getSslClient();
|
||||
const res = await client.DeployCertificateInstance(params);
|
||||
|
||||
@@ -3,6 +3,72 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.34.10](https://github.com/certd/certd/compare/v1.34.9...v1.34.10) (2025-06-03)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化流水线名称过长时的显示 ([6a0cc1b](https://github.com/certd/certd/commit/6a0cc1b1f3ad508f9e4093b3b682b163f12389eb))
|
||||
|
||||
## [1.34.9](https://github.com/certd/certd/compare/v1.34.8...v1.34.9) (2025-05-30)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 邮箱支持保存和选择 ([f7b0b44](https://github.com/certd/certd/commit/f7b0b44ef6044bec36510a6f0b06d8dca5bfce49))
|
||||
* 支持github 新版本检查并发布通知 ([356703c](https://github.com/certd/certd/commit/356703c83ea18c6efb8931402e181280d7b7e696))
|
||||
|
||||
## [1.34.8](https://github.com/certd/certd/compare/v1.34.7...v1.34.8) (2025-05-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复证书申请任务无法修改dns提供商类型的bug ([8802274](https://github.com/certd/certd/commit/88022747bebe2054223e0241d68d410771405e68))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 优化站点选择组件,切换选择时不刷新列表 ([3a14714](https://github.com/certd/certd/commit/3a147141b1a5d67c92a5ce88a5313eaa62859e03))
|
||||
* 优化站点ip检查 ([a463711](https://github.com/certd/certd/commit/a463711b03a20120f2a298be15d71ca152d27f21))
|
||||
* 站点监控支持监控IP ([9cc4c01](https://github.com/certd/certd/commit/9cc4c017ae646a18284e732769b82636feda01d3))
|
||||
* 支持批量重新运行 ([8189982](https://github.com/certd/certd/commit/818998259ddc75e722196ac5c365038818539b9b))
|
||||
|
||||
## [1.34.7](https://github.com/certd/certd/compare/v1.34.6...v1.34.7) (2025-05-26)
|
||||
|
||||
**Note:** Version bump only for package @certd/ui-client
|
||||
|
||||
## [1.34.6](https://github.com/certd/certd/compare/v1.34.5...v1.34.6) (2025-05-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug ([7984b62](https://github.com/certd/certd/commit/7984b625ba6727132f205db8e25f790bce27b2f7))
|
||||
* **cert:** 修正证书过期时间计算逻辑 ([a3086e6](https://github.com/certd/certd/commit/a3086e6a5bec8b07f5e1d21a2ca8bd969c75bd5c))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 二次认证页面中,添加动态验证码输入框的焦点控制,提升用户体验 ([bb22f06](https://github.com/certd/certd/commit/bb22f062ed4ab4b5b71938270fe4cc666af6b8e7))
|
||||
* 站点证书监控增加通知设置 ([3422a1a](https://github.com/certd/certd/commit/3422a1a59fd0d2c0f17fa9c7e8988ac527ecfdd9))
|
||||
|
||||
## [1.34.5](https://github.com/certd/certd/compare/v1.34.4...v1.34.5) (2025-05-19)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* aaWaf、cdnfly站点选择支持查询 ([8af3463](https://github.com/certd/certd/commit/8af3463668a40b9b99febb02e3b4e0d9d8d719b4))
|
||||
|
||||
## [1.34.4](https://github.com/certd/certd/compare/v1.34.3...v1.34.4) (2025-05-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复插件导入的bug ([677fec0](https://github.com/certd/certd/commit/677fec0a0b6fceb4966705e471bbfeeda91610c7))
|
||||
* 修复自建插件保存丢失部署策略的bug ([863e74d](https://github.com/certd/certd/commit/863e74dd2e3912f950ff5025b5ed0070aeb37035))
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 调整小助手,仅在登录之后显示 ([aebb07c](https://github.com/certd/certd/commit/aebb07c5cc8b1f233b9d203ff017ac60e6971a85))
|
||||
|
||||
## [1.34.3](https://github.com/certd/certd/compare/v1.34.2...v1.34.3) (2025-05-15)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 小助手可以关闭 ([3e2101a](https://github.com/certd/certd/commit/3e2101aa5b56548614102e900d59819ce8c7e97c))
|
||||
* 支持AI分析报错 ([aa96859](https://github.com/certd/certd/commit/aa96859798166426e485947a6590464de189de05))
|
||||
|
||||
## [1.34.2](https://github.com/certd/certd/compare/v1.34.1...v1.34.2) (2025-05-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.34.2",
|
||||
"version": "1.34.10",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -102,8 +102,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.34.2",
|
||||
"@certd/pipeline": "^1.34.2",
|
||||
"@certd/lib-iframe": "^1.34.10",
|
||||
"@certd/pipeline": "^1.34.10",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@types/chai": "^4.3.12",
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<FsFormProvider>
|
||||
<contextHolder />
|
||||
<router-view />
|
||||
<MaxKBChat ref="chatBox" />
|
||||
</FsFormProvider>
|
||||
</AConfigProvider>
|
||||
</template>
|
||||
@@ -22,7 +21,7 @@ import AConfigProvider from "ant-design-vue/es/config-provider";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import MaxKBChat from "/@/components/ai/index.vue";
|
||||
import { util } from "/@/utils";
|
||||
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
defineOptions({
|
||||
name: "App",
|
||||
});
|
||||
@@ -49,6 +48,7 @@ localeChanged("zh-cn");
|
||||
provide("fn:router.reload", reload);
|
||||
provide("fn:locale.changed", localeChanged);
|
||||
|
||||
|
||||
const { isDark } = usePreferences();
|
||||
const { tokens } = useAntdDesignTokens();
|
||||
|
||||
@@ -73,9 +73,5 @@ const tokenTheme = computed(() => {
|
||||
// const settingStore = useSettingStore();
|
||||
// settingStore.init();
|
||||
|
||||
const chatBox = ref();
|
||||
onMounted(async () => {
|
||||
// await util.sleep(5000);
|
||||
// await chatBox.value.openChat({ q: "hello" });
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -140,7 +140,7 @@ function createRequestFunction(service: any) {
|
||||
headers: {
|
||||
"Content-Type": get(config, "headers.Content-Type", "application/json"),
|
||||
},
|
||||
timeout: 20000,
|
||||
timeout: 30000,
|
||||
baseURL: env.API,
|
||||
data: {},
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 聊天按钮 -->
|
||||
<div v-show="!chatVisible" class="maxkb-chat-button" :style="buttonPosition" @click="toggleChat">
|
||||
<div v-show="!chatVisible" class="maxkb-chat-button" @click="toggleChat">
|
||||
<img src="https://maxkb.handfree.work/ui/MaxKB.gif" />
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,10 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
async function openChat(req: { q: string }) {
|
||||
showGuide.value = true;
|
||||
if (!req.q) {
|
||||
return;
|
||||
}
|
||||
chatVisible.value = true;
|
||||
|
||||
const iframeId = "maxkb-chat";
|
||||
|
||||
@@ -132,7 +135,13 @@ async function openChat(req: { q: string }) {
|
||||
throw new Error("iframe not found");
|
||||
return;
|
||||
}
|
||||
iframe.contentWindow?.postMessage(req, "*");
|
||||
iframe.contentWindow?.postMessage(
|
||||
{
|
||||
...req,
|
||||
from: "certd",
|
||||
},
|
||||
"*"
|
||||
);
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
@@ -227,10 +236,10 @@ defineExpose({
|
||||
#maxkb .maxkb-tips .maxkb-button button::after {
|
||||
border: none;
|
||||
}
|
||||
#maxkb .maxkb-tips . {
|
||||
#maxkb .maxkb-tips {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 20px;
|
||||
//top: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#maxkb-chat-container {
|
||||
@@ -248,7 +257,7 @@ defineExpose({
|
||||
|
||||
#maxkb .maxkb-chat-button {
|
||||
position: fixed;
|
||||
right: 0px;
|
||||
right: 10px;
|
||||
bottom: 30px;
|
||||
cursor: pointer;
|
||||
z-index: 10000;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
export async function EmailList() {
|
||||
return await request({
|
||||
url: "/mine/email/list",
|
||||
method: "post",
|
||||
data: {},
|
||||
});
|
||||
}
|
||||
|
||||
export async function EmailDelete(email: string) {
|
||||
return await request({
|
||||
url: "/mine/email/delete",
|
||||
method: "post",
|
||||
data: {
|
||||
email: email,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function EmailAdd(email: string) {
|
||||
return await request({
|
||||
url: "/mine/email/add",
|
||||
method: "post",
|
||||
data: {
|
||||
email: email,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<a-select :options="emails">
|
||||
<template #option="{ value: val }">
|
||||
<div class="flex flex-row w-full">
|
||||
<span class="flex-1">{{ val }}</span>
|
||||
<fs-icon class="ml-5" icon="ion:close" @click="deleteItem(val)"></fs-icon>
|
||||
</div>
|
||||
</template>
|
||||
<template #dropdownRender="{ menuNode: menu }">
|
||||
<v-nodes :vnodes="menu" />
|
||||
<a-divider style="margin: 4px 0" />
|
||||
<div class="w-full flex flex-row p-5">
|
||||
<a-input ref="inputRef" v-model:value="newEmail" class="flex-1" placeholder="添加新邮箱" @keydown.enter="addItem" />
|
||||
<a-button class="ml-5" type="primary" @click="addItem">
|
||||
<template #icon>
|
||||
<plus-outlined />
|
||||
</template>
|
||||
添加邮箱
|
||||
</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineComponent, onMounted, ref } from "vue";
|
||||
import * as api from "./api";
|
||||
import { Modal, notification } from "ant-design-vue";
|
||||
|
||||
const props = defineProps<{}>();
|
||||
const VNodes = defineComponent({
|
||||
props: {
|
||||
vnodes: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
render() {
|
||||
return this.vnodes;
|
||||
},
|
||||
});
|
||||
|
||||
const newEmail = ref("");
|
||||
const emails = ref([]);
|
||||
|
||||
onMounted(async () => {
|
||||
const list = await api.EmailList();
|
||||
emails.value = list.map((item: string) => {
|
||||
return {
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
async function addItem() {
|
||||
const email = newEmail.value;
|
||||
//验证邮箱格式
|
||||
if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(newEmail.value)) {
|
||||
notification.error({
|
||||
message: "请填写正确的邮箱地址",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
debugger;
|
||||
if (emails.value.find(item => item.value === email)) {
|
||||
notification.warning({
|
||||
message: "此邮箱已存在",
|
||||
});
|
||||
return;
|
||||
}
|
||||
await api.EmailAdd(email);
|
||||
emails.value.unshift({
|
||||
value: email,
|
||||
label: email,
|
||||
});
|
||||
newEmail.value = "";
|
||||
}
|
||||
|
||||
async function deleteItem(value: string) {
|
||||
Modal.confirm({
|
||||
title: "删除邮箱",
|
||||
content: "确定要删除此邮箱吗?",
|
||||
onOk: async () => {
|
||||
await api.EmailDelete(value);
|
||||
emails.value = emails.value.filter(item => item.value !== value);
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -13,13 +13,16 @@ import ExpiresTimeText from "./expires-time-text.vue";
|
||||
import FileInput from "./file-input.vue";
|
||||
import PemInput from "./pem-input.vue";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
import NotificationSelector from "../views/certd/notification/notification-selector/index.vue";
|
||||
import EmailSelector from "./email-selector/index.vue";
|
||||
export default {
|
||||
install(app: any) {
|
||||
app.component(
|
||||
"CodeEditor",
|
||||
defineAsyncComponent(() => import("./code-editor/index.vue"))
|
||||
);
|
||||
|
||||
app.component("EmailSelector", EmailSelector);
|
||||
app.component("NotificationSelector", NotificationSelector);
|
||||
app.component("PiContainer", PiContainer);
|
||||
app.component("TextEditable", TextEditable);
|
||||
app.component("FileInput", FileInput);
|
||||
|
||||
@@ -18,7 +18,7 @@ const props = defineProps<{
|
||||
modelValue: string;
|
||||
title: string;
|
||||
action: string;
|
||||
form: any;
|
||||
form?: any;
|
||||
button?: any;
|
||||
}>();
|
||||
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
<template>
|
||||
<div class="remote-select">
|
||||
<div class="flex flex-row">
|
||||
<a-select class="remote-select-input" show-search :filter-option="filterOption" :options="optionsRef" :value="value" v-bind="attrs" @click="onClick" @update:value="emit('update:value', $event)" />
|
||||
<a-select class="remote-select-input" show-search :filter-option="filterOption" :options="optionsRef" :value="value" v-bind="attrs" @click="onClick" @update:value="emit('update:value', $event)">
|
||||
<template #dropdownRender="{ menuNode: menu }">
|
||||
<template v-if="search">
|
||||
<div class="flex w-full" style="padding: 4px 8px">
|
||||
<a-input ref="inputRef" v-model:value="searchKeyRef" class="flex-1" allow-clear placeholder="查询关键字" @keydown.enter="doSearch" />
|
||||
<a-button class="ml-2" :loading="loading" type="text" @click="doSearch">
|
||||
<template #icon>
|
||||
<search-outlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
</div>
|
||||
<div v-if="hasError" class="helper p-2" :class="{ error: hasError }">
|
||||
{{ message }}
|
||||
</div>
|
||||
<a-divider style="margin: 4px 0" />
|
||||
</template>
|
||||
<v-nodes :vnodes="menu" />
|
||||
|
||||
<div v-if="pager === true" class="pager text-center p-5">
|
||||
<a-pagination v-model:current="pagerRef.current" simple :total="pagerRef.total" :page-size="pagerRef.limit" />
|
||||
</div>
|
||||
</template>
|
||||
</a-select>
|
||||
<div class="ml-5">
|
||||
<fs-button :loading="loading" title="刷新选项" icon="ion:refresh-outline" @click="refreshOptions"></fs-button>
|
||||
</div>
|
||||
@@ -13,16 +36,30 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
|
||||
import { inject, ref, useAttrs, watch } from "vue";
|
||||
import { defineComponent, inject, ref, useAttrs, watch, Ref } from "vue";
|
||||
import { PluginDefine } from "@certd/pipeline";
|
||||
|
||||
defineOptions({
|
||||
name: "RemoteSelect",
|
||||
});
|
||||
|
||||
const VNodes = defineComponent({
|
||||
props: {
|
||||
vnodes: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
render() {
|
||||
return this.vnodes;
|
||||
},
|
||||
});
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
watches: string[];
|
||||
search?: boolean;
|
||||
pager?: boolean;
|
||||
} & ComponentPropsType
|
||||
>();
|
||||
|
||||
@@ -36,10 +73,14 @@ const getCurrentPluginDefine: any = inject("getCurrentPluginDefine");
|
||||
const getScope: any = inject("get:scope");
|
||||
const getPluginType: any = inject("get:plugin:type");
|
||||
|
||||
const searchKeyRef = ref("");
|
||||
const optionsRef = ref([]);
|
||||
const message = ref("");
|
||||
const hasError = ref(false);
|
||||
const loading = ref(false);
|
||||
const pagerRef: Ref = ref({
|
||||
current: 1,
|
||||
});
|
||||
const getOptions = async () => {
|
||||
if (loading.value) {
|
||||
return;
|
||||
@@ -74,6 +115,7 @@ const getOptions = async () => {
|
||||
loading.value = true;
|
||||
optionsRef.value = [];
|
||||
|
||||
const offset = (pagerRef.value.current - 1) * (pagerRef.value.limit ?? 100);
|
||||
try {
|
||||
const res = await doRequest(
|
||||
{
|
||||
@@ -81,6 +123,11 @@ const getOptions = async () => {
|
||||
typeName: form.type,
|
||||
action: props.action,
|
||||
input,
|
||||
data: {
|
||||
searchKey: props.search ? searchKeyRef.value : "",
|
||||
offset: offset,
|
||||
limit: pagerRef.value.limit,
|
||||
},
|
||||
},
|
||||
{
|
||||
onError(err: any) {
|
||||
@@ -90,10 +137,26 @@ const getOptions = async () => {
|
||||
showErrorNotify: false,
|
||||
}
|
||||
);
|
||||
if (res && res.length > 0) {
|
||||
const list = res?.list || res || [];
|
||||
if (list.length > 0) {
|
||||
message.value = "获取数据成功,请从下拉框中选择";
|
||||
}
|
||||
optionsRef.value = res;
|
||||
optionsRef.value = list;
|
||||
pagerRef.value.total = list.length;
|
||||
if (props.pager) {
|
||||
if (res.offset != null) {
|
||||
pagerRef.value.offset = res.offset ?? 0;
|
||||
}
|
||||
if (res.limit != null) {
|
||||
pagerRef.value.limit = res.limit ?? 100;
|
||||
}
|
||||
if (res.total != null) {
|
||||
pagerRef.value.total = res.total ?? list.length;
|
||||
}
|
||||
const { offset, limit } = pagerRef.value;
|
||||
pagerRef.value.current = offset % limit === 0 ? offset / limit + 1 : offset / limit;
|
||||
}
|
||||
|
||||
return res;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
@@ -114,24 +177,38 @@ async function refreshOptions() {
|
||||
await getOptions();
|
||||
}
|
||||
|
||||
async function doSearch() {
|
||||
pagerRef.value.current = 1;
|
||||
await refreshOptions();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => {
|
||||
const values = [];
|
||||
|
||||
const pluginType = getPluginType();
|
||||
const { form } = getScope();
|
||||
const { form, key } = getScope();
|
||||
const input = pluginType === "plugin" ? form.input : form;
|
||||
|
||||
for (const item of props.watches) {
|
||||
values.push(input[item]);
|
||||
const watches = {};
|
||||
for (const key of props.watches) {
|
||||
watches[key] = input[key];
|
||||
}
|
||||
return {
|
||||
form: input,
|
||||
watched: values,
|
||||
form: watches,
|
||||
key,
|
||||
};
|
||||
},
|
||||
async () => {
|
||||
await getOptions();
|
||||
async (value, oldValue) => {
|
||||
const { form } = value;
|
||||
const oldForm = oldValue.form;
|
||||
let changed = oldForm == null || optionsRef.value.length == 0;
|
||||
for (const key of props.watches) {
|
||||
if (form[key] != oldForm[key]) {
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
await getOptions();
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
|
||||
@@ -4,7 +4,7 @@ export async function doActive(form: any) {
|
||||
return await request({
|
||||
url: "/sys/plus/active",
|
||||
method: "post",
|
||||
data: form
|
||||
data: form,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ export async function getVipTrial() {
|
||||
return await request({
|
||||
url: "/sys/plus/getVipTrial",
|
||||
method: "post",
|
||||
data: {}
|
||||
data: {},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<script lang="ts" setup>
|
||||
import { BasicLayout, LockScreen, UserDropdown } from "/@/vben/layouts";
|
||||
|
||||
import { computed, onErrorCaptured, onMounted } from "vue";
|
||||
import { preferences } from "/@/vben/preferences";
|
||||
import { useAccessStore } from "/@/vben/stores";
|
||||
import { computed, onErrorCaptured, onMounted, provide, ref } from "vue";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import VipButton from "/@/components/vip-button/index.vue";
|
||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import PageFooter from "./components/footer/index.vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import MaxKBChat from "/@/components/ai/index.vue";
|
||||
|
||||
const userStore = useUserStore();
|
||||
const accessStore = useAccessStore();
|
||||
|
||||
const router = useRouter();
|
||||
const menus = computed(() => [
|
||||
@@ -22,6 +21,13 @@ const menus = computed(() => [
|
||||
icon: "fa-solid:book",
|
||||
text: "账号信息",
|
||||
},
|
||||
{
|
||||
handler: () => {
|
||||
router.push("/certd/mine/security");
|
||||
},
|
||||
icon: "fluent:shield-keyhole-16-regular",
|
||||
text: "认证安全设置",
|
||||
},
|
||||
]);
|
||||
|
||||
const avatar = computed(() => {
|
||||
@@ -52,6 +58,16 @@ onErrorCaptured(e => {
|
||||
onMounted(async () => {
|
||||
await settingStore.checkUrlBound();
|
||||
});
|
||||
|
||||
function goGithub() {
|
||||
window.open("https://github.com/certd/certd");
|
||||
}
|
||||
const settingsStore = useSettingStore();
|
||||
const chatBox = ref();
|
||||
const openChat = (q: string) => {
|
||||
chatBox.value.openChat({ q });
|
||||
};
|
||||
provide("fn:ai.open", openChat);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -63,18 +79,19 @@ onMounted(async () => {
|
||||
<LockScreen :avatar @to-login="handleLogout" />
|
||||
</template>
|
||||
<template #header-right-0>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
|
||||
<tutorial-button v-if="!settingStore.isComm" class="flex-center header-btn" />
|
||||
<div v-if="!settingStore.isComm" class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
|
||||
<tutorial-button class="flex-center header-btn" />
|
||||
</div>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<vip-button class="flex-center header-btn" mode="nav" />
|
||||
</div>
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<fs-icon icon="ion:logo-github" />
|
||||
<div v-if="!settingStore.isComm" class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<fs-button shape="circle" type="text" icon="ion:logo-github" :text="null" @click="goGithub" />
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<PageFooter></PageFooter>
|
||||
<MaxKBChat v-if="settingsStore.sysPublic.aiChatEnabled !== false" ref="chatBox" />
|
||||
</template>
|
||||
</BasicLayout>
|
||||
</template>
|
||||
|
||||
@@ -111,6 +111,11 @@ function install(app: App, options: any = {}) {
|
||||
columnSizeSaver.clear();
|
||||
},
|
||||
},
|
||||
buttons: {
|
||||
export: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
fixed: "right",
|
||||
|
||||
@@ -143,6 +143,17 @@ export const certdResources = [
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "站点监控设置",
|
||||
name: "SiteMonitorSetting",
|
||||
path: "/certd/monitor/setting",
|
||||
component: "/certd/monitor/site/setting/index.vue",
|
||||
meta: {
|
||||
icon: "ion:videocam-outline",
|
||||
auth: true,
|
||||
isMenu: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "认证安全设置",
|
||||
name: "UserSecurity",
|
||||
|
||||
@@ -41,6 +41,7 @@ export type SysPublicSetting = {
|
||||
icpNo?: string;
|
||||
mpsNo?: string;
|
||||
robots?: boolean;
|
||||
aiChatEnabled?: boolean;
|
||||
};
|
||||
export type SuiteSetting = {
|
||||
enabled?: boolean;
|
||||
@@ -115,6 +116,6 @@ export async function getProductInfo(): Promise<any> {
|
||||
return await request({
|
||||
url: "/basic/settings/productInfo",
|
||||
method: "get",
|
||||
silent: true,
|
||||
showErrorNotify: false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,4 +65,10 @@ footer{
|
||||
.ant-select-multiple .ant-select-selection-item-remove{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.ant-progress.ant-progress-show-info .ant-progress-outer {
|
||||
margin-inline-end: calc(-3em - 8px);
|
||||
padding-inline-end: calc(3em + 8px);
|
||||
}
|
||||
@@ -488,7 +488,7 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
|
||||
</template>
|
||||
</LayoutContent>
|
||||
|
||||
<LayoutFooter v-if="footerEnable" class="hidden md:block" :fixed="footerFixed" :height="footerHeight" :show="!isFullContent" :width="footerWidth" :z-index="zIndex">
|
||||
<LayoutFooter v-if="footerEnable" class="hidden md:block" :fixed="footerFixed" :height="footerHeight" :show="!isFullContent" :width="footerWidth" :z-index="zIndex + 2">
|
||||
<slot name="footer"></slot>
|
||||
</LayoutFooter>
|
||||
</div>
|
||||
|
||||
@@ -18,11 +18,11 @@ interface Props {
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
name: "LayoutHeader"
|
||||
name: "LayoutHeader",
|
||||
});
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
theme: "light"
|
||||
theme: "light",
|
||||
});
|
||||
|
||||
const emit = defineEmits<{ clearPreferencesAndLogout: [] }>();
|
||||
@@ -39,42 +39,42 @@ const rightSlots = computed(() => {
|
||||
if (preferences.widget.globalSearch) {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE,
|
||||
name: "global-search"
|
||||
name: "global-search",
|
||||
});
|
||||
}
|
||||
|
||||
if (preferencesButtonPosition.value.header) {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE + 10,
|
||||
name: "preferences"
|
||||
name: "preferences",
|
||||
});
|
||||
}
|
||||
if (preferences.widget.themeToggle) {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE + 20,
|
||||
name: "theme-toggle"
|
||||
name: "theme-toggle",
|
||||
});
|
||||
}
|
||||
if (preferences.widget.languageToggle) {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE + 30,
|
||||
name: "language-toggle"
|
||||
name: "language-toggle",
|
||||
});
|
||||
}
|
||||
if (preferences.widget.fullscreen) {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE + 40,
|
||||
name: "fullscreen"
|
||||
name: "fullscreen",
|
||||
});
|
||||
}
|
||||
if (preferences.widget.notification) {
|
||||
list.push({
|
||||
index: REFERENCE_VALUE + 50,
|
||||
name: "notification"
|
||||
name: "notification",
|
||||
});
|
||||
}
|
||||
|
||||
Object.keys(slots).forEach((key) => {
|
||||
Object.keys(slots).forEach(key => {
|
||||
const name = key.split("-");
|
||||
if (key.startsWith("header-right")) {
|
||||
list.push({ index: Number(name[2]), name: key });
|
||||
@@ -89,11 +89,11 @@ const leftSlots = computed(() => {
|
||||
if (preferences.widget.refresh) {
|
||||
list.push({
|
||||
index: 0,
|
||||
name: "refresh"
|
||||
name: "refresh",
|
||||
});
|
||||
}
|
||||
|
||||
Object.keys(slots).forEach((key) => {
|
||||
Object.keys(slots).forEach(key => {
|
||||
const name = key.split("-");
|
||||
if (key.startsWith("header-left")) {
|
||||
list.push({ index: Number(name[2]), name: key });
|
||||
@@ -108,7 +108,7 @@ function clearPreferencesAndLogout() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-for="slot in leftSlots.filter((item) => item.index < REFERENCE_VALUE)" :key="slot.name">
|
||||
<template v-for="slot in leftSlots.filter(item => item.index < REFERENCE_VALUE)" :key="slot.name">
|
||||
<slot :name="slot.name">
|
||||
<template v-if="slot.name === 'refresh'">
|
||||
<VbenIconButton class="my-0 mr-1 rounded-md" @click="refresh">
|
||||
@@ -120,7 +120,7 @@ function clearPreferencesAndLogout() {
|
||||
<div class="flex-center hidden lg:block">
|
||||
<slot name="breadcrumb"></slot>
|
||||
</div>
|
||||
<template v-for="slot in leftSlots.filter((item) => item.index > REFERENCE_VALUE)" :key="slot.name">
|
||||
<template v-for="slot in leftSlots.filter(item => item.index > REFERENCE_VALUE)" :key="slot.name">
|
||||
<slot :name="slot.name"></slot>
|
||||
</template>
|
||||
<div :class="`menu-align-${preferences.header.menuAlign}`" class="flex h-full min-w-0 flex-1 items-center">
|
||||
|
||||
@@ -9,15 +9,15 @@ import { preferences, updatePreferences } from "/@/vben/preferences";
|
||||
import { VbenDropdownRadioMenu, VbenIconButton } from "/@/vben//shadcn-ui";
|
||||
|
||||
defineOptions({
|
||||
name: "LanguageToggle"
|
||||
name: "LanguageToggle",
|
||||
});
|
||||
|
||||
async function handleUpdate(value: string) {
|
||||
const locale = value as SupportedLanguagesType;
|
||||
updatePreferences({
|
||||
app: {
|
||||
locale
|
||||
}
|
||||
locale,
|
||||
},
|
||||
});
|
||||
await loadLocaleMessages(locale);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ interface Props {
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
name: "ThemeToggleButton"
|
||||
name: "ThemeToggleButton",
|
||||
});
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
type: "normal"
|
||||
type: "normal",
|
||||
});
|
||||
|
||||
const isDark = defineModel<boolean>();
|
||||
@@ -29,13 +29,13 @@ const bindProps = computed(() => {
|
||||
|
||||
return type === "normal"
|
||||
? {
|
||||
variant: "heavy" as const
|
||||
variant: "heavy" as const,
|
||||
}
|
||||
: {
|
||||
class: "rounded-full",
|
||||
size: "icon" as const,
|
||||
style: { padding: "7px" },
|
||||
variant: "icon" as const
|
||||
variant: "icon" as const,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -59,12 +59,12 @@ function toggleTheme(event: MouseEvent) {
|
||||
const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${endRadius}px at ${x}px ${y}px)`];
|
||||
document.documentElement.animate(
|
||||
{
|
||||
clipPath: isDark.value ? [...clipPath].reverse() : clipPath
|
||||
clipPath: isDark.value ? [...clipPath].reverse() : clipPath,
|
||||
},
|
||||
{
|
||||
duration: 450,
|
||||
easing: "ease-in",
|
||||
pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)"
|
||||
pseudoElement: isDark.value ? "::view-transition-old(root)" : "::view-transition-new(root)",
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -10,16 +10,16 @@ import { ToggleGroup, ToggleGroupItem, VbenTooltip } from "/@/vben//shadcn-ui";
|
||||
import ThemeButton from "./theme-button.vue";
|
||||
|
||||
defineOptions({
|
||||
name: "ThemeToggle"
|
||||
name: "ThemeToggle",
|
||||
});
|
||||
|
||||
withDefaults(defineProps<{ shouldOnHover?: boolean }>(), {
|
||||
shouldOnHover: false
|
||||
shouldOnHover: false,
|
||||
});
|
||||
|
||||
function handleChange(isDark: boolean) {
|
||||
updatePreferences({
|
||||
theme: { mode: isDark ? "dark" : "light" }
|
||||
theme: { mode: isDark ? "dark" : "light" },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,18 +29,18 @@ const PRESETS = [
|
||||
{
|
||||
icon: Sun,
|
||||
name: "light",
|
||||
title: $t("preferences.theme.light")
|
||||
title: $t("preferences.theme.light"),
|
||||
},
|
||||
{
|
||||
icon: MoonStar,
|
||||
name: "dark",
|
||||
title: $t("preferences.theme.dark")
|
||||
title: $t("preferences.theme.dark"),
|
||||
},
|
||||
{
|
||||
icon: SunMoon,
|
||||
name: "auto",
|
||||
title: $t("preferences.followSystem")
|
||||
}
|
||||
title: $t("preferences.followSystem"),
|
||||
},
|
||||
];
|
||||
</script>
|
||||
<template>
|
||||
@@ -49,7 +49,7 @@ const PRESETS = [
|
||||
<template #trigger>
|
||||
<ThemeButton :model-value="isDark" type="icon" @update:model-value="handleChange" />
|
||||
</template>
|
||||
<ToggleGroup :model-value="preferences.theme.mode" class="gap-2" type="single" variant="outline" @update:model-value="(val) => updatePreferences({ theme: { mode: val as ThemeModeType } })">
|
||||
<ToggleGroup :model-value="preferences.theme.mode" class="gap-2" type="single" variant="outline" @update:model-value="val => updatePreferences({ theme: { mode: val as ThemeModeType } })">
|
||||
<ToggleGroupItem v-for="item in PRESETS" :key="item.name" :value="item.name">
|
||||
<component :is="item.icon" class="size-5" />
|
||||
</ToggleGroupItem>
|
||||
|
||||
@@ -18,7 +18,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
disabled: false,
|
||||
loading: false,
|
||||
size: "default",
|
||||
variant: "default"
|
||||
variant: "default",
|
||||
});
|
||||
|
||||
const isDisabled = computed(() => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import type { ButtonVariants } from '../../ui';
|
||||
import type { VbenButtonProps } from './button';
|
||||
import type { ButtonVariants } from "../../ui";
|
||||
import type { VbenButtonProps } from "./button";
|
||||
|
||||
import { computed, useSlots } from 'vue';
|
||||
import { computed, useSlots } from "vue";
|
||||
|
||||
import { cn } from '/@/vben/shared/utils';
|
||||
import { cn } from "/@/vben/shared/utils";
|
||||
|
||||
import { VbenTooltip } from '../tooltip';
|
||||
import VbenButton from './button.vue';
|
||||
import { VbenTooltip } from "../tooltip";
|
||||
import VbenButton from "./button.vue";
|
||||
|
||||
interface Props extends VbenButtonProps {
|
||||
class?: any;
|
||||
@@ -15,7 +15,7 @@ interface Props extends VbenButtonProps {
|
||||
onClick?: () => void;
|
||||
tooltip?: string;
|
||||
tooltipDelayDuration?: number;
|
||||
tooltipSide?: 'bottom' | 'left' | 'right' | 'top';
|
||||
tooltipSide?: "bottom" | "left" | "right" | "top";
|
||||
variant?: ButtonVariants;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
disabled: false,
|
||||
onClick: () => {},
|
||||
tooltipDelayDuration: 200,
|
||||
tooltipSide: 'bottom',
|
||||
variant: 'icon',
|
||||
tooltipSide: "bottom",
|
||||
variant: "icon",
|
||||
});
|
||||
|
||||
const slots = useSlots();
|
||||
@@ -33,30 +33,13 @@ const showTooltip = computed(() => !!slots.tooltip || !!props.tooltip);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VbenButton
|
||||
v-if="!showTooltip"
|
||||
:class="cn('rounded-full', props.class)"
|
||||
:disabled="disabled"
|
||||
:variant="variant"
|
||||
size="icon"
|
||||
@click="onClick"
|
||||
>
|
||||
<VbenButton v-if="!showTooltip" :class="cn('rounded-full', props.class)" :disabled="disabled" :variant="variant" size="icon" @click="onClick">
|
||||
<slot></slot>
|
||||
</VbenButton>
|
||||
|
||||
<VbenTooltip
|
||||
v-else
|
||||
:delay-duration="tooltipDelayDuration"
|
||||
:side="tooltipSide"
|
||||
>
|
||||
<VbenTooltip v-else :delay-duration="tooltipDelayDuration" :side="tooltipSide">
|
||||
<template #trigger>
|
||||
<VbenButton
|
||||
:class="cn('rounded-full', props.class)"
|
||||
:disabled="disabled"
|
||||
:variant="variant"
|
||||
size="icon"
|
||||
@click="onClick"
|
||||
>
|
||||
<VbenButton :class="cn('rounded-full', props.class)" :disabled="disabled" :variant="variant" size="icon" @click="onClick">
|
||||
<slot></slot>
|
||||
</VbenButton>
|
||||
</template>
|
||||
|
||||
@@ -11,13 +11,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
return "access";
|
||||
});
|
||||
const AccessTypeDictRef = dict({
|
||||
url: "/pi/access/accessTypeDict"
|
||||
url: "/pi/access/accessTypeDict",
|
||||
});
|
||||
const defaultPluginConfig = {
|
||||
component: {
|
||||
name: "a-input",
|
||||
vModel: "value"
|
||||
}
|
||||
vModel: "value",
|
||||
},
|
||||
};
|
||||
|
||||
function buildDefineFields(define: any, form: any, mode: string) {
|
||||
@@ -34,7 +34,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
const key = "access." + mapKey;
|
||||
const field = {
|
||||
...value,
|
||||
key
|
||||
key,
|
||||
};
|
||||
const column = merge({ title: key }, defaultPluginConfig, field);
|
||||
|
||||
@@ -77,13 +77,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
type: "dict-select",
|
||||
dict: AccessTypeDictRef,
|
||||
search: {
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
component: {
|
||||
color: "auto"
|
||||
}
|
||||
color: "auto",
|
||||
},
|
||||
},
|
||||
form: {
|
||||
component: {
|
||||
@@ -100,7 +100,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
{item.label}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: "请选择类型" }],
|
||||
valueChange: {
|
||||
@@ -116,7 +116,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
form.access = {};
|
||||
}
|
||||
buildDefineFields(define, form, mode);
|
||||
}
|
||||
},
|
||||
},
|
||||
helper: {
|
||||
render: () => {
|
||||
@@ -125,12 +125,12 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
return "";
|
||||
}
|
||||
return <div innerHTML={utils.transformLink(define.desc)}></div>;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
addForm: {
|
||||
value: typeRef
|
||||
}
|
||||
value: typeRef,
|
||||
},
|
||||
} as ColumnCompositionProps,
|
||||
setting: {
|
||||
column: { show: false },
|
||||
@@ -149,8 +149,8 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
valueResolve({ form }) {
|
||||
const setting = form.access;
|
||||
form.setting = JSON.stringify(setting);
|
||||
}
|
||||
}
|
||||
} as ColumnCompositionProps
|
||||
},
|
||||
},
|
||||
} as ColumnCompositionProps,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,10 +35,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
delRequest,
|
||||
},
|
||||
table: {
|
||||
remove: {
|
||||
confirmMessage: "授权如果已经被使用,可能会导致流水线无法正常运行,请谨慎操作",
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
width: 200
|
||||
width: 200,
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
@@ -46,24 +51,24 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 100
|
||||
width: 100,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
name: {
|
||||
title: "名称",
|
||||
type: "text",
|
||||
search: {
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
rules: [{ required: true, message: "必填项" }]
|
||||
rules: [{ required: true, message: "必填项" }],
|
||||
},
|
||||
column: {
|
||||
width: 300
|
||||
}
|
||||
width: 300,
|
||||
},
|
||||
},
|
||||
from: {
|
||||
title: "级别",
|
||||
@@ -71,29 +76,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "系统", value: "sys" },
|
||||
{ label: "用户", value: "user" }
|
||||
]
|
||||
{ label: "用户", value: "user" },
|
||||
],
|
||||
}),
|
||||
search: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
component: {
|
||||
color: "auto"
|
||||
color: "auto",
|
||||
},
|
||||
order: 10
|
||||
order: 10,
|
||||
},
|
||||
valueBuilder: ({ row, key, value }) => {
|
||||
row[key] = row.userId > 0 ? "user" : "sys";
|
||||
}
|
||||
},
|
||||
},
|
||||
...commonColumnsDefine
|
||||
}
|
||||
}
|
||||
...commonColumnsDefine,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,46 +44,46 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
props: {
|
||||
multiple: true,
|
||||
crossPage: true,
|
||||
selectedRowKeys
|
||||
}
|
||||
}
|
||||
}
|
||||
selectedRowKeys,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
delRequest,
|
||||
},
|
||||
actionbar: {
|
||||
buttons: {
|
||||
add: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
search: {
|
||||
formItem: {
|
||||
labelCol: {
|
||||
style: {
|
||||
// width: "100px"
|
||||
}
|
||||
},
|
||||
},
|
||||
wrapperCol: {
|
||||
style: {
|
||||
width: "50%"
|
||||
}
|
||||
}
|
||||
}
|
||||
width: "50%",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
minWidth: 200,
|
||||
fixed: "right",
|
||||
buttons: {
|
||||
edit: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
@@ -91,11 +91,11 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 100
|
||||
width: 100,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
userId: {
|
||||
title: "用户Id",
|
||||
@@ -103,69 +103,69 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
search: {
|
||||
show: computed(() => {
|
||||
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
||||
})
|
||||
}),
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: computed(() => {
|
||||
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
||||
}),
|
||||
width: 100
|
||||
}
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
pipelineId: {
|
||||
title: "流水线Id",
|
||||
type: "number",
|
||||
search: {
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100
|
||||
}
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
pipelineTitle: {
|
||||
title: "流水线名称",
|
||||
type: "text",
|
||||
search: {
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
column: {
|
||||
width: 300,
|
||||
tooltip: true,
|
||||
ellipsis: true,
|
||||
cellRender: ({ row, value }) => {
|
||||
return (
|
||||
<router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link>
|
||||
);
|
||||
}
|
||||
}
|
||||
return <router-link to={{ path: "/certd/pipeline/detail", query: { id: row.pipelineId, editMode: false, historyId: row.id } }}>{value}</router-link>;
|
||||
},
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: "创建时间",
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 160,
|
||||
align: "center"
|
||||
}
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
updateTime: {
|
||||
title: "更新时间",
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
show: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export const siteInfoApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query
|
||||
data: query,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ export const siteInfoApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ export const siteInfoApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj
|
||||
data: obj,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ export const siteInfoApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
|
||||
@@ -39,20 +39,41 @@ export const siteInfoApi = {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id }
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
async DoCheck(id: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/check",
|
||||
method: "post",
|
||||
data: { id }
|
||||
data: { id },
|
||||
});
|
||||
},
|
||||
async CheckAll() {
|
||||
return await request({
|
||||
url: apiPrefix + "/checkAll",
|
||||
method: "post"
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
async DisabledChange(id: number, disabled: boolean) {
|
||||
return await request({
|
||||
url: apiPrefix + "/disabledChange",
|
||||
method: "post",
|
||||
data: {
|
||||
id,
|
||||
disabled,
|
||||
},
|
||||
});
|
||||
},
|
||||
async IpCheckChange(id: number, ipCheck: boolean) {
|
||||
return await request({
|
||||
url: apiPrefix + "/ipCheckChange",
|
||||
method: "post",
|
||||
data: {
|
||||
id,
|
||||
ipCheck,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// @ts-ignore
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { AddReq, ColumnCompositionProps, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { siteInfoApi } from "./api";
|
||||
import dayjs from "dayjs";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { Modal, notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { mySuiteApi } from "/@/views/certd/suite/mine/api";
|
||||
import { mitter } from "/@/utils/util.mitt";
|
||||
import { useSiteIpMonitor } from "./ip/use";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { t } = useI18n();
|
||||
@@ -41,6 +42,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
{ label: "异常", value: "error", color: "red" },
|
||||
],
|
||||
});
|
||||
|
||||
const { openSiteIpMonitorDialog } = useSiteIpMonitor();
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
@@ -116,8 +119,27 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
});
|
||||
},
|
||||
},
|
||||
ipCheck: {
|
||||
order: 10,
|
||||
type: "link",
|
||||
text: null,
|
||||
show: compute(({ row }) => {
|
||||
return row.ipCheck === true;
|
||||
}),
|
||||
tooltip: {
|
||||
title: "IP管理",
|
||||
},
|
||||
icon: "entypo:address",
|
||||
click: async ({ row }) => {
|
||||
openSiteIpMonitorDialog({ siteId: row.id });
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tabs: {
|
||||
name: "disabled",
|
||||
show: true,
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
@@ -192,6 +214,34 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
certInfo: {
|
||||
title: "证书信息",
|
||||
type: "text",
|
||||
form: { show: false },
|
||||
column: {
|
||||
width: 200,
|
||||
sorter: false,
|
||||
show: true,
|
||||
conditionalRender: false,
|
||||
cellRender({ value, row }) {
|
||||
const slots = {
|
||||
content() {
|
||||
return (
|
||||
<div>
|
||||
<div>证书颁发机构:{row.certProvider}</div>
|
||||
<div>证书域名:{row.certDomains}</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
return (
|
||||
<a-popover placement="left" v-slots={slots} overlayStyle={{ maxWidth: "30%" }}>
|
||||
{row.certDomains}
|
||||
</a-popover>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
certDomains: {
|
||||
title: "证书域名",
|
||||
search: {
|
||||
@@ -204,7 +254,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
column: {
|
||||
width: 200,
|
||||
sorter: true,
|
||||
show: true,
|
||||
show: false,
|
||||
cellRender({ value }) {
|
||||
return (
|
||||
<a-tooltip title={value} placement="left">
|
||||
@@ -226,6 +276,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
column: {
|
||||
width: 200,
|
||||
sorter: true,
|
||||
show: false,
|
||||
cellRender({ value }) {
|
||||
return <a-tooltip title={value}>{value}</a-tooltip>;
|
||||
},
|
||||
@@ -305,6 +356,72 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
form: {
|
||||
value: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
sorter: true,
|
||||
align: "center",
|
||||
component: {
|
||||
name: "fs-dict-switch",
|
||||
vModel: "checked",
|
||||
on: {
|
||||
async change({ row, $event }) {
|
||||
await api.DisabledChange(row.id, $event);
|
||||
await crudExpose.doRefresh();
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ipCheck: {
|
||||
title: "开启IP检查",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "启用", value: true, color: "green" },
|
||||
{ label: "禁用", value: false, color: "gray" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
rules: [{ required: true, message: "请选择" }],
|
||||
},
|
||||
column: {
|
||||
align: "center",
|
||||
width: 100,
|
||||
conditionalRender: false,
|
||||
component: {
|
||||
name: "fs-dict-switch",
|
||||
vModel: "checked",
|
||||
on: {
|
||||
change({ row, $event }) {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: `确定${$event ? "开启" : "关闭"}IP检查?`,
|
||||
onOk: async () => {
|
||||
await api.IpCheckChange(row.id, $event);
|
||||
await crudExpose.doRefresh();
|
||||
if ($event) {
|
||||
openSiteIpMonitorDialog({ siteId: row.id });
|
||||
}
|
||||
},
|
||||
onCancel: async () => {
|
||||
await crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as ColumnCompositionProps,
|
||||
ipCount: {
|
||||
title: "IP数量",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
sorter: true,
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
<div class="title flex items-center">
|
||||
站点证书监控
|
||||
<div class="sub flex-1">
|
||||
<div>每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道);</div>
|
||||
<div>
|
||||
每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道);
|
||||
<router-link to="/certd/monitor/setting">站点监控设置</router-link>
|
||||
</div>
|
||||
<div class="flex items-center">基础版限制1条,专业版以上无限制,当前<vip-button class="ml-5" mode="nav"></vip-button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
const apiPrefix = "/monitor/site/ip";
|
||||
|
||||
export const siteIpApi = {
|
||||
async GetList(query: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/page",
|
||||
method: "post",
|
||||
data: query,
|
||||
});
|
||||
},
|
||||
|
||||
async AddObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/add",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
},
|
||||
|
||||
async UpdateObj(obj: any) {
|
||||
return await request({
|
||||
url: apiPrefix + "/update",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
},
|
||||
|
||||
async DelObj(id: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/delete",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
|
||||
async GetObj(id: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/info",
|
||||
method: "post",
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
async DoCheck(id: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/check",
|
||||
method: "post",
|
||||
data: { id },
|
||||
});
|
||||
},
|
||||
async CheckAll(siteId: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/checkAll",
|
||||
method: "post",
|
||||
data: {
|
||||
siteId,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async DoSync(siteId: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/sync",
|
||||
method: "post",
|
||||
data: {
|
||||
siteId,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,348 @@
|
||||
// @ts-ignore
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { siteIpApi } from "./api";
|
||||
import dayjs from "dayjs";
|
||||
import { Modal, notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const { t } = useI18n();
|
||||
const api = siteIpApi;
|
||||
|
||||
const { crudBinding } = crudExpose;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
if (!query.query) {
|
||||
query.query = {};
|
||||
}
|
||||
query.query.siteId = context.props.siteId;
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async (req: EditReq) => {
|
||||
const { form, row } = req;
|
||||
form.id = row.id;
|
||||
const res = await api.UpdateObj(form);
|
||||
return res;
|
||||
};
|
||||
const delRequest = async (req: DelReq) => {
|
||||
const { row } = req;
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
|
||||
const addRequest = async (req: AddReq) => {
|
||||
const { form } = req;
|
||||
form.siteId = context.props.siteId;
|
||||
const res = await api.AddObj(form);
|
||||
return res;
|
||||
};
|
||||
|
||||
const settingsStore = useSettingStore();
|
||||
|
||||
const checkStatusDict = dict({
|
||||
data: [
|
||||
{ label: "成功", value: "ok", color: "green" },
|
||||
{ label: "检查中", value: "checking", color: "blue" },
|
||||
{ label: "异常", value: "error", color: "red" },
|
||||
],
|
||||
});
|
||||
return {
|
||||
crudOptions: {
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest,
|
||||
},
|
||||
form: {
|
||||
labelCol: {
|
||||
//固定label宽度
|
||||
span: null,
|
||||
style: {
|
||||
width: "100px",
|
||||
},
|
||||
},
|
||||
col: {
|
||||
span: 22,
|
||||
},
|
||||
wrapper: {
|
||||
width: 600,
|
||||
},
|
||||
},
|
||||
actionbar: {
|
||||
buttons: {
|
||||
add: {
|
||||
async click() {
|
||||
await crudExpose.openAdd({});
|
||||
},
|
||||
},
|
||||
load: {
|
||||
text: "同步IP",
|
||||
type: "primary",
|
||||
async click() {
|
||||
Modal.confirm({
|
||||
title: "同步IP",
|
||||
content: "确定要同步IP吗?",
|
||||
onOk: async () => {
|
||||
await api.DoSync(context.props.siteId);
|
||||
await crudExpose.doRefresh();
|
||||
notification.success({
|
||||
message: "同步完成",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
checkAll: {
|
||||
text: "检查全部",
|
||||
type: "primary",
|
||||
click: () => {
|
||||
Modal.confirm({
|
||||
title: "确认",
|
||||
content: "确认触发检查全部IP站点的证书吗?",
|
||||
onOk: async () => {
|
||||
await siteIpApi.CheckAll(context.props.siteId);
|
||||
notification.success({
|
||||
message: "检查任务已提交",
|
||||
description: "请稍后刷新页面查看结果",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
fixed: "right",
|
||||
width: 240,
|
||||
buttons: {
|
||||
check: {
|
||||
order: 0,
|
||||
type: "link",
|
||||
text: null,
|
||||
tooltip: {
|
||||
title: "立即检查",
|
||||
},
|
||||
icon: "ion:play-sharp",
|
||||
click: async ({ row }) => {
|
||||
await api.DoCheck(row.id);
|
||||
await crudExpose.doRefresh();
|
||||
notification.success({
|
||||
message: "检查任务已提交",
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
columns: {
|
||||
id: {
|
||||
title: "ID",
|
||||
key: "id",
|
||||
type: "number",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 80,
|
||||
align: "center",
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
ipAddress: {
|
||||
title: "IP",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
type: "text",
|
||||
helper: "也支持填写CNAME域名",
|
||||
form: {
|
||||
rules: [{ required: true, message: "请输入IP" }],
|
||||
},
|
||||
column: {
|
||||
width: 160,
|
||||
},
|
||||
},
|
||||
certDomains: {
|
||||
title: "证书域名",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
sorter: true,
|
||||
show: false,
|
||||
cellRender({ value }) {
|
||||
return (
|
||||
<a-tooltip title={value} placement="left">
|
||||
{value}
|
||||
</a-tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
certProvider: {
|
||||
title: "颁发机构",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
show: false,
|
||||
sorter: true,
|
||||
cellRender({ value }) {
|
||||
return <a-tooltip title={value}>{value}</a-tooltip>;
|
||||
},
|
||||
},
|
||||
},
|
||||
certStatus: {
|
||||
title: "证书状态",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "正常", value: "ok", color: "green" },
|
||||
{ label: "过期", value: "expired", color: "red" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
sorter: true,
|
||||
show: true,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
certExpiresTime: {
|
||||
title: "证书到期时间",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "date",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
cellRender({ value }) {
|
||||
if (!value) {
|
||||
return "-";
|
||||
}
|
||||
const expireDate = dayjs(value).format("YYYY-MM-DD");
|
||||
const leftDays = dayjs(value).diff(dayjs(), "day");
|
||||
const color = leftDays < 20 ? "red" : "#389e0d";
|
||||
const percent = (leftDays / 90) * 100;
|
||||
return <a-progress title={expireDate + "过期"} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}天`} />;
|
||||
},
|
||||
},
|
||||
},
|
||||
checkStatus: {
|
||||
title: "检查状态",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "dict-select",
|
||||
dict: checkStatusDict,
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
align: "center",
|
||||
sorter: true,
|
||||
cellRender({ value, row, key }) {
|
||||
return (
|
||||
<a-tooltip title={row.error}>
|
||||
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
|
||||
</a-tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
lastCheckTime: {
|
||||
title: "上次检查时间",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "datetime",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
sorter: true,
|
||||
width: 155,
|
||||
},
|
||||
},
|
||||
from: {
|
||||
title: "来源",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "同步", value: "sync", color: "green" },
|
||||
{ label: "手动", value: "manual", color: "blue" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
sorter: true,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
disabled: {
|
||||
title: "禁用启用",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "启用", value: false, color: "green" },
|
||||
{ label: "禁用", value: true, color: "red" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
sorter: true,
|
||||
align: "center",
|
||||
},
|
||||
},
|
||||
remark: {
|
||||
title: "备注",
|
||||
search: {
|
||||
show: false,
|
||||
},
|
||||
type: "text",
|
||||
form: {
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
sorter: true,
|
||||
tooltip: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<div class="site-ip-dialog" style="height: 60vh">
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding"> </fs-crud>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onActivated, onMounted, ref, Ref } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { siteIpApi } from "./api";
|
||||
|
||||
defineOptions({
|
||||
name: "SiteIpCertMonitor",
|
||||
});
|
||||
const props = defineProps<{
|
||||
siteId: number;
|
||||
}>();
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({
|
||||
createCrudOptions,
|
||||
context: {
|
||||
props,
|
||||
},
|
||||
});
|
||||
|
||||
const siteInfoRef: Ref<any> = ref({});
|
||||
onMounted(async () => {
|
||||
siteInfoRef.value = await siteIpApi.GetObj(props.siteId);
|
||||
});
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,40 @@
|
||||
import { useFormWrapper } from "@fast-crud/fast-crud";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import SiteIpCertMonitor from "./index.vue";
|
||||
|
||||
export function useSiteIpMonitor() {
|
||||
const { openDialog } = useFormWrapper();
|
||||
const router = useRouter();
|
||||
|
||||
async function openSiteIpMonitorDialog(opts: { siteId: number }) {
|
||||
await openDialog({
|
||||
wrapper: {
|
||||
title: "站点IP监控",
|
||||
width: "80%",
|
||||
is: "a-modal",
|
||||
footer: false,
|
||||
buttons: {
|
||||
cancel: {
|
||||
show: false,
|
||||
},
|
||||
reset: {
|
||||
show: false,
|
||||
},
|
||||
ok: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
slots: {
|
||||
"form-body-top": () => {
|
||||
return <SiteIpCertMonitor siteId={opts.siteId} />;
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
openSiteIpMonitorDialog,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// @ts-ignore
|
||||
import { request } from "/src/api/service";
|
||||
const apiPrefix = "/monitor/site/setting";
|
||||
export type UserSiteMonitorSetting = {
|
||||
notificationId?: number;
|
||||
};
|
||||
|
||||
export async function SiteMonitorSettingsGet() {
|
||||
const res = await request({
|
||||
url: apiPrefix + "/get",
|
||||
method: "post",
|
||||
});
|
||||
if (!res) {
|
||||
return {};
|
||||
}
|
||||
return res as UserSiteMonitorSetting;
|
||||
}
|
||||
export async function SiteMonitorSettingsSave(data: UserSiteMonitorSetting) {
|
||||
await request({
|
||||
url: apiPrefix + "/save",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<fs-page class="page-user-settings page-site-monitor-setting">
|
||||
<template #header>
|
||||
<div class="title">站点监控设置</div>
|
||||
</template>
|
||||
<div class="user-settings-form settings-form">
|
||||
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
|
||||
<a-form-item label="通知渠道" :name="['notificationId']">
|
||||
<div class="flex">
|
||||
<NotificationSelector v-model="formState.notificationId" />
|
||||
</div>
|
||||
<div class="helper">设置通知渠道</div>
|
||||
</a-form-item>
|
||||
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
|
||||
<loading-button type="primary" html-type="button" :click="doSave">保存</loading-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import { reactive } from "vue";
|
||||
import * as api from "./api";
|
||||
import { UserSiteMonitorSetting } from "./api";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/src/store/settings";
|
||||
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
||||
|
||||
const settingsStore = useSettingStore();
|
||||
defineOptions({
|
||||
name: "UserSecurity",
|
||||
});
|
||||
|
||||
const formState = reactive<Partial<UserSiteMonitorSetting>>({
|
||||
notificationId: 0,
|
||||
});
|
||||
|
||||
async function loadUserSettings() {
|
||||
const data: any = await api.SiteMonitorSettingsGet();
|
||||
merge(formState, data);
|
||||
}
|
||||
|
||||
loadUserSettings();
|
||||
const doSave = async (form: any) => {
|
||||
await api.SiteMonitorSettingsSave({
|
||||
...formState,
|
||||
});
|
||||
notification.success({
|
||||
message: "保存成功",
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.page-user-settings {
|
||||
.user-settings-form {
|
||||
width: 600px;
|
||||
margin: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -15,13 +15,13 @@ export function notificationProvide(api: any) {
|
||||
|
||||
export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
const notificationTypeDictRef = dict({
|
||||
url: "/pi/notification/getTypeDict"
|
||||
url: "/pi/notification/getTypeDict",
|
||||
});
|
||||
const defaultPluginConfig = {
|
||||
component: {
|
||||
name: "a-input",
|
||||
vModel: "value"
|
||||
}
|
||||
vModel: "value",
|
||||
},
|
||||
};
|
||||
|
||||
function buildDefineFields(define: any, form: any, mode: string) {
|
||||
@@ -38,7 +38,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
const key = "body." + mapKey;
|
||||
const field = {
|
||||
...value,
|
||||
key
|
||||
key,
|
||||
};
|
||||
const column = merge({ title: key }, defaultPluginConfig, field);
|
||||
//eval
|
||||
@@ -69,29 +69,29 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
key: "id",
|
||||
type: "number",
|
||||
column: {
|
||||
width: 100
|
||||
width: 100,
|
||||
},
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
type: {
|
||||
title: "通知类型",
|
||||
type: "dict-select",
|
||||
dict: notificationTypeDictRef,
|
||||
search: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
component: {
|
||||
color: "auto"
|
||||
}
|
||||
color: "auto",
|
||||
},
|
||||
},
|
||||
editForm: {
|
||||
component: {
|
||||
disabled: false
|
||||
}
|
||||
disabled: false,
|
||||
},
|
||||
},
|
||||
form: {
|
||||
component: {
|
||||
@@ -108,7 +108,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
{item.needPlus && <fs-icon icon={"mingcute:vip-1-line"} className={"color-plus"}></fs-icon>}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: "请选择通知类型" }],
|
||||
valueChange: {
|
||||
@@ -133,7 +133,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
form.name = define.title;
|
||||
}
|
||||
buildDefineFields(define, form, mode);
|
||||
}
|
||||
},
|
||||
},
|
||||
helper: computed(() => {
|
||||
const define = currentDefine.value;
|
||||
@@ -141,22 +141,22 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
return "";
|
||||
}
|
||||
return define.desc;
|
||||
})
|
||||
}
|
||||
}),
|
||||
},
|
||||
} as ColumnCompositionProps,
|
||||
name: {
|
||||
title: "通知名称",
|
||||
search: {
|
||||
show: true
|
||||
show: true,
|
||||
},
|
||||
type: ["text"],
|
||||
form: {
|
||||
rules: [{ required: true, message: "请填写名称" }],
|
||||
helper: "随便填,当多个相同类型的通知时,便于区分"
|
||||
helper: "随便填,当多个相同类型的通知时,便于区分",
|
||||
},
|
||||
column: {
|
||||
width: 200
|
||||
}
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
isDefault: {
|
||||
title: "是否默认",
|
||||
@@ -164,13 +164,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "是", value: true, color: "success" },
|
||||
{ label: "否", value: false, color: "default" }
|
||||
]
|
||||
{ label: "否", value: false, color: "default" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
value: false,
|
||||
rules: [{ required: true, message: "请选择是否默认" }],
|
||||
order: 999
|
||||
order: 999,
|
||||
},
|
||||
column: {
|
||||
align: "center",
|
||||
@@ -192,12 +192,12 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
},
|
||||
onCancel: async () => {
|
||||
await crudExpose.doRefresh();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as ColumnCompositionProps,
|
||||
test: {
|
||||
title: "测试",
|
||||
@@ -207,16 +207,16 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
}),
|
||||
component: {
|
||||
name: "api-test",
|
||||
action: "TestRequest"
|
||||
action: "TestRequest",
|
||||
},
|
||||
order: 990,
|
||||
col: {
|
||||
span: 24
|
||||
}
|
||||
span: 24,
|
||||
},
|
||||
},
|
||||
column: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
setting: {
|
||||
column: { show: false },
|
||||
@@ -235,8 +235,8 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
||||
valueResolve({ form }) {
|
||||
const setting = form.body;
|
||||
form.setting = JSON.stringify(setting);
|
||||
}
|
||||
}
|
||||
} as ColumnCompositionProps
|
||||
},
|
||||
},
|
||||
} as ColumnCompositionProps,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,23 +32,23 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
pageRequest,
|
||||
addRequest,
|
||||
editRequest,
|
||||
delRequest
|
||||
delRequest,
|
||||
},
|
||||
form: {
|
||||
labelCol: {
|
||||
//固定label宽度
|
||||
span: null,
|
||||
style: {
|
||||
width: "145px"
|
||||
}
|
||||
}
|
||||
width: "145px",
|
||||
},
|
||||
},
|
||||
},
|
||||
rowHandle: {
|
||||
width: 200
|
||||
width: 200,
|
||||
},
|
||||
columns: {
|
||||
...commonColumnsDefine
|
||||
}
|
||||
}
|
||||
...commonColumnsDefine,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="notification-selector">
|
||||
<div class="flex-o w-100">
|
||||
<fs-dict-select class="flex-1" :value="modelValue" :dict="optionsDictRef" :disabled="disabled" :render-label="renderLabel" :slots="selectSlots" :allow-clear="true" @update:value="onChange" />
|
||||
<fs-dict-select class="flex-1" :value="modelValue" :dict="optionsDictRef" :disabled="disabled" :render-label="renderLabel" :slots="selectSlots" :allow-clear="true" v-bind="select" @update:value="onChange" />
|
||||
<fs-table-select
|
||||
ref="tableSelectRef"
|
||||
class="flex-0"
|
||||
@@ -21,6 +21,7 @@
|
||||
:dialog="{ width: 960 }"
|
||||
:destroy-on-close="false"
|
||||
height="400px"
|
||||
v-bind="tableSelect"
|
||||
@update:model-value="onChange"
|
||||
@dialog-closed="doRefresh"
|
||||
>
|
||||
@@ -39,17 +40,20 @@ import { message } from "ant-design-vue";
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "../crud";
|
||||
import { notificationProvide } from "/@/views/certd/notification/common";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
|
||||
defineOptions({
|
||||
name: "NotificationSelector",
|
||||
});
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue?: number | string;
|
||||
modelValue?: number | string | number[] | string[];
|
||||
type?: string;
|
||||
placeholder?: string;
|
||||
size?: string;
|
||||
disabled?: boolean;
|
||||
select?: any;
|
||||
tableSelect?: any;
|
||||
}>();
|
||||
|
||||
const onChange = async (value: number) => {
|
||||
@@ -118,9 +122,12 @@ function clear() {
|
||||
emitValue(null);
|
||||
}
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
async function emitValue(value: any) {
|
||||
target.value = optionsDictRef.dataMap[value];
|
||||
if (value !== 0 && pipeline?.value && target && pipeline.value.userId !== target.value.userId) {
|
||||
// target.value = optionsDictRef.dataMap[value];
|
||||
const userId = userStore.userInfo.id;
|
||||
if (pipeline?.value && pipeline.value.userId !== userId) {
|
||||
message.error("对不起,您不能修改他人流水线的通知");
|
||||
return;
|
||||
}
|
||||
@@ -134,6 +141,7 @@ watch(
|
||||
},
|
||||
async value => {
|
||||
await optionsDictRef.loadDict();
|
||||
//@ts-ignore
|
||||
target.value = optionsDictRef.dataMap[value];
|
||||
emit("selectedChange", target.value);
|
||||
},
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user