Compare commits

..

50 Commits

Author SHA1 Message Date
xiaojunnuo 3bb29abe32 v1.39.0 2026-03-08 01:17:39 +08:00
xiaojunnuo ac42d38b7a build: prepare to build 2026-03-08 01:15:23 +08:00
xiaojunnuo d9c0130b59 fix: 修复京东云域名申请证书报错的bug 2026-03-08 01:14:33 +08:00
xiaojunnuo 4925d5a5e7 chore: project prerelease 2026-03-08 00:48:29 +08:00
xiaojunnuo dd9a7cf5d7 chore: project fix 2026-03-05 00:11:08 +08:00
xiaojunnuo 5ee3874b7e chore: project fix 2026-03-04 23:53:19 +08:00
xiaojunnuo 17dd77cc96 chore: project userid fixed -1 2026-03-04 23:15:48 +08:00
xiaojunnuo 6c546b5290 chore: project finished 2026-03-03 23:31:42 +08:00
xiaojunnuo a853fc2026 chore: vip tip 2026-03-03 18:25:55 +08:00
xiaojunnuo 92c9ac3826 fix(cert-plugin): 优化又拍云客户端错误处理逻辑,当域名已绑定证书时不再抛出异常。 2026-03-03 14:35:50 +08:00
xiaojunnuo 78c2ced43b fix: 修复dcdn多个域名同时部署时 可能会出现证书名称重复的bug 2026-03-03 11:31:52 +08:00
xiaojunnuo 72f850f675 fix: 优化dcdn部署上传多次证书 偶尔报 The CertName already exists的问题 2026-03-03 11:29:50 +08:00
xiaojunnuo bc326489ab fix: 修复复制流水线保存后丢失分组和排序号的问题 2026-02-28 19:29:13 +08:00
xiaojunnuo ea5e7d9563 chore: project setting 2026-02-28 18:49:46 +08:00
xiaojunnuo 5b5b48fc06 chore: admin mode setting 2026-02-28 18:30:04 +08:00
xiaojunnuo 1548ba0b8d chore: project manager 2026-02-28 18:17:53 +08:00
xiaojunnuo 26b1c4244f chore: project approve 2026-02-28 12:14:38 +08:00
xiaojunnuo 8a4e981931 chore: project detail join approve 2026-02-28 12:13:31 +08:00
xiaojunnuo 6163c3f08e chore: join project 2026-02-28 00:49:02 +08:00
xiaojunnuo e17f381b1f chore: project blank 2026-02-27 23:09:50 +08:00
xiaojunnuo 316537eb4d fix: 修复偶尔下载证书报未授权的错误 2026-02-27 00:37:24 +08:00
xiaojunnuo b2c421600c chore: 首页数据统计项目显示 2026-02-27 00:14:53 +08:00
xiaojunnuo 787f6ef528 perf: 任务步骤页面增加串行执行提示说明 2026-02-27 00:06:44 +08:00
xiaojunnuo 8578547467 chore: project permission 2026-02-26 23:50:15 +08:00
xiaojunnuo 51ab6d6da1 perf: 【破坏性更新】错误返回信息msg字段名统一改成message,与成功的返回结构一致 2026-02-26 23:50:01 +08:00
xiaojunnuo 3a8b5de8f7 chore: project permission 2026-02-26 00:12:59 +08:00
xiaojunnuo faf08f6513 chore: project 2026-02-21 23:20:26 +08:00
xiaojunnuo 06c69d23be chore: 1 2026-02-19 00:18:29 +08:00
xiaojunnuo 1bcadd5f8e chore: 1 2026-02-19 00:17:02 +08:00
xiaojunnuo 524195d729 Merge branch 'v2-dev' into v2_admin_mode 2026-02-19 00:15:15 +08:00
xiaojunnuo 0c25d277ef build: release 2026-02-19 00:12:31 +08:00
xiaojunnuo 27b0348e1d fix: 修复发件邮箱无法输入的bug 2026-02-19 00:12:08 +08:00
xiaojunnuo ea5aa68769 build: publish 2026-02-18 23:22:03 +08:00
xiaojunnuo 99fefb168a build: trigger build image 2026-02-18 23:21:52 +08:00
xiaojunnuo 49457505cd v1.38.12 2026-02-18 23:20:43 +08:00
xiaojunnuo bfc948a9b4 build: prepare to build 2026-02-18 23:18:39 +08:00
xiaojunnuo c407206627 chore: 1 2026-02-18 23:16:13 +08:00
xiaojunnuo 39d3bf97d1 fix: 修复获取群辉deviceid报错的bug 2026-02-18 10:13:37 +08:00
xiaojunnuo 79be392775 fix: 修复获取群辉deviceid报错的bug 2026-02-18 10:13:24 +08:00
xiaojunnuo be4c6b8e16 Merge branch 'v2-dev' into v2_admin_mode 2026-02-17 00:16:12 +08:00
xiaojunnuo c8e193e70d chore: docs https 2026-02-17 00:14:31 +08:00
xiaojunnuo 35859ffc3f build: release 2026-02-17 00:09:50 +08:00
xiaojunnuo 0d81ada5a8 build: publish 2026-02-16 23:52:22 +08:00
xiaojunnuo b68cf0fb45 build: trigger build image 2026-02-16 23:52:11 +08:00
xiaojunnuo 9ed2078e92 chore: publish 2026-02-16 23:51:46 +08:00
xiaojunnuo 1f002159e2 v1.38.11 2026-02-16 23:44:19 +08:00
xiaojunnuo 5bc690fcd9 build: prepare to build 2026-02-16 23:40:03 +08:00
xiaojunnuo bab9adce24 perf: 支持自定义发件人名称,格式:名称<邮箱> 2026-02-16 23:38:08 +08:00
xiaojunnuo e47eddaa85 perf: 优化登陆页面的黑暗模式 2026-02-16 23:18:55 +08:00
xiaojunnuo 8ef1f2e395 fix: 修复1panel2.1.0新版本测试失败的问题 2026-02-16 17:28:46 +08:00
175 changed files with 2669 additions and 714 deletions
+45
View File
@@ -3,6 +3,51 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
### Bug Fixes
* 修复部署到openwrt错误的bug ([2e3d0cc](https://github.com/certd/certd/commit/2e3d0cc57c16c48ad435bc8fde729bacaedde9f5))
* 修复发件邮箱无法输入的bug ([27b0348](https://github.com/certd/certd/commit/27b0348e1d3d752f418f851965d6afbc26c0160c))
* 修复复制流水线保存后丢失分组和排序号的问题 ([bc32648](https://github.com/certd/certd/commit/bc326489abc1d50a0930b4f47aa2d62d3a486798))
* 修复获取群辉deviceid报错的bug ([79be392](https://github.com/certd/certd/commit/79be392775a2c91848dd5a66a2618adc4e4b48f6))
* 修复京东云域名申请证书报错的bug ([d9c0130](https://github.com/certd/certd/commit/d9c0130b59997144a3c274d456635b800135e43f))
* 修复偶尔下载证书报未授权的错误 ([316537e](https://github.com/certd/certd/commit/316537eb4dcbe5ec57784e8bf95ee3cdfd21dce7))
* 修复dcdn多个域名同时部署时 可能会出现证书名称重复的bug ([78c2ced](https://github.com/certd/certd/commit/78c2ced43b1a73d142b0ed783b162b97f545ab06))
* 优化dcdn部署上传多次证书 偶尔报 The CertName already exists的问题 ([72f850f](https://github.com/certd/certd/commit/72f850f675b500d12ebff2338d1b99d6fab476e1))
* **cert-plugin:** 优化又拍云客户端错误处理逻辑,当域名已绑定证书时不再抛出异常。 ([92c9ac3](https://github.com/certd/certd/commit/92c9ac382692e6c84140ff787759ab6d39ccbe96))
* esxi部署失败的bug ([1e44115](https://github.com/certd/certd/commit/1e441154617e6516a9a3610412bf597128c62696))
### Features
* 支持企业级管理模式,项目管理,细分权限 ([3734083](https://github.com/certd/certd/commit/37340838b6a61a94b86bfa13cf5da88b26f1315a))
### Performance Improvements
* 【破坏性更新】错误返回信息msg字段名统一改成message,与成功的返回结构一致 ([51ab6d6](https://github.com/certd/certd/commit/51ab6d6da1bb551b55b3a6a4a9a945c8d6ace806))
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([bb0afe1](https://github.com/certd/certd/commit/bb0afe1fa7b0fc52fde051d24fbe6be69d52f4cc))
* 任务步骤页面增加串行执行提示说明 ([787f6ef](https://github.com/certd/certd/commit/787f6ef52893d8dc912ee2a7a5b8ce2b73c108c9))
* 站点监控支持指定ip地址检查 ([83d81b6](https://github.com/certd/certd/commit/83d81b64b3adb375366039e07c87d1ad79121c13))
* AI开发插件 skills 定义初步 ([1f68fad](https://github.com/certd/certd/commit/1f68faddb97a978c5a5e731a8895b4bb0587ad83))
* http请求增加建立连接超时配置 ([3c85602](https://github.com/certd/certd/commit/3c85602ab1fc1953cdc06a6cd75a971d14119179))
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
### Bug Fixes
* 修复获取群辉deviceid报错的bug ([39d3bf9](https://github.com/certd/certd/commit/39d3bf97d1935918bac575da9d0726310c83c19d))
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
### Bug Fixes
* 修复1panel2.1.0新版本测试失败的问题 ([8ef1f2e](https://github.com/certd/certd/commit/8ef1f2e395ea5969a95f55535e6c16a65e2b463b))
### Performance Improvements
* 优化登陆页面的黑暗模式 ([e47edda](https://github.com/certd/certd/commit/e47eddaa858f8fffe7a40dfbd14e8cda1dcba4ac))
* 支持自定义发件人名称,格式:名称<邮箱> ([bab9adc](https://github.com/certd/certd/commit/bab9adce240108d4291eedc67e04abc4a01019e0))
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
### Bug Fixes
+17
View File
@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
### Bug Fixes
* 修复获取群辉deviceid报错的bug ([39d3bf9](https://github.com/certd/certd/commit/39d3bf97d1935918bac575da9d0726310c83c19d))
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
### Bug Fixes
* 修复1panel2.1.0新版本测试失败的问题 ([8ef1f2e](https://github.com/certd/certd/commit/8ef1f2e395ea5969a95f55535e6c16a65e2b463b))
### Performance Improvements
* 优化登陆页面的黑暗模式 ([e47edda](https://github.com/certd/certd/commit/e47eddaa858f8fffe7a40dfbd14e8cda1dcba4ac))
* 支持自定义发件人名称,格式:名称<邮箱> ([bab9adc](https://github.com/certd/certd/commit/bab9adce240108d4291eedc67e04abc4a01019e0))
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
### Bug Fixes
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 28 KiB

+3 -13
View File
@@ -16,21 +16,11 @@ CERTD_HTTPS_port=7002
参考Certd顶部的创建证书流水线教程
### 2、配置复制到本机任务
将证书复制到certd的证书安装位置
证书路径:`ssl/cert.crt`
私钥路径:`ssl/cert.key`
### 2、配置部署证书到certd任务
![](./images/1.png)
![](./images/2.png)
![](./images/4.png)
### 3、配置重启Certd任务
重启certd的https server,让证书生效
![img.png](./images/3.png)
### 4、配置定时任务
### 3、配置定时任务
每天定时执行,最终效果如下
![](./images/ok.png)
+1 -1
View File
@@ -9,5 +9,5 @@
}
},
"npmClient": "pnpm",
"version": "1.38.10"
"version": "1.39.0"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/publishlab/node-acme-client/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/acme-client
## [1.38.12](https://github.com/publishlab/node-acme-client/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/acme-client
## [1.38.11](https://github.com/publishlab/node-acme-client/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/acme-client
## [1.38.10](https://github.com/publishlab/node-acme-client/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/acme-client
+3 -3
View File
@@ -3,7 +3,7 @@
"description": "Simple and unopinionated ACME client",
"private": false,
"author": "nmorsman",
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"module": "scr/index.js",
"main": "src/index.js",
@@ -18,7 +18,7 @@
"types"
],
"dependencies": {
"@certd/basic": "^1.38.10",
"@certd/basic": "^1.39.0",
"@peculiar/x509": "^1.11.0",
"asn1js": "^3.0.5",
"axios": "^1.9.0",
@@ -70,5 +70,5 @@
"bugs": {
"url": "https://github.com/publishlab/node-acme-client/issues"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+18
View File
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
### Bug Fixes
* esxi部署失败的bug ([1e44115](https://github.com/certd/certd/commit/1e441154617e6516a9a3610412bf597128c62696))
### Performance Improvements
* http请求增加建立连接超时配置 ([3c85602](https://github.com/certd/certd/commit/3c85602ab1fc1953cdc06a6cd75a971d14119179))
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/basic
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/basic
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
### Performance Improvements
+1 -1
View File
@@ -1 +1 @@
00:20
01:15
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/basic",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -47,5 +47,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/pipeline
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/pipeline
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/pipeline
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
### Bug Fixes
+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/pipeline",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -18,8 +18,8 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/basic": "^1.38.10",
"@certd/plus-core": "^1.38.10",
"@certd/basic": "^1.39.0",
"@certd/plus-core": "^1.39.0",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"reflect-metadata": "^0.1.13"
@@ -45,5 +45,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+7 -3
View File
@@ -170,9 +170,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
}
if (this.ctx?.define?.onlyAdmin) {
if (!this.isAdmin()) {
throw new Error("只有管理员才能运行此任务");
}
this.checkAdmin();
}
}
@@ -284,6 +282,12 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
return this.ctx.user.role === "admin";
}
checkAdmin() {
if (!this.isAdmin()) {
throw new Error("只有“管理员”或“系统级项目”才有权限运行此插件任务");
}
}
getStepFromPipeline(stepId: string) {
let found: any = null;
RunnableCollection.each(this.ctx.pipeline.stages, step => {
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/lib-huawei
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/lib-huawei
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-huawei",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"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": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/lib-iframe
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/lib-iframe
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-iframe",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -31,5 +31,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/jdcloud
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/jdcloud
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/jdcloud",
"version": "1.38.10",
"version": "1.39.0",
"description": "jdcloud openApi sdk",
"main": "./dist/bundle.js",
"module": "./dist/bundle.js",
@@ -56,5 +56,5 @@
"fetch"
]
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/lib-k8s
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/lib-k8s
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/lib-k8s",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
@@ -17,7 +17,7 @@
"pub": "npm publish"
},
"dependencies": {
"@certd/basic": "^1.38.10",
"@certd/basic": "^1.39.0",
"@kubernetes/client-node": "0.21.0"
},
"devDependencies": {
@@ -32,5 +32,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
### Performance Improvements
* 【破坏性更新】错误返回信息msg字段名统一改成message,与成功的返回结构一致 ([51ab6d6](https://github.com/certd/certd/commit/51ab6d6da1bb551b55b3a6a4a9a945c8d6ace806))
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/lib-server
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/lib-server
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/lib-server
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/lib-server",
"version": "1.38.10",
"version": "1.39.0",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -28,11 +28,11 @@
],
"license": "AGPL",
"dependencies": {
"@certd/acme-client": "^1.38.10",
"@certd/basic": "^1.38.10",
"@certd/pipeline": "^1.38.10",
"@certd/plugin-lib": "^1.38.10",
"@certd/plus-core": "^1.38.10",
"@certd/acme-client": "^1.39.0",
"@certd/basic": "^1.39.0",
"@certd/pipeline": "^1.39.0",
"@certd/plugin-lib": "^1.39.0",
"@certd/plus-core": "^1.39.0",
"@midwayjs/cache": "3.14.0",
"@midwayjs/core": "3.20.11",
"@midwayjs/i18n": "3.20.13",
@@ -64,5 +64,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
@@ -34,7 +34,7 @@ export abstract class BaseController {
fail(msg: string, code?: any) {
return {
code: code ? code : Constants.res.error.code,
msg: msg ? msg : Constants.res.error.code,
message: msg ? msg : Constants.res.error.code,
};
}
@@ -69,10 +69,8 @@ export abstract class BaseController {
if (!projectIdStr){
projectIdStr = this.ctx.request.query["projectId"] as string;
}
if (!projectIdStr){
return null
}
if (!projectIdStr) {
//这里必须抛异常,否则可能会有权限问题
throw new Error("projectId 不能为空")
}
const userId = this.getUserId()
@@ -85,7 +83,7 @@ export abstract class BaseController {
let userId = this.getUserId()
const projectId = await this.getProjectId(permission)
if(projectId){
userId = 0
userId = -1 // 企业管理模式下,用户id固定-1
}
return {
projectId,userId
@@ -120,7 +118,7 @@ export abstract class BaseController {
if(allowAdmin){
await authService.checkUserIdButAllowAdmin(this.ctx, service, id);
}else{
await authService.checkUserId(this.ctx, service, id);
await authService.checkUserId( service, id, userId);
}
}
return {projectId,userId}
@@ -258,12 +258,12 @@ export abstract class BaseService<T> {
export function checkUserProjectParam(userId: number, projectId: number) {
if (projectId != null ){
if( userId !==0) {
if( userId !==-1) {
throw new ValidateException('userId projectId 错误');
}
return true
}else{
if( userId > 0) {
if( userId != null) {
return true
}
throw new ValidateException('userId不能为空');
@@ -4,7 +4,7 @@
export class BaseException extends Error {
code: number;
data?:any
constructor(name, code, message,data?:any) {
constructor(name: string, code: number, message: string ,data?:any) {
super(message);
this.name = name;
this.code = code;
+7 -7
View File
@@ -1,19 +1,19 @@
export class Result<T> {
code: number;
msg: string;
message: string;
data: T;
constructor(code, msg, data?) {
constructor(code, message, data?) {
this.code = code;
this.msg = msg;
this.message = message;
this.data = data;
}
static error(code = 1, msg, data?: any) {
return new Result(code, msg, data);
static error(code = 1, message, data?: any) {
return new Result(code, message, data);
}
static success(msg, data?) {
return new Result(0, msg, data);
static success(message, data?) {
return new Result(0, message, data);
}
}
@@ -8,7 +8,7 @@ export class AccessEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: '用户id' })
userId: number;
userId: number; // 0为系统级别, -1为企业,大于1为用户
@Column({ comment: '名称', length: 100 })
name: string;
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/midway-flyway-js
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/midway-flyway-js
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/midway-flyway-js",
"version": "1.38.10",
"version": "1.39.0",
"description": "midway with flyway, sql upgrade way ",
"private": false,
"type": "module",
@@ -46,5 +46,5 @@
"typeorm": "^0.3.11",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/plugin-cert
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/plugin-cert
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-cert",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
"compile": "tsc --skipLibCheck --watch"
},
"dependencies": {
"@certd/acme-client": "^1.38.10",
"@certd/basic": "^1.38.10",
"@certd/pipeline": "^1.38.10",
"@certd/plugin-lib": "^1.38.10",
"@certd/acme-client": "^1.39.0",
"@certd/basic": "^1.39.0",
"@certd/pipeline": "^1.39.0",
"@certd/plugin-lib": "^1.39.0",
"psl": "^1.9.0",
"punycode.js": "^2.3.1"
},
@@ -38,5 +38,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
**Note:** Version bump only for package @certd/plugin-lib
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
**Note:** Version bump only for package @certd/plugin-lib
+6 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@certd/plugin-lib",
"private": false,
"version": "1.38.10",
"version": "1.39.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -22,10 +22,10 @@
"@alicloud/pop-core": "^1.7.10",
"@alicloud/tea-util": "^1.4.11",
"@aws-sdk/client-s3": "^3.964.0",
"@certd/acme-client": "^1.38.10",
"@certd/basic": "^1.38.10",
"@certd/pipeline": "^1.38.10",
"@certd/plus-core": "^1.38.10",
"@certd/acme-client": "^1.39.0",
"@certd/basic": "^1.39.0",
"@certd/pipeline": "^1.39.0",
"@certd/plus-core": "^1.39.0",
"@kubernetes/client-node": "0.21.0",
"ali-oss": "^6.22.0",
"basic-ftp": "^5.0.5",
@@ -57,5 +57,5 @@
"tslib": "^2.8.1",
"typescript": "^5.4.2"
},
"gitHead": "01eb50078e135e00148a144d20747096e2f64a28"
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
}
+31
View File
@@ -3,6 +3,37 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.39.0](https://github.com/certd/certd/compare/v1.38.12...v1.39.0) (2026-03-07)
### Bug Fixes
* 修复发件邮箱无法输入的bug ([27b0348](https://github.com/certd/certd/commit/27b0348e1d3d752f418f851965d6afbc26c0160c))
* 修复复制流水线保存后丢失分组和排序号的问题 ([bc32648](https://github.com/certd/certd/commit/bc326489abc1d50a0930b4f47aa2d62d3a486798))
* 修复获取群辉deviceid报错的bug ([79be392](https://github.com/certd/certd/commit/79be392775a2c91848dd5a66a2618adc4e4b48f6))
* 修复偶尔下载证书报未授权的错误 ([316537e](https://github.com/certd/certd/commit/316537eb4dcbe5ec57784e8bf95ee3cdfd21dce7))
### Features
* 支持企业级管理模式,项目管理,细分权限 ([3734083](https://github.com/certd/certd/commit/37340838b6a61a94b86bfa13cf5da88b26f1315a))
### Performance Improvements
* 当域名管理中没有域名时,创建流水线时不展开域名选择框 ([bb0afe1](https://github.com/certd/certd/commit/bb0afe1fa7b0fc52fde051d24fbe6be69d52f4cc))
* 任务步骤页面增加串行执行提示说明 ([787f6ef](https://github.com/certd/certd/commit/787f6ef52893d8dc912ee2a7a5b8ce2b73c108c9))
## [1.38.12](https://github.com/certd/certd/compare/v1.38.11...v1.38.12) (2026-02-18)
### Bug Fixes
* 修复获取群辉deviceid报错的bug ([39d3bf9](https://github.com/certd/certd/commit/39d3bf97d1935918bac575da9d0726310c83c19d))
## [1.38.11](https://github.com/certd/certd/compare/v1.38.10...v1.38.11) (2026-02-16)
### Performance Improvements
* 优化登陆页面的黑暗模式 ([e47edda](https://github.com/certd/certd/commit/e47eddaa858f8fffe7a40dfbd14e8cda1dcba4ac))
* 支持自定义发件人名称,格式:名称<邮箱> ([bab9adc](https://github.com/certd/certd/commit/bab9adce240108d4291eedc67e04abc4a01019e0))
## [1.38.10](https://github.com/certd/certd/compare/v1.38.9...v1.38.10) (2026-02-15)
### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.38.10",
"version": "1.39.0",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.38.10",
"@certd/pipeline": "^1.38.10",
"@certd/lib-iframe": "^1.39.0",
"@certd/pipeline": "^1.39.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",
Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

@@ -1,7 +1,7 @@
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="500" height="500" viewBox="0 0 500.000000 500.000000"
>
<path d="M28.34 56.68h28.34V36.12H28.34a7.79 7.79 0 1 1 0-15.58h19.84v9.05h8.5V12H28.34a16.29 16.29 0 0 0 0 32.58h19.84v3.56H28.34a19.84 19.84 0 0 1 0-39.68h28.34V0H28.34a28.34 28.34 0 0 0 0 56.68z"
<path fill="#333" d="M28.34 56.68h28.34V36.12H28.34a7.79 7.79 0 1 1 0-15.58h19.84v9.05h8.5V12H28.34a16.29 16.29 0 0 0 0 32.58h19.84v3.56H28.34a19.84 19.84 0 0 1 0-39.68h28.34V0H28.34a28.34 28.34 0 0 0 0 56.68z"
transform="translate(70, 76) scale(6,6)"
></path>
</svg>

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 409 B

+8 -6
View File
@@ -136,27 +136,29 @@ function createService() {
*/
function createRequestFunction(service: any) {
return function (config: any) {
const configDefault = {
const configDefault: any = {
headers: {
"Content-Type": get(config, "headers.Content-Type", "application/json"),
} as any,
timeout: 30000,
baseURL: env.API,
data: {},
params: {},
};
const projectStore = useProjectStore();
if (projectStore.isEnterprise && !config.url.startsWith("/sys")) {
configDefault.headers["project-id"] = projectStore.currentProjectId;
}
const userStore = useUserStore();
const token = userStore.getToken;
if (token != null) {
// @ts-ignore
configDefault.headers.Authorization = token;
}
return service(Object.assign(configDefault, config));
Object.assign(configDefault, config);
if (!configDefault.params.projectId && projectStore.isEnterprise && !config.url.startsWith("/sys") && !config.url.startsWith("http")) {
configDefault.params.projectId = projectStore.currentProject?.id;
}
return service(configDefault);
};
}
+9 -9
View File
@@ -19,30 +19,30 @@ export function parse(jsonString = "{}", defaultValue = {}) {
/**
* @description
* @param {Any} data
* @param {String} msg
* @param {String} message
* @param {Number} code
*/
export function response(data = {}, msg = "", code = 0) {
return [200, { code, msg, data }];
export function response(data = {}, message = "", code = 0) {
return [200, { code, message, data }];
}
/**
* @description
* @param {Any} data
* @param {String} msg
* @param {String} message
*/
export function responseSuccess(data = {}, msg = "成功") {
return response(data, msg);
export function responseSuccess(data = {}, message = "成功") {
return response(data, message);
}
/**
* @description
* @param {Any} data
* @param {String} msg
* @param {String} message
* @param {Number} code
*/
export function responseError(data = {}, msg = "请求失败", code = 500) {
return response(data, msg, code);
export function responseError(data = {}, message = "请求失败", code = 500) {
return response(data, message, code);
}
/**
@@ -17,6 +17,8 @@ import NotificationSelector from "../views/certd/notification/notification-selec
import EmailSelector from "./email-selector/index.vue";
import ValidTimeFormat from "./valid-time-format.vue";
import ProjectSelector from "./project-selector/index.vue";
import ProjectCurrent from "./project-selector/project-current.vue";
export default {
install(app: any) {
app.component(
@@ -47,5 +49,6 @@ export default {
app.use(vip);
app.use(Plugins);
app.component("ProjectSelector", ProjectSelector);
app.component("ProjectCurrent", ProjectCurrent);
},
};
@@ -13,6 +13,7 @@
import { inject, ref, useAttrs } from "vue";
import { Modal } from "ant-design-vue";
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
import { getInputFromForm } from "../common/utils";
defineOptions({
name: "DeviceIdGetter",
@@ -34,7 +35,7 @@ const getPluginType: any = inject("get:plugin:type", () => {
async function loginWithOTPCode(otpCode: string) {
const { form } = getScope();
const pluginType = getPluginType();
const { input, record } = getInputFromForm(form, pluginType);
return await doRequest({
type: pluginType,
typeName: form.type,
@@ -42,7 +43,8 @@ async function loginWithOTPCode(otpCode: string) {
data: {
otpCode,
},
input: form,
input: input,
record,
});
}
@@ -3,34 +3,57 @@
<template #overlay>
<a-menu @click="handleMenuClick">
<a-menu-item v-for="item in projectStore.myProjects" :key="item.id">
{{ item.name }}
<div class="flex items-center justify-between w-full">
<span class="mr-1">{{ item.name }}</span>
<fs-values-format :model-value="item.permission" :dict="projectPermissionDict"></fs-values-format>
</div>
</a-menu-item>
<a-menu-item key="join">
<div class="flex items-center w-full">
<fs-icon icon="ion:add" class="mr-1"></fs-icon>
<span>加入其他项目</span>
</div>
</a-menu-item>
</a-menu>
</template>
<div class="rounded pl-3 pr-3 px-2 py-1 flex-center flex pointer items-center bg-accent h-10 button-text" title="当前项目">
<fs-icon icon="ion:apps" class="mr-1"></fs-icon>
<!-- <fs-icon icon="ion:apps" class="mr-1"></fs-icon> -->
当前项目{{ projectStore.currentProject?.name || "..." }}
<fs-icon icon="ion:chevron-down-outline" class="ml-1"></fs-icon>
<fs-icon :icon="currentIcon" class="ml-5"></fs-icon>
</div>
</a-dropdown>
</template>
<script lang="ts" setup>
import { onMounted } from "vue";
import { computed, onMounted } from "vue";
import { useProjectStore } from "/@/store/project";
import { useDicts } from "/@/views/certd/dicts";
import { useRouter } from "vue-router";
defineOptions({
name: "ProjectSelector",
});
const projectStore = useProjectStore();
onMounted(async () => {
await projectStore.reload();
await projectStore.init();
console.log(projectStore.myProjects);
});
const router = useRouter();
function handleMenuClick({ key }: any) {
if (key === "join") {
router.push("/certd/project/join");
return;
}
projectStore.changeCurrentProject(key);
window.location.reload();
}
const { projectPermissionDict } = useDicts();
const currentIcon = computed(() => {
return projectPermissionDict.dataMap[projectStore.currentProject?.permission || ""]?.icon || "";
});
</script>
<style lang="less">
.project-selector {
@@ -0,0 +1,28 @@
<template>
<a-tag color="green" class="flex-center flex pointer items-center button-text" title="当前项目">
<!-- <fs-icon icon="ion:apps" class="mr-1"></fs-icon> -->
当前项目{{ projectStore.currentProject?.name || "..." }}
<fs-icon :icon="currentIcon" class="ml-5"></fs-icon>
</a-tag>
</template>
<script lang="ts" setup>
import { computed, onMounted } from "vue";
import { useProjectStore } from "/@/store/project";
import { useDicts } from "/@/views/certd/dicts";
defineOptions({
name: "ProjectCurrent",
});
const projectStore = useProjectStore();
// onMounted(async () => {
// await projectStore.reload();
// });
const { projectPermissionDict } = useDicts();
const currentIcon = computed(() => {
return projectPermissionDict.dataMap[projectStore.currentProject?.permission || ""]?.icon || "";
});
</script>
<style lang="less"></style>
@@ -84,7 +84,11 @@ const projectStore = useProjectStore();
<template>
<BasicLayout @clear-preferences-and-logout="handleLogout">
<template #header-left-0> </template>
<template #header-left-0>
<div v-if="projectStore.isEnterprise" class="ml-1 mr-2">
<project-selector class="flex-center header-btn" />
</div>
</template>
<template #user-dropdown>
<UserDropdown :avatar="avatar" :menus="menus" :text="userStore.userInfo?.nickName || userStore.userInfo?.username" description="" tag-text="" @logout="handleLogout" />
</template>
@@ -92,9 +96,6 @@ const projectStore = useProjectStore();
<LockScreen :avatar @to-login="handleLogout" />
</template>
<template #header-right-0>
<div v-if="projectStore.isEnterprise" class="ml-1 mr-2">
<project-selector class="flex-center header-btn" />
</div>
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
<tutorial-button class="flex-center header-btn" mode="nav" />
</div>
@@ -1,6 +1,6 @@
<template>
<div id="userLayout" :class="['user-layout-wrapper']">
<div class="login-container flex justify-start">
<div class="login-container flex justify-start dark:background-[#141414]">
<div class="user-layout-content flex-col justify-start">
<div class="top flex flex-col items-center justify-start">
<div class="header flex flex-row items-center">
@@ -59,6 +59,14 @@ const sysPublic: Ref<SysPublicSetting> = computed(() => {
</script>
<style lang="less">
.dark {
.login-container {
background: #141414 !important;
.desc {
color: rgba(227, 227, 227, 0.45) !important;
}
}
}
#userLayout.user-layout-wrapper {
height: 100%;
@@ -1,3 +1,4 @@
//注意: @符号是保留字符,需要用{'@'}替换, AI请务必提醒我修改
export default {
app: {
crud: {
@@ -217,6 +218,9 @@ export default {
projectUserManager: "Project User Management",
myProjectManager: "My Projects",
myProjectDetail: "Project Detail",
projectJoin: "Join Project",
currentProject: "Current Project",
projectMemberManager: "Project Member",
},
certificateRepo: {
title: "Certificate Repository",
@@ -274,77 +278,6 @@ export default {
webhookEnabledHelper: "Support webhook trigger pipeline, please check webhook address in trigger source",
},
notificationDefault: "Use Default Notification",
monitor: {
remark: "Remark",
title: "Site Certificate Monitoring",
description: "Check website certificates' expiration at 0:00 daily; reminders sent 10 days before expiration (using default notification channel);",
settingLink: "Site Monitoring Settings",
limitInfo: "Basic edition limited to 1, professional and above unlimited, current",
checkAll: "Check All",
confirmTitle: "Confirm",
confirmContent: "Confirm to trigger check for all site certificates?",
checkSubmitted: "Check task submitted",
pleaseRefresh: "Please refresh the page later to see the results",
siteName: "Site Name",
enterSiteName: "Please enter the site name",
domain: "Domain",
enterDomain: "Please enter the domain",
enterValidDomain: "Please enter a valid domain",
httpsPort: "HTTPS Port",
enterPort: "Please enter the port",
certInfo: "Certificate Info",
issuer: "Issuer",
certDomains: "Certificate Domains",
certProvider: "Issuer",
certStatus: "Certificate Status",
error: "Error",
status: {
ok: "Valid",
expired: "Expired",
},
certEffectiveTime: "Certificate Effective",
certExpiresTime: "Certificate Expiration",
remainingValidity: "Remaining Validity",
expired: "expired",
days: "days",
lastCheckTime: "Last Check Time",
disabled: "Enable/Disable",
ipCheck: "Enable IP Check",
ipCheckHelper: "Enable to check certificate expiration time on each IP (or source site domain) ",
ipSyncAuto: "Enable IP Sync Auto",
ipSyncMode: "IP Sync Mode",
ipIgnoreCoherence: "Ignore Certificate Coherence",
ipIgnoreCoherenceHelper: "Enable to ignore certificate coherence check, only check certificate expiration time",
selectRequired: "Please select",
ipCheckConfirm: "Are you sure to {status} IP check?",
ipCount: "IP Count",
checkStatus: "Check Status",
pipelineId: "Linked Pipeline ID",
certInfoId: "Certificate ID",
checkSubmittedRefresh: "Check task submitted. Please refresh later to view the result.",
ipManagement: "IP Management",
bulkImport: "Bulk Import",
basicLimitError: "Basic version allows only one monitoring site. Please upgrade to the Pro version.",
limitExceeded: "Sorry, you can only create up to {max} monitoring records. Please purchase or upgrade your plan.",
setting: {
siteMonitorSettings: "Site Monitor Settings",
notificationChannel: "Notification Channel",
setNotificationChannel: "Set the notification channel",
retryTimes: "Retry Times",
monitorRetryTimes: "Number of retry attempts for monitoring requests",
monitorCronSetting: "Monitoring Schedule",
cronTrigger: "Scheduled trigger for monitoring",
dnsServer: "DNS Server",
dnsServerHelper: "Use a custom domain name resolution server, such as: 1.1.1.1 , support multiple",
certValidDays: "Certificate Valid Days",
certValidDaysHelper: "Number of days before expiration to send a notification",
},
cert: {
expired: "Expired",
expiring: "Expiring",
noExpired: "Not Expired",
},
},
checkStatus: {
success: "Success",
checking: "Checking",
@@ -698,6 +631,7 @@ export default {
password: "Password",
pleaseEnterPassword: "Please enter password",
qqEmailAuthCodeHelper: "If using QQ email, get an authorization code in QQ email settings as the password",
senderEmailHelper: "You can use the format: Name<Email> to set the sender name, e.g.: autossl<certd{'@'}example.com>",
senderEmail: "Sender Email",
pleaseEnterSenderEmail: "Please enter sender email",
useSsl: "Use SSL",
@@ -888,6 +822,28 @@ export default {
write: "Write",
admin: "Admin",
},
projectMemberStatus: "Member Status",
isSystem: "Is System Project",
isSystemHelper: "System-level projects allow running admin plugins",
},
project: {
noProjectJoined: "You haven't joined any projects yet",
applyToJoin: "Please apply to join a project to start using",
systemProjects: "System Project List",
createdAt: "Created At",
applyJoin: "Apply to Join",
noSystemProjects: "No system projects available",
fetchFailed: "Failed to fetch project list",
applySuccess: "Application successful, waiting for admin approval",
applyFailed: "Application failed, please try again later",
leave: "Leave Project",
leaveSuccess: "Leave project successful",
leaveFailed: "Leave project failed, please try again later",
applyJoinConfirm: "Are you sure you want to apply to join this project?",
leaveConfirm: "Are you sure you want to leave this project?",
viewDetail: "View Detail",
projectManage: "Project Manage",
},
addonSelector: {
select: "Select",
@@ -6,7 +6,8 @@ import preferences from "./preferences";
import ui from "./ui";
import guide from "./guide";
import common from "./common";
import monitor from "./monitor";
//注意: @符号是保留字符,需要用{'@'}替换
export default {
certd,
authentication,
@@ -16,4 +17,5 @@ export default {
preferences,
guide,
common,
monitor,
};
@@ -0,0 +1,73 @@
export default {
ipAddress: "IP地址",
ipAddressHelper: "填写则固定检查此IP,不从DNS获取域名的IP地址",
remark: "Remark",
title: "Site Certificate Monitoring",
description: "Check website certificates' expiration at 0:00 daily; reminders sent 10 days before expiration (using default notification channel);",
settingLink: "Site Monitoring Settings",
limitInfo: "Basic edition limited to 1, professional and above unlimited, current",
checkAll: "Check All",
confirmTitle: "Confirm",
confirmContent: "Confirm to trigger check for all site certificates?",
checkSubmitted: "Check task submitted",
pleaseRefresh: "Please refresh the page later to see the results",
siteName: "Site Name",
enterSiteName: "Please enter the site name",
domain: "Domain",
enterDomain: "Please enter the domain",
enterValidDomain: "Please enter a valid domain",
httpsPort: "HTTPS Port",
enterPort: "Please enter the port",
certInfo: "Certificate Info",
issuer: "Issuer",
certDomains: "Certificate Domains",
certProvider: "Issuer",
certStatus: "Certificate Status",
error: "Error",
status: {
ok: "Valid",
expired: "Expired",
},
certEffectiveTime: "Certificate Effective",
certExpiresTime: "Certificate Expiration",
remainingValidity: "Remaining Validity",
expired: "expired",
days: "days",
lastCheckTime: "Last Check Time",
disabled: "Enable/Disable",
ipCheck: "Enable IP Check",
ipCheckHelper: "Enable to check certificate expiration time on each IP (or source site domain) ",
ipSyncAuto: "Enable IP Sync Auto",
ipSyncMode: "IP Sync Mode",
ipIgnoreCoherence: "Ignore Certificate Coherence",
ipIgnoreCoherenceHelper: "Enable to ignore certificate coherence check, only check certificate expiration time",
selectRequired: "Please select",
ipCheckConfirm: "Are you sure to {status} IP check?",
ipCount: "IP Count",
checkStatus: "Check Status",
pipelineId: "Linked Pipeline ID",
certInfoId: "Certificate ID",
checkSubmittedRefresh: "Check task submitted. Please refresh later to view the result.",
ipManagement: "IP Management",
bulkImport: "Bulk Import",
basicLimitError: "Basic version allows only one monitoring site. Please upgrade to the Pro version.",
limitExceeded: "Sorry, you can only create up to {max} monitoring records. Please purchase or upgrade your plan.",
setting: {
siteMonitorSettings: "Site Monitor Settings",
notificationChannel: "Notification Channel",
setNotificationChannel: "Set the notification channel",
retryTimes: "Retry Times",
monitorRetryTimes: "Number of retry attempts for monitoring requests",
monitorCronSetting: "Monitoring Schedule",
cronTrigger: "Scheduled trigger for monitoring",
dnsServer: "DNS Server",
dnsServerHelper: "Use a custom domain name resolution server, such as: 1.1.1.1 , support multiple",
certValidDays: "Certificate Valid Days",
certValidDaysHelper: "Number of days before expiration to send a notification",
},
cert: {
expired: "Expired",
expiring: "Expiring",
noExpired: "Not Expired",
},
};
@@ -1,3 +1,4 @@
//注意: @符号是保留字符,需要用{'@'}替换, AI请务必提醒我修改
export default {
app: {
crud: {
@@ -219,10 +220,12 @@ export default {
netTest: "网络测试",
enterpriseManager: "企业管理设置",
projectManager: "项目管理",
projectDetail: "项目详情",
enterpriseSetting: "企业设置",
myProjectManager: "我的项目",
myProjectDetail: "项目详情",
projectJoin: "加入项目",
currentProject: "当前项目",
projectMemberManager: "项目成员管理",
},
certificateRepo: {
title: "证书仓库",
@@ -277,84 +280,6 @@ export default {
webhookEnabledHelper: "支持webhook触发流水线,请在触发源中查看webhook地址",
},
notificationDefault: "使用默认通知",
monitor: {
remark: "备注",
title: "站点证书监控",
description: "每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道);",
settingLink: "站点监控设置",
limitInfo: "基础版限制1条,专业版以上无限制,当前",
checkAll: "检查全部",
confirmTitle: "确认",
confirmContent: "确认触发检查全部站点证书吗?",
checkSubmitted: "检查任务已提交",
pleaseRefresh: "请稍后刷新页面查看结果",
siteName: "站点名称",
enterSiteName: "请输入站点名称",
domain: "网站域名",
enterDomain: "请输入域名",
enterValidDomain: "请输入正确的域名",
httpsPort: "HTTPS端口",
enterPort: "请输入端口",
certInfo: "证书信息",
issuer: "证书颁发机构",
certDomains: "证书域名",
certProvider: "颁发机构",
certStatus: "证书状态",
error: "错误信息",
status: {
ok: "正常",
expired: "过期",
},
certEffectiveTime: "证书生效时间",
certExpiresTime: "证书到期时间",
remainingValidity: "到期剩余",
expired: "过期",
days: "天",
lastCheckTime: "上次检查时间",
disabled: "禁用启用",
ipAddress: "IP地址",
ipAddressHelper: "填写则固定检查此IP,不从DNS获取域名的IP地址",
ipCheck: "开启IP检查",
ipCheckHelper: "开启后,会检查IP(或源站)上的证书有效期",
ipSyncAuto: "自动同步IP",
ipSyncMode: "IP同步模式",
ipSyncModeHelper: "选择仅检查IPv4或IPv6,或检查所有IP",
ipSyncModeAll: "检查所有IP",
ipSyncModeIPV4Only: "仅检查IPv4",
ipSyncModeIPV6Only: "仅检查IPv6",
selectRequired: "请选择",
ipCheckConfirm: "确定{status}IP检查?",
ipCount: "IP数量",
ipIgnoreCoherence: "忽略证书一致性",
ipIgnoreCoherenceHelper: "开启后,即使IP上的证书与站点证书不一致,也会被认为是正常,仅校验证书过期时间",
checkStatus: "检查状态",
pipelineId: "关联流水线ID",
certInfoId: "证书ID",
checkSubmittedRefresh: "检查任务已提交,请稍后刷新查看结果",
ipManagement: "IP管理",
bulkImport: "批量导入",
basicLimitError: "基础版只能添加一个监控站点,请赞助升级专业版",
limitExceeded: "对不起,您最多只能创建条{max}监控记录,请购买或升级套餐",
setting: {
siteMonitorSettings: "站点监控设置",
notificationChannel: "通知渠道",
setNotificationChannel: "设置通知渠道",
retryTimes: "重试次数",
monitorRetryTimes: "监控请求重试次数",
monitorCronSetting: "监控定时设置",
cronTrigger: "定时触发监控",
dnsServer: "DNS服务器",
dnsServerHelper: "使用自定义的域名解析服务器,如:1.1.1.1 , 支持多个",
certValidDays: "证书到期前天数",
certValidDaysHelper: "证书到期前多少天发送通知",
},
cert: {
expired: "已过期",
expiring: "即将过期",
noExpired: "未过期",
},
},
checkStatus: {
success: "成功",
checking: "检查中",
@@ -711,6 +636,7 @@ export default {
password: "密码",
pleaseEnterPassword: "请输入密码",
qqEmailAuthCodeHelper: "如果是qq邮箱,需要到qq邮箱的设置里面申请授权码作为密码",
senderEmailHelper: "您可以使用 名称<邮箱> 的格式,来修改发件人名称,例如: autossl<certd{'@'}example.com>",
senderEmail: "发件邮箱",
pleaseEnterSenderEmail: "请输入发件邮箱",
useSsl: "是否ssl",
@@ -907,9 +833,31 @@ export default {
projectDetailDescription: "管理项目成员",
projectPermission: "权限",
permission: {
read: "读取",
write: "写入",
read: "查看",
write: "修改",
admin: "管理员",
},
projectMemberStatus: "成员状态",
isSystem: "是否系统项目",
isSystemHelper: "系统级项目允许运行管理员插件",
},
project: {
noProjectJoined: "您还没有加入任何项目",
applyToJoin: "请申请加入项目以开始使用",
projectList: "项目列表",
createdAt: "创建时间",
applyJoin: "申请加入",
noProjects: "暂无项目",
fetchFailed: "获取项目列表失败",
applySuccess: "申请成功,等待管理员审核",
applyFailed: "申请失败,请稍后重试",
leave: "退出项目",
leaveSuccess: "退出项目成功",
leaveFailed: "退出项目失败,请稍后重试",
applyJoinConfirm: "确认加入项目?",
leaveConfirm: "确认退出项目?",
viewDetail: "查看详情",
projectManage: "项目管理",
},
};
@@ -6,7 +6,8 @@ import preferences from "./preferences";
import ui from "./ui";
import guide from "./guide";
import common from "./common";
import monitor from "./monitor";
//注意: @符号是保留字符,需要用{'@'}替换
export default {
certd,
authentication,
@@ -16,4 +17,5 @@ export default {
preferences,
guide,
common,
monitor,
};
@@ -0,0 +1,77 @@
export default {
ipAddress: "IP地址",
ipAddressHelper: "填写则固定检查此IP,不从DNS获取域名的IP地址",
remark: "备注",
title: "站点证书监控",
description: "每天0点,检查网站证书的过期时间,到期前10天时将发出提醒(使用默认通知渠道);",
settingLink: "站点监控设置",
limitInfo: "基础版限制1条,专业版以上无限制,当前",
checkAll: "检查全部",
confirmTitle: "确认",
confirmContent: "确认触发检查全部站点证书吗?",
checkSubmitted: "检查任务已提交",
pleaseRefresh: "请稍后刷新页面查看结果",
siteName: "站点名称",
enterSiteName: "请输入站点名称",
domain: "网站域名",
enterDomain: "请输入域名",
enterValidDomain: "请输入正确的域名",
httpsPort: "HTTPS端口",
enterPort: "请输入端口",
certInfo: "证书信息",
issuer: "证书颁发机构",
certDomains: "证书域名",
certProvider: "颁发机构",
certStatus: "证书状态",
error: "错误信息",
status: {
ok: "正常",
expired: "过期",
},
certEffectiveTime: "证书生效时间",
certExpiresTime: "证书到期时间",
remainingValidity: "到期剩余",
expired: "过期",
days: "天",
lastCheckTime: "上次检查时间",
disabled: "禁用启用",
ipCheck: "开启IP检查",
ipCheckHelper: "开启后,会检查IP(或源站)上的证书有效期",
ipSyncAuto: "自动同步IP",
ipSyncMode: "IP同步模式",
ipSyncModeHelper: "选择仅检查IPv4或IPv6,或检查所有IP",
ipSyncModeAll: "检查所有IP",
ipSyncModeIPV4Only: "仅检查IPv4",
ipSyncModeIPV6Only: "仅检查IPv6",
selectRequired: "请选择",
ipCheckConfirm: "确定{status}IP检查?",
ipCount: "IP数量",
ipIgnoreCoherence: "忽略证书一致性",
ipIgnoreCoherenceHelper: "开启后,即使IP上的证书与站点证书不一致,也会被认为是正常,仅校验证书过期时间",
checkStatus: "检查状态",
pipelineId: "关联流水线ID",
certInfoId: "证书ID",
checkSubmittedRefresh: "检查任务已提交,请稍后刷新查看结果",
ipManagement: "IP管理",
bulkImport: "批量导入",
basicLimitError: "基础版只能添加一个监控站点,请赞助升级专业版",
limitExceeded: "对不起,您最多只能创建条{max}监控记录,请购买或升级套餐",
setting: {
siteMonitorSettings: "站点监控设置",
notificationChannel: "通知渠道",
setNotificationChannel: "设置通知渠道",
retryTimes: "重试次数",
monitorRetryTimes: "监控请求重试次数",
monitorCronSetting: "监控定时设置",
cronTrigger: "定时触发监控",
dnsServer: "DNS服务器",
dnsServerHelper: "使用自定义的域名解析服务器,如:1.1.1.1 , 支持多个",
certValidDays: "证书到期前天数",
certValidDaysHelper: "证书到期前多少天发送通知",
},
cert: {
expired: "已过期",
expiring: "即将过期",
noExpired: "未过期",
},
};
@@ -55,7 +55,7 @@ export default {
email_webhook_notifications: "邮件、webhook通知方式",
professional_edition: "专业版",
open_source_support: "开源需要您的赞助支持",
open_source_support: "开源需要您的赞助支持,个人和企业内部使用",
vip_group_priority: "可加VIP群,您的需求将优先实现",
unlimited_site_certificate_monitoring: "站点证书监控无限制",
more_notification_methods: "更多通知方式",
@@ -66,13 +66,13 @@ export default {
get_after_support: "立即赞助",
business_edition: "商业版",
commercial_license: "商业授权,可对外运营",
commercial_license: "商业授权,可对外运营,提供SaaS服务",
all_pro_privileges: "拥有专业版所有特权",
allow_commercial_use_modify_logo_title: "允许商用,可修改logo、标题",
data_statistics: "数据统计",
plugin_management: "插件管理",
unlimited_multi_users: "多用户无限制",
support_user_payment: "支持用户支付",
support_user_payment: "支持用户支付(购买套餐,按流水线条数、域名数量、部署次数计费)",
activate: "激活",
get_pro_code_after_support: "前往获取",
business_contact_author: "",
@@ -123,7 +123,6 @@ function install(app: App, options: any = {}) {
if (scope.key === "__blank__") {
return false;
}
//不能用 !scope.value 否则switch组件设置为关之后就消失了
const { value, key, props } = scope;
return !value && key != "_index" && value != false && value != 0;
@@ -1,12 +1,15 @@
import { usePermission } from "/@/plugin/permission";
import { merge as LodashMerge } from "lodash-es";
import { useProjectStore } from "/@/store/project";
export type UseCrudPermissionExtraProps = {
hasActionPermission: (action: string) => boolean;
};
export type UseCrudPermissionExtra = (props: UseCrudPermissionExtraProps) => any;
export type UseCrudPermissionCompProps = {
prefix: string;
isProjectPermission?: boolean;
projectPermission?: string;
prefix?: string;
extra?: UseCrudPermissionExtra;
[key: string]: any;
};
@@ -20,14 +23,31 @@ export type UseCrudPermissionProps = {
export function useCrudPermission({ permission }: UseCrudPermissionProps) {
const { hasPermissions } = usePermission();
const prefix = permission instanceof Object ? permission.prefix : permission;
//根据权限显示按钮
function hasActionPermission(action: string) {
let hasActionPermission = (action: string) => {
if (!prefix) {
return true;
}
return hasPermissions(prefix + ":" + action);
};
let per: UseCrudPermissionCompProps = permission as any;
if (per == null) {
per = { prefix: "" };
}
if (typeof per === "string") {
per = {
prefix: per || "",
};
}
let prefix = per.prefix || "";
const isProjectPermission = per.isProjectPermission || false;
if (isProjectPermission) {
const projectStore = useProjectStore();
prefix = "";
hasActionPermission = function (value: string) {
return projectStore.hasPermission(value as string);
};
}
function buildCrudPermission(): any {
@@ -36,25 +56,45 @@ export function useCrudPermission({ permission }: UseCrudPermissionProps) {
}
let extra = {};
if (permission instanceof Object) {
extra = permission.extra;
if (permission.extra && permission.extra instanceof Function) {
extra = permission.extra({ hasActionPermission });
if (per instanceof Object) {
extra = per.extra;
if (per.extra && per.extra instanceof Function) {
extra = per.extra({ hasActionPermission });
}
}
let viewPermission = "view";
if (isProjectPermission) {
viewPermission = "read";
}
let addPermission = "add";
if (isProjectPermission) {
addPermission = per.projectPermission || "write";
}
let editPermission = "edit";
if (isProjectPermission) {
editPermission = per.projectPermission || "write";
}
let removePermission = "remove";
if (isProjectPermission) {
removePermission = per.projectPermission || "write";
}
return LodashMerge(
{
actionbar: {
buttons: {
add: { show: hasActionPermission("add") },
add: { show: hasActionPermission(addPermission) },
},
},
rowHandle: {
buttons: {
edit: { show: hasActionPermission("edit") },
remove: { show: hasActionPermission("remove") },
view: { show: hasActionPermission("view") },
edit: { show: hasActionPermission(editPermission) },
remove: { show: hasActionPermission(removePermission) },
view: { show: hasActionPermission(viewPermission) },
copy: { show: hasActionPermission(addPermission) },
},
},
},
@@ -9,6 +9,9 @@ import { useSettingStore } from "/@/store/settings";
import { usePermissionStore } from "/@/plugin/permission/store.permission";
import util from "/@/plugin/permission/util.permission";
import { useUserStore } from "/@/store/user";
import { useProjectStore } from "../store/project";
export const PROJECT_PATH_PREFIX = "/certd/project";
export const SYS_PATH_PREFIX = "/sys";
function buildAccessedMenus(menus: any) {
if (menus == null) {
@@ -124,6 +127,20 @@ function setupAccessGuard(router: Router) {
};
}
return true;
} else {
// 如果是项目模式
const projectStore = useProjectStore();
if (projectStore.isEnterprise) {
//加载我的项目
await projectStore.init();
if (!projectStore.currentProject && !to.path.startsWith(PROJECT_PATH_PREFIX) && !to.path.startsWith(SYS_PATH_PREFIX)) {
//没有项目
return {
path: `${PROJECT_PATH_PREFIX}/join`,
replace: true,
};
}
}
}
});
}
@@ -1,7 +1,5 @@
import { useSettingStore } from "/@/store/settings";
import aboutResource from "/@/router/source/modules/about";
import i18n from "/@/locales/i18n";
import { useProjectStore } from "/@/store/project";
import { useSettingStore } from "/@/store/settings";
export const certdResources = [
{
@@ -25,21 +23,22 @@ export const certdResources = [
const projectStore = useProjectStore();
return projectStore.isEnterprise;
},
isMenu: false,
icon: "ion:apps",
permission: "sys:settings:edit",
keepAlive: true,
auth: true,
},
},
{
title: "certd.sysResources.myProjectDetail",
name: "MyProjectDetail",
path: "/certd/project/detail",
component: "/certd/project/detail/index.vue",
title: "certd.sysResources.projectJoin",
name: "ProjectJoin",
path: "/certd/project/join",
component: "/certd/project/join.vue",
meta: {
isMenu: false,
show: true,
icon: "ion:apps",
permission: "sys:settings:edit",
auth: true,
},
},
{
@@ -50,6 +49,7 @@ export const certdResources = [
meta: {
icon: "ion:analytics-sharp",
keepAlive: true,
auth: true,
},
},
{
@@ -59,6 +59,7 @@ export const certdResources = [
component: "/certd/pipeline/detail.vue",
meta: {
isMenu: false,
auth: true,
},
},
{
@@ -69,6 +70,7 @@ export const certdResources = [
meta: {
icon: "ion:timer-outline",
keepAlive: true,
auth: true,
},
},
{
@@ -79,6 +81,7 @@ export const certdResources = [
meta: {
isMenu: true,
icon: "ion:duplicate-outline",
auth: true,
},
},
{
@@ -88,6 +91,7 @@ export const certdResources = [
component: "/certd/pipeline/template/edit.vue",
meta: {
isMenu: false,
auth: true,
},
},
{
@@ -97,6 +101,7 @@ export const certdResources = [
component: "/certd/pipeline/template/import/index.vue",
meta: {
isMenu: false,
auth: true,
},
},
{
@@ -241,6 +246,10 @@ export const certdResources = [
icon: "mi:user-check",
auth: true,
isMenu: true,
show: () => {
const projectStore = useProjectStore();
return !projectStore.isEnterprise;
},
},
},
{
@@ -254,6 +263,21 @@ export const certdResources = [
isMenu: false,
},
},
{
title: "certd.sysResources.projectMemberManager",
name: "ProjectMemberManager",
path: "/certd/project/detail",
component: "/certd/project/detail/index.vue",
meta: {
show: () => {
const projectStore = useProjectStore();
return projectStore.isEnterprise;
},
isMenu: true,
icon: "ion:apps",
auth: true,
},
},
],
},
{
@@ -1,7 +1,4 @@
import LayoutPass from "/@/layout/layout-pass.vue";
import { useSettingStore } from "/@/store/settings";
import aboutResource from "/@/router/source/modules/about";
import i18n from "/@/locales/i18n";
export const sysResources = [
{
@@ -13,6 +10,7 @@ export const sysResources = [
icon: "ion:settings-outline",
permission: "sys:settings:view",
order: 10,
auth: true,
},
children: [
{
@@ -27,6 +25,7 @@ export const sysResources = [
},
icon: "ion:speedometer-outline",
permission: "sys:auth:user:view",
auth: true,
},
},
@@ -38,6 +37,7 @@ export const sysResources = [
meta: {
icon: "ion:settings-outline",
permission: "sys:settings:view",
auth: true,
},
},
{
@@ -47,6 +47,7 @@ export const sysResources = [
component: "/sys/enterprise/project/index.vue",
meta: {
show: true,
auth: true,
icon: "ion:apps",
permission: "sys:settings:edit",
keepAlive: true,
@@ -60,6 +61,7 @@ export const sysResources = [
meta: {
isMenu: false,
show: true,
auth: true,
icon: "ion:apps",
permission: "sys:settings:edit",
},
@@ -73,6 +75,7 @@ export const sysResources = [
icon: "ion:earth-outline",
permission: "sys:settings:view",
keepAlive: true,
auth: true,
},
},
{
@@ -96,6 +99,7 @@ export const sysResources = [
const settingStore = useSettingStore();
return settingStore.isComm;
},
auth: true,
icon: "ion:document-text-outline",
permission: "sys:settings:view",
},
@@ -110,6 +114,7 @@ export const sysResources = [
const settingStore = useSettingStore();
return settingStore.isComm;
},
auth: true,
icon: "ion:menu",
permission: "sys:settings:view",
keepAlive: true,
@@ -125,6 +130,7 @@ export const sysResources = [
const settingStore = useSettingStore();
return settingStore.isComm;
},
auth: true,
icon: "ion:disc-outline",
permission: "sys:settings:view",
keepAlive: true,
@@ -139,6 +145,7 @@ export const sysResources = [
icon: "ion:extension-puzzle-outline",
permission: "sys:settings:view",
keepAlive: true,
auth: true,
},
},
{
@@ -151,6 +158,7 @@ export const sysResources = [
icon: "ion:extension-puzzle",
permission: "sys:settings:view",
keepAlive: true,
auth: true,
},
},
{
@@ -165,6 +173,7 @@ export const sysResources = [
},
icon: "ion:extension-puzzle",
permission: "sys:settings:view",
auth: true,
},
},
{
@@ -176,6 +185,7 @@ export const sysResources = [
icon: "ion:golf-outline",
permission: "sys:settings:view",
keepAlive: true,
auth: true,
},
},
{
@@ -187,6 +197,7 @@ export const sysResources = [
icon: "ion:list-outline",
permission: "sys:auth:per:view",
keepAlive: true,
auth: true,
},
},
{
@@ -198,6 +209,7 @@ export const sysResources = [
icon: "ion:people-outline",
permission: "sys:auth:role:view",
keepAlive: true,
auth: true,
},
},
{
@@ -209,6 +221,7 @@ export const sysResources = [
icon: "ion:person-outline",
permission: "sys:auth:user:view",
keepAlive: true,
auth: true,
},
},
{
@@ -224,6 +237,7 @@ export const sysResources = [
return settingStore.isComm;
},
keepAlive: true,
auth: true,
},
children: [
{
@@ -238,6 +252,7 @@ export const sysResources = [
},
icon: "ion:cart",
permission: "sys:settings:edit",
auth: true,
},
},
{
@@ -253,6 +268,7 @@ export const sysResources = [
icon: "ion:bag-check",
permission: "sys:settings:edit",
keepAlive: true,
auth: true,
},
},
{
@@ -4,6 +4,7 @@ import { message } from "ant-design-vue";
import { computed, ref } from "vue";
import { useSettingStore } from "../settings";
import { LocalStorage } from "/@/utils/util.storage";
import { useUserStore } from "../user";
export type ProjectItem = {
id: string;
@@ -13,7 +14,11 @@ export type ProjectItem = {
export const useProjectStore = defineStore("app.project", () => {
const myProjects = ref([]);
const lastProjectId = LocalStorage.get("currentProjectId");
const inited = ref(false);
const userStore = useUserStore();
const userId = userStore.getUserInfo?.id;
const lastProjectIdCacheKey = "currentProjectId:" + userId;
const lastProjectId = LocalStorage.get(lastProjectIdCacheKey);
const currentProjectId = ref(lastProjectId); // 直接调用
const projects = computed(() => {
@@ -59,34 +64,80 @@ export const useProjectStore = defineStore("app.project", () => {
function changeCurrentProject(id: string, silent?: boolean) {
currentProjectId.value = id;
LocalStorage.set("currentProjectId", id);
LocalStorage.set(lastProjectIdCacheKey, id);
if (!silent) {
message.success("切换项目成功");
}
}
async function reload() {
const projects = await api.MyProjectList();
myProjects.value = projects;
inited.value = false;
await init();
}
async function init() {
if (!myProjects.value) {
await reload();
if (!inited.value) {
await loadMyProjects();
inited.value = true;
}
return myProjects.value;
}
const isRead = computed(() => {
if (!isEnterprise.value) {
return true;
}
return currentProject.value;
});
const isWrite = computed(() => {
if (!isEnterprise.value) {
return true;
}
return currentProject.value?.permission === "write" || currentProject.value?.permission === "admin";
});
const isAdmin = computed(() => {
if (!isEnterprise.value) {
return true;
}
return currentProject.value?.permission === "admin";
});
function hasPermission(value: string) {
if (!isEnterprise.value) {
return true;
}
if (value === "read") {
return isRead.value;
} else if (value === "write") {
return isWrite.value;
} else if (value === "admin") {
return isAdmin.value;
}
return false;
}
function $reset() {
myProjects.value = [];
currentProjectId.value = "";
}
return {
projects,
myProjects,
currentProject,
currentProjectId,
isEnterprise,
isRead,
isWrite,
isAdmin,
getSearchForm,
loadMyProjects,
changeCurrentProject,
reload,
init,
$reset,
hasPermission,
};
});
@@ -6,6 +6,7 @@
@import "./antdv4.less";
@import "./certd.less";
@import "./dark.less";
@import "./vben.less";
html,
body {
+10 -4
View File
@@ -1,7 +1,13 @@
.dark{
.fs-page-header{
.dark {
.fs-page-header {
.title {
color: #d5d5d5 !important;
}
color: #d5d5d5 !important;
}
}
.vben-normal-menu__item.is-active{
background-color: #3b3b3b !important;
}
}
@@ -18,8 +18,8 @@
-webkit-border-radius: 4em;
-moz-border-radius: 4em;
border-radius: 4em;
background-color: #b3b3b3;
box-shadow: 0px 1px 1px #eee inset;
background-color: #757575;
}
::-webkit-scrollbar-thumb:hover {
@@ -0,0 +1,3 @@
.vben-normal-menu__item.is-active{
background-color: #ebf1f6 !important;
}
@@ -210,11 +210,9 @@ const headerSlots = computed(() => {
</template>
<!-- 侧边额外区域 -->
<template #side-extra>
1111
<LayoutExtraMenu :accordion="preferences.navigation.accordion" :collapse="preferences.sidebar.extraCollapse" :menus="wrapperMenus(extraMenus)" :rounded="isMenuRounded" :theme="sidebarTheme" />
</template>
<template #side-extra-title>
234234234
<VbenLogo v-if="preferences.logo.enable" :text="preferences.app.name" :theme="theme" />
</template>
@@ -4,7 +4,7 @@ import { getCommonColumnDefine } from "/@/views/certd/access/common";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { useI18n } from "/src/locales";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../../../dicts";
import { useDicts } from "../../../dicts";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
@@ -41,7 +41,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
selectedRowKey.value = changed;
ctx.emit("update:modelValue", changed[0]);
};
const { myProjectDict } = useDicts();
const typeRef = ref("aliyun");
context.typeRef = typeRef;
const commonColumnsDefine = getCommonColumnDefine(crudExpose, typeRef, api);
@@ -143,7 +143,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
order: 10,
},
valueBuilder: ({ row, key, value }) => {
row[key] = row.userId > 0 ? "user" : "sys";
row[key] = row.userId != 0 ? "user" : "sys";
},
},
...commonColumnsDefine,
@@ -1,7 +1,7 @@
// @ts-ignore
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { ref } from "vue";
import { myProjectDict } from "../dicts";
import { useDicts } from "../dicts";
import { useProjectStore } from "/@/store/project";
import { getCommonColumnDefine } from "/@/views/certd/access/common";
import { useI18n } from "/src/locales";
@@ -32,6 +32,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const typeRef = ref();
const commonColumnsDefine = getCommonColumnDefine(crudExpose, typeRef, api);
const projectStore = useProjectStore();
const { myProjectDict } = useDicts();
return {
crudOptions: {
request: {
@@ -119,7 +121,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
order: 10,
},
valueBuilder: ({ row, key, value }) => {
row[key] = row.userId > 0 ? "user" : "sys";
row[key] = row.userId != 0 ? "user" : "sys";
},
},
...commonColumnsDefine,
@@ -22,7 +22,7 @@ export default defineComponent({
setup() {
const { t } = useI18n();
const api = createAccessApi("user");
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api } });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api, permission: { isProjectPermission: true } } });
//
onMounted(() => {
@@ -22,7 +22,10 @@ export default defineComponent({
setup() {
const api = createAddonApi({ from: "user", addonType: "" });
addonProvide(api);
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api } });
const { crudBinding, crudRef, crudExpose } = useFs({
createCrudOptions,
context: { api, permission: { isProjectPermission: true } },
});
//
onMounted(() => {
@@ -18,7 +18,12 @@ import createCrudOptions from "./crud";
export default defineComponent({
name: "BasicGroupManager",
setup() {
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
const { crudBinding, crudRef, crudExpose } = useFs({
createCrudOptions,
context: {
permission: { isProjectPermission: true },
},
});
//
onMounted(() => {
@@ -12,6 +12,7 @@ import { useI18n } from "/src/locales";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter();
const { t } = useI18n();
const { hasActionPermission } = context;
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
@@ -96,6 +97,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
icon: "ion:add-circle-outline",
},
import: {
show: hasActionPermission("write"),
title: "从域名提供商导入域名",
type: "primary",
text: "从域名提供商导入",
@@ -111,6 +113,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
syncExpirationDate: {
show: hasActionPermission("write"),
title: "同步域名过期时间",
type: "primary",
icon: "ion:refresh-outline",
@@ -10,7 +10,7 @@
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<template #pagination-left>
<a-tooltip :title="t('certd.batch_delete')">
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batch_delete')">
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
</a-tooltip>
</template>
@@ -25,13 +25,22 @@ import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "/src/locales";
import { useCrudPermission } from "/@/plugin/permission";
const { t } = useI18n();
defineOptions({
name: "DomainManager",
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
const context: any = {
permission: {
isProjectPermission: true,
},
};
const { hasActionPermission } = useCrudPermission({ permission: context.permission });
context.hasActionPermission = hasActionPermission;
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
@@ -8,6 +8,7 @@ import { useSettingStore } from "/@/store/settings";
import { message, Modal } from "ant-design-vue";
import CnameTip from "/@/components/plugins/cert/domains-verify-plan-editor/cname-tip.vue";
import { useCnameImport } from "./use";
import { useCrudPermission } from "/@/plugin/permission";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const crudBinding = crudExpose.crudBinding;
const router = useRouter();
@@ -45,6 +46,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
{ label: t("certd.validation_timed_out"), value: "timeout", color: "red" },
],
});
const { hasActionPermission } = useCrudPermission(context);
return {
crudOptions: {
settings: {
@@ -75,6 +78,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
icon: "ion:add-circle-outline",
},
import: {
show: hasActionPermission("write"),
title: "导入CNAME记录",
type: "primary",
text: "批量导入",
@@ -12,7 +12,7 @@
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<template #pagination-left>
<a-tooltip :title="t('certd.batch_delete')">
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batch_delete')">
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
</a-tooltip>
</template>
@@ -27,13 +27,20 @@ import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "/src/locales";
import { useCrudPermission } from "/@/plugin/permission";
const { t } = useI18n();
defineOptions({
name: "CnameRecord",
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
const context: any = {
permission: { isProjectPermission: true },
};
const { hasActionPermission } = useCrudPermission(context);
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
@@ -1,34 +1,93 @@
import { dict } from "@fast-crud/fast-crud";
import { GetMyProjectList } from "./project/api";
import { request } from "/@/api/service";
export const projectPermissionDict = dict({
const projectPermissionDict = dict({
data: [
{
label: "read",
value: "只读",
value: "read",
label: "查看",
color: "cyan",
icon: "material-symbols:folder-eye-outline-sharp",
},
{
label: "write",
value: "读写",
value: "write",
label: "修改",
color: "green",
icon: "material-symbols:edit-square-outline-rounded",
},
{
label: "admin",
value: "管理员",
value: "admin",
label: "管理员",
color: "orange",
icon: "material-symbols:manage-accounts-rounded",
},
],
});
export const myProjectDict = dict({
url: "/enterprise/project/list",
value: "id",
label: "name",
const projectMemberStatusDict = dict({
data: [
{
value: "pending",
label: "待审核",
color: "orange",
icon: "material-symbols:hourglass-top",
},
{
value: "approved",
label: "已加入",
color: "green",
icon: "material-symbols:done-all",
},
{
value: "rejected",
label: "已拒绝",
color: "red",
icon: "material-symbols:close",
},
],
});
export const userDict = dict({
url: "/sys/authority/user/getSimpleUsers",
const myProjectDict = dict({
url: "/enterprise/project/list",
getData: async () => {
const res = await GetMyProjectList();
return res;
},
value: "id",
label: "name",
immediate: false,
onReady: ({ dict }) => {
for (const item of dict.data) {
item.label = item.name;
item.value = item.id;
}
},
});
const userDict = dict({
url: "/basic/user/getSimpleUsers",
value: "id",
getData: async () => {
const res = await request({
url: "/basic/user/getSimpleUsers",
method: "POST",
});
return res;
},
immediate: false,
onReady: ({ dict }) => {
for (const item of dict.data) {
item.label = item.nickName || item.username || item.phoneCode + item.mobile;
}
},
});
export function useDicts() {
return {
projectPermissionDict,
myProjectDict,
userDict,
projectMemberStatusDict,
};
}
@@ -6,7 +6,7 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
import { useUserStore } from "/@/store/user";
import { useSettingStore } from "/@/store/settings";
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
import { myProjectDict } from "../dicts";
import { useDicts } from "../dicts";
import { useProjectStore } from "/@/store/project";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
@@ -33,7 +33,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const settingStore = useSettingStore();
const selectedRowKeys: Ref<any[]> = ref([]);
context.selectedRowKeys = selectedRowKeys;
const { myProjectDict } = useDicts();
const projectStore = useProjectStore();
return {
@@ -5,7 +5,7 @@
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<template #pagination-left>
<a-tooltip :title="t('certd.batchDelete')">
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batchDelete')">
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
</a-tooltip>
</template>
@@ -20,13 +20,20 @@ import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "/src/locales";
import { useCrudPermission } from "/@/plugin/permission";
const { t } = useI18n();
defineOptions({
name: "PipelineHistory",
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
const context: any = {
permission: { isProjectPermission: true },
};
const { hasActionPermission } = useCrudPermission(context);
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
@@ -11,7 +11,8 @@ import CertView from "/@/views/certd/pipeline/cert-view.vue";
import { useCertUpload } from "/@/views/certd/pipeline/cert-upload/use";
import { useSettingStore } from "/@/store/settings";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../../dicts";
import { useDicts } from "../../dicts";
import { useUserStore } from "/@/store/user";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
@@ -36,9 +37,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
return res;
};
const router = useRouter();
const { myProjectDict } = useDicts();
const settingStore = useSettingStore();
const projectStore = useProjectStore();
const userStore = useUserStore();
const model = useModal();
const viewCert = async (row: any) => {
const cert = await api.GetCert(row.id);
@@ -140,7 +142,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
notification.error({ message: t("certd.certificateNotGenerated") });
return;
}
window.open("/api/monitor/cert/download?id=" + row.id);
let url = "/api/monitor/cert/download?id=" + row.id;
if (projectStore.isEnterprise) {
url += `&projectId=${projectStore.currentProject?.id}`;
}
url += `&token=${userStore.getToken}`;
window.open(url);
},
},
},
@@ -230,9 +237,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
name: "fs-dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.cert.expired"), value: "expired" },
{ label: t("certd.monitor.cert.expiring"), value: "expiring" },
{ label: t("certd.monitor.cert.noExpired"), value: "noExpired" },
{ label: t("monitor.cert.expired"), value: "expired" },
{ label: t("monitor.cert.expiring"), value: "expiring" },
{ label: t("monitor.cert.noExpired"), value: "noExpired" },
],
}),
},
@@ -21,7 +21,7 @@ const { t } = useI18n();
defineOptions({
name: "CertStore",
});
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: { isProjectPermission: true } } });
//
onMounted(() => {
@@ -14,7 +14,8 @@ import { ref } from "vue";
import GroupSelector from "../../basic/group/group-selector.vue";
import { createGroupDictRef } from "../../basic/group/api";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../../dicts";
import { useDicts } from "../../dicts";
import { useCrudPermission } from "/@/plugin/permission";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
const api = siteInfoApi;
@@ -39,7 +40,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const res = await api.AddObj(form);
return res;
};
const { myProjectDict } = useDicts();
const settingsStore = useSettingStore();
const checkStatusDict = dict({
@@ -86,13 +87,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
function checkAll() {
Modal.confirm({
title: t("certd.monitor.confirmTitle"), // "确认"
content: t("certd.monitor.confirmContent"), // "确认触发检查全部站点证书吗?"
title: t("monitor.confirmTitle"), // "确认"
content: t("monitor.confirmContent"), // "确认触发检查全部站点证书吗?"
onOk: async () => {
await siteInfoApi.CheckAll();
notification.success({
message: t("certd.monitor.checkSubmitted"), // "检查任务已提交"
description: t("certd.monitor.pleaseRefresh"), // "请稍后刷新页面查看结果"
message: t("monitor.checkSubmitted"), // "检查任务已提交"
description: t("monitor.pleaseRefresh"), // "请稍后刷新页面查看结果"
});
},
});
@@ -109,6 +110,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}
const projectStore = useProjectStore();
const { hasActionPermission } = useCrudPermission({ permission: context.permission });
return {
id: "siteMonitorCrud",
crudOptions: {
@@ -203,7 +205,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
// 非plus
if (crudBinding.value.data.length >= 1) {
notification.error({
message: t("certd.monitor.basicLimitError"),
message: t("monitor.basicLimitError"),
});
mitter.emit("openVipModal");
return;
@@ -217,7 +219,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const max = suiteDetail.monitorCount.max;
if (max != -1 && max <= suiteDetail.monitorCount.used) {
notification.error({
message: t("certd.monitor.limitExceeded", { max }),
message: t("monitor.limitExceeded", { max }),
});
return;
}
@@ -231,8 +233,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
//导入按钮
import: {
show: true,
text: t("certd.monitor.bulkImport"),
show: hasActionPermission("write"),
text: t("monitor.bulkImport"),
type: "primary",
async click() {
const defaultGroupId = getDefaultGroupId();
@@ -246,7 +248,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
checkAll: {
show: true,
text: t("certd.monitor.checkAll"),
text: t("monitor.checkAll"),
type: "primary",
click() {
checkAll();
@@ -270,7 +272,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id);
await crudExpose.doRefresh();
notification.success({
message: t("certd.monitor.checkSubmittedRefresh"),
message: t("monitor.checkSubmittedRefresh"),
});
},
},
@@ -280,7 +282,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
text: null,
show: compute(({ row }) => row.ipCheck === true),
tooltip: {
title: t("certd.monitor.ipManagement"),
title: t("monitor.ipManagement"),
},
icon: "entypo:address",
click: async ({ row }) => {
@@ -315,29 +317,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
name: {
title: t("certd.monitor.siteName"),
title: t("monitor.siteName"),
search: {
show: true,
},
type: "text",
form: {
rules: [{ required: true, message: t("certd.monitor.enterSiteName") }],
rules: [{ required: true, message: t("monitor.enterSiteName") }],
},
column: {
width: 160,
},
},
domain: {
title: t("certd.monitor.domain"),
title: t("monitor.domain"),
search: {
show: true,
},
type: "text",
form: {
rules: [
{ required: true, message: t("certd.monitor.enterDomain") },
{ required: true, message: t("monitor.enterDomain") },
// @ts-ignore
{ type: "domains", message: t("certd.monitor.enterValidDomain") },
{ type: "domains", message: t("monitor.enterValidDomain") },
],
},
column: {
@@ -358,14 +360,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
httpsPort: {
title: t("certd.monitor.httpsPort"),
title: t("monitor.httpsPort"),
search: {
show: false,
},
type: "number",
form: {
value: 443,
rules: [{ required: true, message: t("certd.monitor.enterPort") }],
rules: [{ required: true, message: t("monitor.enterPort") }],
},
column: {
width: 100,
@@ -373,7 +375,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certInfo: {
title: t("certd.monitor.certInfo"),
title: t("monitor.certInfo"),
type: "text",
form: { show: false },
column: {
@@ -387,10 +389,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
return (
<div>
<div>
{t("certd.monitor.issuer")}: {row.certProvider}
{t("monitor.issuer")}: {row.certProvider}
</div>
<div>
{t("certd.monitor.certDomains")}: {row.certDomains}
{t("monitor.certDomains")}: {row.certDomains}
</div>
</div>
);
@@ -405,7 +407,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certDomains: {
title: t("certd.monitor.certDomains"),
title: t("monitor.certDomains"),
search: {
show: true,
},
@@ -427,7 +429,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certProvider: {
title: t("certd.monitor.certProvider"),
title: t("monitor.certProvider"),
search: {
show: false,
},
@@ -445,15 +447,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certStatus: {
title: t("certd.monitor.certStatus"),
title: t("monitor.certStatus"),
search: {
show: true,
},
type: "dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.status.ok"), value: "ok", color: "green" },
{ label: t("certd.monitor.status.expired"), value: "expired", color: "red" },
{ label: t("monitor.status.ok"), value: "ok", color: "green" },
{ label: t("monitor.status.expired"), value: "expired", color: "red" },
],
}),
form: {
@@ -467,7 +469,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
checkStatus: {
title: t("certd.monitor.checkStatus"),
title: t("monitor.checkStatus"),
search: {
show: false,
},
@@ -490,7 +492,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certEffectiveTime: {
title: t("certd.monitor.certEffectiveTime"),
title: t("monitor.certEffectiveTime"),
search: {
show: false,
},
@@ -505,7 +507,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certExpiresTime: {
title: t("certd.monitor.certExpiresTime"),
title: t("monitor.certExpiresTime"),
search: {
show: false,
},
@@ -519,7 +521,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
remainingValidity: {
title: t("certd.monitor.remainingValidity"),
title: t("monitor.remainingValidity"),
search: {
show: false,
},
@@ -552,18 +554,18 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const color = leftDays < certValidDays ? "red" : "#389e0d";
const percent = (leftDays / effectiveDays) * 100;
// console.log('cellRender', 'effectiveDays', effectiveDays, 'expiresTime', expiresTime, 'applyTime', applyTime, 'percent', percent, row)
return <a-progress title={expireDate + t("certd.monitor.expired")} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}${t("certd.monitor.days")}`} />;
return <a-progress title={expireDate + t("monitor.expired")} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}${t("monitor.days")}`} />;
},
},
},
ipAddress: {
title: t("certd.monitor.ipAddress"),
title: t("monitor.ipAddress"),
search: {
show: false,
},
type: "text",
form: {
helper: t("certd.monitor.ipAddressHelper"),
helper: t("monitor.ipAddressHelper"),
},
column: {
width: 150,
@@ -597,7 +599,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
remark: {
title: t("certd.monitor.remark"),
title: t("monitor.remark"),
search: {
show: false,
},
@@ -612,7 +614,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
lastCheckTime: {
title: t("certd.monitor.lastCheckTime"),
title: t("monitor.lastCheckTime"),
search: {
show: false,
},
@@ -626,7 +628,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
disabled: {
title: t("certd.monitor.disabled"),
title: t("monitor.disabled"),
search: {
show: false,
},
@@ -675,7 +677,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
// }
// },
ipCheck: {
title: t("certd.monitor.ipCheck"),
title: t("monitor.ipCheck"),
type: "dict-switch",
dict: dict({
data: [
@@ -684,9 +686,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
],
}),
form: {
helper: t("certd.monitor.ipCheckHelper"),
helper: t("monitor.ipCheckHelper"),
value: false,
rules: [{ required: true, message: t("certd.monitor.selectRequired") }],
rules: [{ required: true, message: t("monitor.selectRequired") }],
},
column: {
align: "center",
@@ -699,7 +701,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
change({ row, $event }) {
Modal.confirm({
title: t("common.confirm"),
content: t("certd.monitor.ipCheckConfirm", { status: $event ? t("common.enabled") : t("common.disabled") }),
content: t("monitor.ipCheckConfirm", { status: $event ? t("common.enabled") : t("common.disabled") }),
onOk: async () => {
await api.IpCheckChange(row.id, $event);
await crudExpose.doRefresh();
@@ -717,7 +719,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
} as ColumnCompositionProps,
ipSyncAuto: {
title: t("certd.monitor.ipSyncAuto"),
title: t("monitor.ipSyncAuto"),
type: "dict-switch",
dict: dict({
data: [
@@ -732,19 +734,19 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}),
},
column: {
width: 100,
width: 140,
sorter: true,
align: "center",
},
},
ipSyncMode: {
title: t("certd.monitor.ipSyncMode"),
title: t("monitor.ipSyncMode"),
type: "dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.ipSyncModeAll"), value: "all" },
{ label: t("certd.monitor.ipSyncModeIPV4Only"), value: "ipv4" },
{ label: t("certd.monitor.ipSyncModeIPV6Only"), value: "ipv6" },
{ label: t("monitor.ipSyncModeAll"), value: "all" },
{ label: t("monitor.ipSyncModeIPV4Only"), value: "ipv4" },
{ label: t("monitor.ipSyncModeIPV6Only"), value: "ipv6" },
],
}),
form: {
@@ -752,16 +754,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: compute(({ form }) => {
return form.ipSyncAuto;
}),
helper: t("certd.monitor.ipSyncModeHelper"),
helper: t("monitor.ipSyncModeHelper"),
},
column: {
width: 100,
width: 140,
sorter: true,
align: "center",
},
},
ipIgnoreCoherence: {
title: t("certd.monitor.ipIgnoreCoherence"),
title: t("monitor.ipIgnoreCoherence"),
type: "dict-switch",
dict: dict({
data: [
@@ -774,16 +776,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: compute(({ form }) => {
return form.ipCheck;
}),
helper: t("certd.monitor.ipIgnoreCoherenceHelper"),
helper: t("monitor.ipIgnoreCoherenceHelper"),
},
column: {
width: 100,
width: 180,
sorter: true,
align: "center",
},
},
pipelineId: {
title: t("certd.monitor.pipelineId"),
title: t("monitor.pipelineId"),
search: {
show: false,
},
@@ -796,7 +798,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certInfoId: {
title: t("certd.monitor.certInfoId"),
title: t("monitor.certInfoId"),
search: {
show: false,
},
@@ -809,7 +811,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
error: {
title: t("certd.monitor.error"),
title: t("monitor.error"),
search: {
show: false,
},
@@ -2,14 +2,14 @@
<fs-page>
<template #header>
<div class="title flex items-center">
{{ t("certd.monitor.title") }}
{{ t("monitor.title") }}
<div class="sub flex-1">
<div>
{{ t("certd.monitor.description") }}
<router-link to="/certd/monitor/setting">{{ t("certd.monitor.settingLink") }}</router-link>
{{ t("monitor.description") }}
<router-link to="/certd/monitor/setting">{{ t("monitor.settingLink") }}</router-link>
</div>
<div class="flex items-center">
{{ t("certd.monitor.limitInfo") }}
{{ t("monitor.limitInfo") }}
<vip-button class="ml-5" mode="nav"></vip-button>
</div>
</div>
@@ -34,7 +34,12 @@ const { t } = useI18n();
defineOptions({
name: "SiteCertMonitor",
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
const context: any = {
permission: {
isProjectPermission: true,
},
};
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
const handleBatchDelete = context.handleBatchDelete;
@@ -1,43 +1,43 @@
<template>
<fs-page class="page-user-settings page-site-monitor-setting">
<template #header>
<div class="title">{{ t("certd.monitor.setting.siteMonitorSettings") }}</div>
<div class="title">{{ t("monitor.setting.siteMonitorSettings") }}</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="t('certd.monitor.setting.notificationChannel')" :name="['notificationId']">
<a-form-item :label="t('monitor.setting.notificationChannel')" :name="['notificationId']">
<div class="flex">
<NotificationSelector v-model="formState.notificationId" />
</div>
<div class="helper">{{ t("certd.monitor.setting.setNotificationChannel") }}</div>
<div class="helper">{{ t("monitor.setting.setNotificationChannel") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.retryTimes')" :name="['retryTimes']">
<a-form-item :label="t('monitor.setting.retryTimes')" :name="['retryTimes']">
<div class="flex">
<a-input-number v-model:value="formState.retryTimes" />
</div>
<div class="helper">{{ t("certd.monitor.setting.monitorRetryTimes") }}</div>
<div class="helper">{{ t("monitor.setting.monitorRetryTimes") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.certValidDays')" :name="['certValidDays']">
<a-form-item :label="t('monitor.setting.certValidDays')" :name="['certValidDays']">
<div class="flex">
<a-input-number v-model:value="formState.certValidDays" />
</div>
<div class="helper">{{ t("certd.monitor.setting.certValidDaysHelper") }}</div>
<div class="helper">{{ t("monitor.setting.certValidDaysHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.dnsServer')" :name="['dnsServer']">
<a-form-item :label="t('monitor.setting.dnsServer')" :name="['dnsServer']">
<div class="flex">
<a-select v-model:value="formState.dnsServer" :token-separators="[' ', ',', '', '', '|']" mode="tags" :open="false" />
</div>
<div class="helper">{{ t("certd.monitor.setting.dnsServerHelper") }}</div>
<div class="helper">{{ t("monitor.setting.dnsServerHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.monitorCronSetting')" :name="['cron']">
<a-form-item :label="t('monitor.setting.monitorCronSetting')" :name="['cron']">
<div class="flex flex-baseline">
<cron-editor v-model="formState.cron" :disabled="!settingsStore.isPlus" :allow-every-min="userStore.isAdmin" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">{{ t("certd.monitor.setting.cronTrigger") }}</div>
<div class="helper">{{ t("monitor.setting.cronTrigger") }}</div>
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<loading-button type="primary" html-type="button" :click="doSave">{{ t("certd.save") }}</loading-button>
<loading-button type="primary" html-type="button" :click="doSave" :disabled="!hasActionPermission('write')">{{ t("certd.save") }}</loading-button>
</a-form-item>
</a-form>
</div>
@@ -55,6 +55,7 @@ import { utils } from "/@/utils";
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
import { useI18n } from "/src/locales";
import { useSettingStore } from "/src/store/settings";
import { useCrudPermission } from "/@/plugin/permission";
const { t } = useI18n();
@@ -73,6 +74,8 @@ async function loadUserSettings() {
merge(formState, data);
}
const { hasActionPermission } = useCrudPermission({ permission: { isProjectPermission: true } });
loadUserSettings();
const doSave = async (form: any) => {
await utils.sleep(300);
@@ -6,7 +6,7 @@ import { Modal } from "ant-design-vue";
import { mitter } from "/@/utils/util.mitt";
import { useI18n } from "/src/locales";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../dicts";
import { useDicts } from "../dicts";
export function notificationProvide(api: any) {
provide("notificationApi", api);
@@ -29,7 +29,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
};
const projectStore = useProjectStore();
const { myProjectDict } = useDicts();
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
@@ -22,7 +22,7 @@ export default defineComponent({
setup() {
const api = createNotificationApi();
notificationProvide(api);
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api } });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api, permission: { isProjectPermission: true } } });
//
onMounted(() => {
@@ -4,7 +4,8 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
import { OPEN_API_DOC, openkeyApi } from "./api";
import { useModal } from "/@/use/use-modal";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../../dicts";
import { computed } from "vue";
import { useDicts } from "../../dicts";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
@@ -28,6 +29,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const res = await api.AddObj(form);
return res;
};
const { myProjectDict } = useDicts();
const projectStore = useProjectStore();
const model = useModal();
return {
@@ -176,6 +178,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
form: {
show: false,
},
column: {
show: computed(() => {
return projectStore.isEnterprise;
}),
width: 120,
align: "center",
sorter: true,
},
},
createTime: {
title: t("certd.fields.createTime"),
@@ -19,7 +19,7 @@ import { OPEN_API_DOC } from "/@/views/certd/open/openkey/api";
defineOptions({
name: "OpenKey",
});
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: { isProjectPermission: true } } });
//
onMounted(() => {
@@ -14,15 +14,18 @@ import GroupSelector from "/@/views/certd/pipeline/group/group-selector.vue";
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
import { useCertViewer } from "/@/views/certd/pipeline/use";
import { useI18n } from "/src/locales";
import { myProjectDict } from "../dicts";
import { useDicts } from "../dicts";
import { useProjectStore } from "/@/store/project";
import { useCrudPermission } from "/@/plugin/permission";
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog, permission } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter();
const lastResRef = ref();
const { t } = useI18n();
const { hasActionPermission } = useCrudPermission({ permission });
const { openUploadCreateDialog } = useCertUpload();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
@@ -50,6 +53,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
delete form.lastVars;
delete form.createTime;
delete form.id;
delete form.webhook;
let pipeline = form.content;
if (typeof pipeline === "string" && pipeline.startsWith("{")) {
pipeline = JSON.parse(form.content);
@@ -69,14 +73,14 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
const settingStore = useSettingStore();
const projectStore = useProjectStore();
const { myProjectDict } = useDicts();
const DEFAULT_WILL_EXPIRE_DAYS = settingStore.sysPublic.defaultWillExpireDays || settingStore.sysPublic.defaultCertRenewDays || 15;
function onDialogOpen(opt: any) {
const searchForm = crudExpose.getSearchValidatedFormData();
opt.initialForm = {
...opt.initialForm,
groupId: searchForm.groupId,
...opt.initialForm,
};
}
@@ -124,9 +128,11 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
click() {
openCertApplyDialog({ key: "CertApply" });
},
show: hasActionPermission("write"),
},
uploadCert: {
order: 2,
show: hasActionPermission("write"),
text: t("certd.commercialCertHosting"),
type: "primary",
tooltip: {
@@ -207,6 +213,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
},
},
copy: {
show: hasActionPermission("write"),
click: async context => {
settingStore.checkPlus();
const { ui } = useUi();
@@ -216,7 +223,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
row = info.pipeline;
row.content = JSON.parse(row.content);
row.title = row.title + "_copy";
await crudExpose.openCopy({
await crudExpose.openAdd({
row: row,
index: context.index,
});
@@ -224,6 +231,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
class: "need-plus",
},
config: {
show: hasActionPermission("write"),
order: 1,
title: t("certd.actions.editPipeline"),
type: "link",
@@ -234,6 +242,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
},
},
edit: {
show: hasActionPermission("write"),
order: 2,
title: t("certd.actions.editConfigGroup"),
icon: "ant-design:setting-outlined",
@@ -656,6 +665,14 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
form: {
show: false,
},
column: {
show: computed(() => {
return settingStore.isEnterprise;
}),
width: 120,
align: "center",
sorter: true,
},
},
updateTime: {
title: t("certd.fields.updateTime"),
@@ -2,7 +2,7 @@ import { useI18n } from "/src/locales";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { pipelineGroupApi } from "./api";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../../dicts";
import { useDicts } from "../../dicts";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
@@ -28,7 +28,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
};
const projectStore = useProjectStore();
const { myProjectDict } = useDicts();
return {
crudOptions: {
settings: {
@@ -14,12 +14,16 @@
import { defineComponent, onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { createApi } from "./api";
export default defineComponent({
name: "PipelineGroupManager",
setup() {
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
const { crudBinding, crudRef, crudExpose } = useFs({
createCrudOptions,
context: {
permission: { isProjectPermission: true },
},
});
//
onMounted(() => {
@@ -13,7 +13,7 @@
</a-alert> -->
<fs-crud ref="crudRef" v-bind="crudBinding">
<template #actionbar-right>
<a-dropdown class="ml-1">
<a-dropdown v-if="hasActionPermission('write')" class="ml-1">
<a-button type="primary" class="ant-dropdown-link" @click.prevent>
{{ t("certd.pipelinePage.addMore") }}
<DownOutlined />
@@ -37,11 +37,11 @@
<div v-if="selectedRowKeys.length > 0" class="batch-actions">
<div class="batch-actions-inner">
<span>{{ t("certd.selectedCount", { count: selectedRowKeys.length }) }}</span>
<fs-button icon="ion:trash-outline" class="color-red" type="link" :text="t('certd.batchDelete')" @click="batchDelete"></fs-button>
<fs-button v-if="hasActionPermission('write')" icon="ion:trash-outline" class="color-red" type="link" :text="t('certd.batchDelete')" @click="batchDelete"></fs-button>
<batch-rerun :selected-row-keys="selectedRowKeys" @change="batchFinished"></batch-rerun>
<change-group :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-group>
<change-notification :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-notification>
<change-trigger :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-trigger>
<change-group v-if="hasActionPermission('write')" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-group>
<change-notification v-if="hasActionPermission('write')" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-notification>
<change-trigger v-if="hasActionPermission('write')" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-trigger>
</div>
</div>
<template #form-bottom>
@@ -68,6 +68,7 @@ import { useSettingStore } from "/@/store/settings";
import { groupDictRef } from "./group/dicts";
import { useCertPipelineCreator } from "./certd-form/use";
import { useRouter } from "vue-router";
import { useCrudPermission } from "/@/plugin/permission";
defineOptions({
name: "PipelineManager",
@@ -106,7 +107,10 @@ function openCertApplyDialog(req: { key: string; title: string }) {
openAddCertdPipelineDialog({ pluginName: req.key, defaultGroupId, title: req.title });
}
context.openCertApplyDialog = openCertApplyDialog;
context.permission = { isProjectPermission: true };
const { hasActionPermission } = useCrudPermission({ permission: { isProjectPermission: true } });
context.hasActionPermission = hasActionPermission;
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
//
@@ -49,6 +49,7 @@
</div>
</template>
</v-draggable>
<div v-if="currentTask.steps?.length > 0" class="helper mt-6">任务步骤会串行执行如果前面步骤失败后面的步骤不会运行</div>
</a-form-item>
</div>
</a-form>
@@ -46,7 +46,7 @@
</span>
</a-tag>
</div>
<div class="basis-40 flex justify-end mr-10">
<div v-if="hasActionPermission('write')" class="basis-40 flex justify-end mr-10">
<template v-if="editMode">
<fs-button type="primary" :loading="saveLoading" @click="save">保存</fs-button>
<fs-button class="ml-5" @click="cancel">取消</fs-button>
@@ -333,6 +333,7 @@ import { getCronNextTimes } from "/@/components/cron-editor/utils";
import { useCertViewer } from "/@/views/certd/pipeline/use";
import { useI18n } from "/@/locales";
import TriggerIcon from "./component/trigger-icon.vue";
import { useCrudPermission } from "/@/plugin/permission";
export default defineComponent({
name: "PipelineEdit",
@@ -1002,12 +1003,15 @@ export default defineComponent({
const hasWebhookTrigger = computed(() => {
return currentPipeline.value?.triggers?.some((item: any) => item.type === "webhook");
});
const { hasActionPermission } = useCrudPermission({ permission: { isProjectPermission: true } });
return {
isCert,
pipeline,
currentHistory,
histories,
goBack,
hasActionPermission,
userStore,
settingStore,
...useTaskRet,
@@ -17,7 +17,7 @@
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<template #pagination-left>
<a-tooltip :title="t('certd.batchDelete')">
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batchDelete')">
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
</a-tooltip>
</template>
@@ -32,13 +32,21 @@ import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "/src/locales";
import { useCrudPermission } from "/@/plugin/permission";
const { t } = useI18n();
defineOptions({
name: "CnameRecord",
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
const context: any = {
permission: {
isProjectPermission: true,
},
};
const { hasActionPermission } = useCrudPermission({ permission: context.permission });
context.hasActionPermission = hasActionPermission;
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
@@ -7,7 +7,7 @@ import * as pipelineApi from "../api";
import { useTemplate } from "/@/views/certd/pipeline/template/use";
import { useI18n } from "/@/locales";
import { useProjectStore } from "/@/store/project";
import { myProjectDict } from "../../dicts";
import { useDicts } from "../../dicts";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const api = templateApi;
const { t } = useI18n();
@@ -36,7 +36,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const router = useRouter();
const model = useModal();
const { myProjectDict } = useDicts();
const { openCreateFromTemplateDialog } = useTemplate();
return {
@@ -78,7 +78,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
add: {
text: t("certd.template.createTemplate"),
type: "primary",
show: true,
},
},
},
@@ -21,7 +21,12 @@ import { useI18n } from "/src/locales";
defineOptions({
name: "PipelineTemplate",
});
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
const { crudBinding, crudRef, crudExpose } = useFs({
createCrudOptions,
context: {
permission: { isProjectPermission: true },
},
});
const { t } = useI18n();
//
onMounted(() => {
@@ -3,8 +3,12 @@ import { notification } from "ant-design-vue";
import CertView from "/@/views/certd/pipeline/cert-view.vue";
import { env } from "/@/utils/util.env";
import { useModal } from "/@/use/use-modal";
import { useProjectStore } from "/@/store/project";
import { useUserStore } from "/@/store/user";
export function useCertViewer() {
const projectStore = useProjectStore();
const userStore = useUserStore();
const model = useModal();
const viewCert = async (id: number) => {
const cert = await api.GetCert(id);
@@ -33,7 +37,11 @@ export function useCertViewer() {
content: () => {
const children = [];
for (const file of files) {
const downloadUrl = `${env.API}/pi/history/download?pipelineId=${id}&fileId=${file.id}`;
let downloadUrl = `${env.API}/pi/history/download?pipelineId=${id}&fileId=${file.id}`;
if (projectStore.isEnterprise) {
downloadUrl += `&projectId=${projectStore.currentProject?.id}`;
}
downloadUrl += `&token=${userStore.getToken}`;
children.push(
<div>
<div class={"flex-o m-5"}>
@@ -10,6 +10,13 @@ export async function GetList(query: any) {
});
}
export async function GetMyProjectList() {
return await request({
url: apiPrefix + "/list",
method: "post",
});
}
export async function GetPage(query: any) {
return await request({
url: apiPrefix + "/page",

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