mirror of
https://github.com/certd/certd.git
synced 2026-04-28 16:17:25 +08:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c546b5290 | |||
| a853fc2026 | |||
| 92c9ac3826 | |||
| 78c2ced43b | |||
| 72f850f675 | |||
| bc326489ab | |||
| ea5e7d9563 | |||
| 5b5b48fc06 | |||
| 1548ba0b8d | |||
| 26b1c4244f | |||
| 8a4e981931 | |||
| 6163c3f08e | |||
| e17f381b1f | |||
| 316537eb4d | |||
| b2c421600c | |||
| 787f6ef528 | |||
| 8578547467 | |||
| 51ab6d6da1 | |||
| 3a8b5de8f7 | |||
| faf08f6513 | |||
| 06c69d23be | |||
| 1bcadd5f8e | |||
| 524195d729 | |||
| 0c25d277ef | |||
| 27b0348e1d | |||
| ea5aa68769 | |||
| 99fefb168a | |||
| 49457505cd | |||
| bfc948a9b4 | |||
| c407206627 | |||
| 39d3bf97d1 | |||
| 79be392775 |
@@ -3,6 +3,12 @@
|
||||
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
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
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
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@
|
||||
}
|
||||
},
|
||||
"npmClient": "pnpm",
|
||||
"version": "1.38.11"
|
||||
"version": "1.38.12"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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/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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Simple and unopinionated ACME client",
|
||||
"private": false,
|
||||
"author": "nmorsman",
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"type": "module",
|
||||
"module": "scr/index.js",
|
||||
"main": "src/index.js",
|
||||
@@ -18,7 +18,7 @@
|
||||
"types"
|
||||
],
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.11",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@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": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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 +1 @@
|
||||
23:40
|
||||
23:18
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/basic",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -47,5 +47,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/pipeline",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -18,8 +18,8 @@
|
||||
"compile": "tsc --skipLibCheck --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.11",
|
||||
"@certd/plus-core": "^1.38.11",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"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": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-huawei",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"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": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-iframe",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -31,5 +31,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/jdcloud",
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"description": "jdcloud openApi sdk",
|
||||
"main": "./dist/bundle.js",
|
||||
"module": "./dist/bundle.js",
|
||||
@@ -56,5 +56,5 @@
|
||||
"fetch"
|
||||
]
|
||||
},
|
||||
"gitHead": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/lib-k8s",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"pub": "npm publish"
|
||||
},
|
||||
"dependencies": {
|
||||
"@certd/basic": "^1.38.11",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@kubernetes/client-node": "0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,5 +32,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/lib-server",
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -28,11 +28,11 @@
|
||||
],
|
||||
"license": "AGPL",
|
||||
"dependencies": {
|
||||
"@certd/acme-client": "^1.38.11",
|
||||
"@certd/basic": "^1.38.11",
|
||||
"@certd/pipeline": "^1.38.11",
|
||||
"@certd/plugin-lib": "^1.38.11",
|
||||
"@certd/plus-core": "^1.38.11",
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plugin-lib": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"@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": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ export class AccessEntity {
|
||||
@Column({ name: 'project_id', comment: '项目id' })
|
||||
projectId: number;
|
||||
|
||||
@Column({ comment: '权限等级', length: 100 })
|
||||
level: string; // user common system
|
||||
|
||||
@Column({
|
||||
name: 'create_time',
|
||||
comment: '创建时间',
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/midway-flyway-js",
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"description": "midway with flyway, sql upgrade way ",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
@@ -46,5 +46,5 @@
|
||||
"typeorm": "^0.3.11",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-cert",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"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.11",
|
||||
"@certd/basic": "^1.38.11",
|
||||
"@certd/pipeline": "^1.38.11",
|
||||
"@certd/plugin-lib": "^1.38.11",
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plugin-lib": "^1.38.12",
|
||||
"psl": "^1.9.0",
|
||||
"punycode.js": "^2.3.1"
|
||||
},
|
||||
@@ -38,5 +38,5 @@
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.4.2"
|
||||
},
|
||||
"gitHead": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
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)
|
||||
|
||||
**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,7 +1,7 @@
|
||||
{
|
||||
"name": "@certd/plugin-lib",
|
||||
"private": false,
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"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.11",
|
||||
"@certd/basic": "^1.38.11",
|
||||
"@certd/pipeline": "^1.38.11",
|
||||
"@certd/plus-core": "^1.38.11",
|
||||
"@certd/acme-client": "^1.38.12",
|
||||
"@certd/basic": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@certd/plus-core": "^1.38.12",
|
||||
"@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": "1f002159e2a3c73fb5e00341a344effa07d6f653"
|
||||
"gitHead": "49457505cdf8156fd9d936b8e9ace0b48e43a6b2"
|
||||
}
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
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)
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@certd/ui-client",
|
||||
"version": "1.38.11",
|
||||
"version": "1.38.12",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --open",
|
||||
@@ -106,8 +106,8 @@
|
||||
"zod-defaults": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@certd/lib-iframe": "^1.38.11",
|
||||
"@certd/pipeline": "^1.38.11",
|
||||
"@certd/lib-iframe": "^1.38.12",
|
||||
"@certd/pipeline": "^1.38.12",
|
||||
"@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 |
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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,3 +1,4 @@
|
||||
//注意: @符号是保留字符,需要用{'@'}替换, AI请务必提醒我修改
|
||||
export default {
|
||||
app: {
|
||||
crud: {
|
||||
@@ -217,6 +218,8 @@ export default {
|
||||
projectUserManager: "Project User Management",
|
||||
myProjectManager: "My Projects",
|
||||
myProjectDetail: "Project Detail",
|
||||
projectJoin: "Join Project",
|
||||
currentProject: "Current Project",
|
||||
},
|
||||
certificateRepo: {
|
||||
title: "Certificate Repository",
|
||||
@@ -274,77 +277,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,7 +630,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>",
|
||||
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",
|
||||
@@ -889,6 +821,24 @@ export default {
|
||||
write: "Write",
|
||||
admin: "Admin",
|
||||
},
|
||||
projectMemberStatus: "Member Status",
|
||||
},
|
||||
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",
|
||||
},
|
||||
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: {
|
||||
@@ -223,6 +224,8 @@ export default {
|
||||
enterpriseSetting: "企业设置",
|
||||
myProjectManager: "我的项目",
|
||||
myProjectDetail: "项目详情",
|
||||
projectJoin: "加入项目",
|
||||
currentProject: "当前项目",
|
||||
},
|
||||
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,7 +636,7 @@ export default {
|
||||
password: "密码",
|
||||
pleaseEnterPassword: "请输入密码",
|
||||
qqEmailAuthCodeHelper: "如果是qq邮箱,需要到qq邮箱的设置里面申请授权码作为密码",
|
||||
senderEmailHelper: "您可以使用 名称<邮箱> 的格式,来修改发件人名称,例如: autossl<certd@example.com>",
|
||||
senderEmailHelper: "您可以使用 名称<邮箱> 的格式,来修改发件人名称,例如: autossl<certd{'@'}example.com>",
|
||||
senderEmail: "发件邮箱",
|
||||
pleaseEnterSenderEmail: "请输入发件邮箱",
|
||||
useSsl: "是否ssl",
|
||||
@@ -908,9 +833,27 @@ export default {
|
||||
projectDetailDescription: "管理项目成员",
|
||||
projectPermission: "权限",
|
||||
permission: {
|
||||
read: "读取",
|
||||
write: "写入",
|
||||
read: "查看",
|
||||
write: "修改",
|
||||
admin: "管理员",
|
||||
},
|
||||
projectMemberStatus: "成员状态",
|
||||
},
|
||||
project: {
|
||||
noProjectJoined: "您还没有加入任何项目",
|
||||
applyToJoin: "请申请加入项目以开始使用",
|
||||
projectList: "项目列表",
|
||||
createdAt: "创建时间",
|
||||
applyJoin: "申请加入",
|
||||
noProjects: "暂无项目",
|
||||
fetchFailed: "获取项目列表失败",
|
||||
applySuccess: "申请成功,等待管理员审核",
|
||||
applyFailed: "申请失败,请稍后重试",
|
||||
leave: "退出项目",
|
||||
leaveSuccess: "退出项目成功",
|
||||
leaveFailed: "退出项目失败,请稍后重试",
|
||||
applyJoinConfirm: "确认加入项目?",
|
||||
leaveConfirm: "确认退出项目?",
|
||||
viewDetail: "查看详情",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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,37 @@ 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",
|
||||
title: "certd.sysResources.currentProject",
|
||||
name: "CurrentProject",
|
||||
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,
|
||||
},
|
||||
},
|
||||
{
|
||||
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 +64,7 @@ export const certdResources = [
|
||||
meta: {
|
||||
icon: "ion:analytics-sharp",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -59,6 +74,7 @@ export const certdResources = [
|
||||
component: "/certd/pipeline/detail.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -69,6 +85,7 @@ export const certdResources = [
|
||||
meta: {
|
||||
icon: "ion:timer-outline",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -79,6 +96,7 @@ export const certdResources = [
|
||||
meta: {
|
||||
isMenu: true,
|
||||
icon: "ion:duplicate-outline",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -88,6 +106,7 @@ export const certdResources = [
|
||||
component: "/certd/pipeline/template/edit.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -97,6 +116,7 @@ export const certdResources = [
|
||||
component: "/certd/pipeline/template/import/index.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -241,6 +261,10 @@ export const certdResources = [
|
||||
icon: "mi:user-check",
|
||||
auth: true,
|
||||
isMenu: true,
|
||||
show: () => {
|
||||
const projectStore = useProjectStore();
|
||||
return !projectStore.isEnterprise;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: [
|
||||
@@ -738,13 +740,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
},
|
||||
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,7 +754,7 @@ 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,
|
||||
@@ -761,7 +763,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
},
|
||||
ipIgnoreCoherence: {
|
||||
title: t("certd.monitor.ipIgnoreCoherence"),
|
||||
title: t("monitor.ipIgnoreCoherence"),
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
@@ -774,7 +776,7 @@ 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,
|
||||
@@ -783,7 +785,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
},
|
||||
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,10 +14,10 @@ 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";
|
||||
|
||||
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog, hasActionPermission } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
const lastResRef = ref();
|
||||
|
||||
@@ -50,6 +50,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 +70,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 +125,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 +210,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
},
|
||||
},
|
||||
copy: {
|
||||
show: hasActionPermission("write"),
|
||||
click: async context => {
|
||||
settingStore.checkPlus();
|
||||
const { ui } = useUi();
|
||||
@@ -216,7 +220,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 +228,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 +239,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 +662,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 });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
|
||||
+1
@@ -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",
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq,
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { userDict } from "../dicts";
|
||||
import { userDict } from "../../sys/enterprise/dicts";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { request } from "/src/api/service";
|
||||
|
||||
const apiPrefix = "/enterprise/myProjectMember";
|
||||
const apiPrefix = "/enterprise/projectMember";
|
||||
const userApiPrefix = "/sys/authority/user";
|
||||
export async function GetList(query: any) {
|
||||
return await request({
|
||||
@@ -65,3 +65,11 @@ export async function GetUserSimpleByIds(query: any) {
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
export async function ApproveJoin(form: any) {
|
||||
return await request({
|
||||
url: "/enterprise/project/approveJoin",
|
||||
method: "post",
|
||||
data: form,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ import * as api from "./api";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { userDict } from "../../dicts";
|
||||
import { useDicts } from "../../dicts";
|
||||
import { useApprove } from "./use";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
@@ -34,6 +35,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
const settingStore = useSettingStore();
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
const { hasActionPermission } = context;
|
||||
const { userDict, projectMemberStatusDict, projectPermissionDict } = useDicts();
|
||||
const { openApproveDialog } = useApprove();
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
@@ -105,7 +109,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择用户" }],
|
||||
},
|
||||
editForm: {
|
||||
show: false,
|
||||
},
|
||||
@@ -116,23 +123,64 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
permission: {
|
||||
title: t("certd.ent.projectPermission"),
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: t("certd.ent.permission.read"), value: "read", color: "cyan" },
|
||||
{ label: t("certd.ent.permission.write"), value: "write", color: "blue" },
|
||||
{ label: t("certd.ent.permission.admin"), value: "admin", color: "green" },
|
||||
],
|
||||
}),
|
||||
dict: projectPermissionDict,
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择权限" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: t("certd.ent.projectMemberStatus"),
|
||||
type: "dict-select",
|
||||
dict: projectMemberStatusDict,
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择状态" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
cellRender: ({ row }) => {
|
||||
let approveButton: any = "";
|
||||
if (row.status === "pending" && hasActionPermission("admin")) {
|
||||
approveButton = (
|
||||
<fs-button
|
||||
class="ml-2"
|
||||
type="primary"
|
||||
size="small"
|
||||
onClick={async () => {
|
||||
openApproveDialog({
|
||||
id: row.id,
|
||||
permission: row.permission,
|
||||
onSubmit: async (form: any) => {
|
||||
form.userId = row.userId;
|
||||
await api.ApproveJoin(form);
|
||||
crudExpose.doRefresh();
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</fs-button>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div class="flex items-center">
|
||||
<fs-values-format model-value={row.status} dict={projectMemberStatusDict}></fs-values-format>
|
||||
{approveButton}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.createTime"),
|
||||
type: "datetime",
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
<fs-page class="page-project-detail">
|
||||
<template #header>
|
||||
<div class="title">
|
||||
{{ t("certd.ent.projectDetailManager") }}
|
||||
<span class="sub">
|
||||
{{ t("certd.ent.projectDetailDescription") }}
|
||||
当前项目 :{{ project?.name }}
|
||||
<span class="sub flex-inline items-center">
|
||||
管理员:<fs-values-format :model-value="project.adminId" :dict="userDict" color="green"></fs-values-format>
|
||||
<!-- <a-divider type="vertical"></a-divider>
|
||||
<fs-values-format :model-value="project.permission" :dict="projectPermissionDict"></fs-values-format>
|
||||
<a-divider type="vertical"></a-divider>
|
||||
<fs-values-format :model-value="project.status" :dict="projectMemberStatusDict"></fs-values-format> -->
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -19,13 +23,17 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { onActivated, onMounted, Ref, ref } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { DeleteBatch } from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import { request } from "/@/api/service";
|
||||
import { useDicts } from "../../dicts";
|
||||
import { useCrudPermission } from "/@/plugin/permission";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -35,11 +43,38 @@ defineOptions({
|
||||
|
||||
const route = useRoute();
|
||||
const projectIdStr = route.query.projectId as string;
|
||||
const projectId = Number(projectIdStr);
|
||||
let projectId = Number(projectIdStr);
|
||||
const projectStore = useProjectStore();
|
||||
if (!projectId) {
|
||||
projectId = projectStore.currentProject?.id;
|
||||
}
|
||||
|
||||
const { projectPermissionDict, projectMemberStatusDict, userDict } = useDicts();
|
||||
|
||||
const project: Ref<any> = ref({});
|
||||
|
||||
async function loadProjectDetail() {
|
||||
if (projectId) {
|
||||
const res = await request({
|
||||
url: `/enterprise/project/detail`,
|
||||
method: "post",
|
||||
params: {
|
||||
projectId,
|
||||
},
|
||||
});
|
||||
project.value = res;
|
||||
}
|
||||
}
|
||||
|
||||
const context: any = {
|
||||
projectId,
|
||||
permission: {
|
||||
isProjectPermission: true,
|
||||
projectPermission: "admin",
|
||||
},
|
||||
};
|
||||
const { hasActionPermission } = useCrudPermission(context);
|
||||
context.hasActionPermission = hasActionPermission;
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||
|
||||
const selectedRowKeys = context.selectedRowKeys;
|
||||
@@ -61,7 +96,12 @@ const handleBatchDelete = () => {
|
||||
};
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (!projectId) {
|
||||
message.error("您还未选择项目");
|
||||
return;
|
||||
}
|
||||
await loadProjectDetail();
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(async () => {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import { useDicts } from "../../dicts";
|
||||
import { useFormDialog } from "/@/use/use-dialog";
|
||||
|
||||
export function useApprove() {
|
||||
const { openFormDialog } = useFormDialog();
|
||||
const { projectPermissionDict, projectMemberStatusDict, userDict } = useDicts();
|
||||
function openApproveDialog({ id, permission, onSubmit }: { id: any; permission: any; onSubmit: any }) {
|
||||
openFormDialog({
|
||||
title: "审批加入申请",
|
||||
columns: {
|
||||
permission: {
|
||||
title: "成员权限",
|
||||
type: "dict-select",
|
||||
dict: projectPermissionDict,
|
||||
},
|
||||
status: {
|
||||
title: "审批结果",
|
||||
type: "dict-radio",
|
||||
dict: dict({
|
||||
data: [
|
||||
{
|
||||
label: "通过",
|
||||
value: "approved",
|
||||
},
|
||||
{
|
||||
label: "拒绝",
|
||||
value: "rejected",
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
},
|
||||
onSubmit: onSubmit,
|
||||
initialForm: {
|
||||
id: id,
|
||||
permission: permission,
|
||||
status: "approved",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
openApproveDialog,
|
||||
};
|
||||
}
|
||||
@@ -30,7 +30,8 @@ const { t } = useI18n();
|
||||
defineOptions({
|
||||
name: "MyProjectManager",
|
||||
});
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
||||
const context: any = { permission: { isProjectPermission: true, projectPermission: "admin" } };
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||
|
||||
const selectedRowKeys = context.selectedRowKeys;
|
||||
const handleBatchDelete = () => {
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<fs-page class="page-project-join">
|
||||
<template #header>
|
||||
<div class="title">
|
||||
{{ t("certd.sysResources.projectJoin") }}
|
||||
<span v-if="projectStore.projects.length === 0" class="sub">{{ t("certd.project.noProjectJoined") }}</span>
|
||||
</div>
|
||||
|
||||
<div class="more">
|
||||
<a-button v-if="userStore.isAdmin" @click="goProjectManager">{{ t("certd.project.projectManager") }}</a-button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="project-container">
|
||||
<h3 class="text-lg font-medium mb-4">{{ t("certd.project.projectList") }}</h3>
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div v-for="project in projects" :key="project.id" class="w-full md:w-1/4">
|
||||
<a-card :bordered="true" class="project-card">
|
||||
<div class="project-card-content">
|
||||
<div class="project-info">
|
||||
<div class="text-md font-bold title">{{ project.name }}</div>
|
||||
<div class="flex items-center justify-start">管理员: <fs-values-format :model-value="project.adminId" :dict="userDict" color="green"></fs-values-format></div>
|
||||
<p class="text-gray-500 text-sm">创建时间:{{ formatDate(project.createTime) }}</p>
|
||||
</div>
|
||||
<div class="flex-col items-start">
|
||||
<div v-if="project.status" class="mt-1 flex items-center justify-start">状态:<fs-values-format :model-value="project.status" :dict="projectMemberStatusDict"></fs-values-format></div>
|
||||
<div v-if="project.permission" class="mt-1 flex items-center justify-start">权限:<fs-values-format :model-value="project.permission" :dict="projectPermissionDict"></fs-values-format></div>
|
||||
</div>
|
||||
</div>
|
||||
<template #actions>
|
||||
<span v-if="project.status === 'approved'" class="flex-inline items-center text-blue-500" :title="t('certd.project.viewDetail')" @click="goProjectDetail(project.id)">
|
||||
<fs-icon class="fs-18 mr-2" icon="mdi:eye-outline"></fs-icon>
|
||||
{{ t("certd.project.viewDetail") }}
|
||||
</span>
|
||||
<span v-if="!project.status || project.status === 'rejected'" class="flex-inline items-center text-blue-500" :title="t('certd.project.applyJoin')" @click="applyToJoin(project.id)">
|
||||
<fs-icon class="fs-18 mr-2" icon="mdi:checkbox-marked-circle-outline"></fs-icon>
|
||||
{{ t("certd.project.applyJoin") }}
|
||||
</span>
|
||||
<span v-if="project.status === 'pending' || project.status === 'approved'" class="flex-inline items-center text-red-500" :title="t('certd.project.leave')" @click="leaveProject(project.id)">
|
||||
<fs-icon class="fs-18 mr-2" icon="mdi:arrow-right-thin-circle-outline"></fs-icon>
|
||||
{{ t("certd.project.leave") }}
|
||||
</span>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { request } from "/src/api/service";
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import dayjs from "dayjs";
|
||||
import { useDicts } from "../dicts";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
|
||||
defineOptions({
|
||||
name: "ProjectJoin",
|
||||
});
|
||||
const { t } = useI18n();
|
||||
|
||||
const { projectMemberStatusDict, projectPermissionDict, userDict } = useDicts();
|
||||
|
||||
const projects = ref<any[]>([]);
|
||||
|
||||
const projectStore = useProjectStore();
|
||||
const userStore = useUserStore();
|
||||
function goProjectManager() {
|
||||
// 假设这里调用跳转到项目管理页的API
|
||||
router.push(`/sys/enterprise/project`);
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
function goProjectDetail(projectId: number) {
|
||||
// 假设这里调用跳转到项目详情页的API
|
||||
router.push(`/certd/project/detail?projectId=${projectId}`);
|
||||
}
|
||||
|
||||
const getSystemProjects = async () => {
|
||||
try {
|
||||
// 假设这里调用获取系统项目列表的API
|
||||
const response = await request({
|
||||
url: "/enterprise/project/all",
|
||||
method: "post",
|
||||
});
|
||||
projects.value = response || [];
|
||||
} catch (error) {
|
||||
message.error(t("certd.project.fetchFailed"));
|
||||
console.error("获取项目列表失败:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const applyToJoin = async (projectId: number) => {
|
||||
// 假设这里调用申请加入项目的API
|
||||
Modal.confirm({
|
||||
title: t("certd.project.applyJoin"),
|
||||
content: t("certd.project.applyJoinConfirm"),
|
||||
onOk: async () => {
|
||||
await request({
|
||||
url: "/enterprise/project/applyJoin",
|
||||
method: "post",
|
||||
data: { projectId },
|
||||
});
|
||||
message.success(t("certd.project.applySuccess"));
|
||||
await getSystemProjects();
|
||||
// 申请成功后可以刷新页面或跳转到项目列表
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
if (!dateString) {
|
||||
return "";
|
||||
}
|
||||
return dayjs(dateString).format("YYYY-MM-DD HH:mm:ss");
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getSystemProjects();
|
||||
});
|
||||
|
||||
async function leaveProject(projectId: number) {
|
||||
// 假设这里调用退出项目的API
|
||||
Modal.confirm({
|
||||
title: t("certd.project.leave"),
|
||||
content: t("certd.project.leaveConfirm"),
|
||||
onOk: async () => {
|
||||
await request({
|
||||
url: "/enterprise/project/leave",
|
||||
method: "post",
|
||||
data: { projectId },
|
||||
});
|
||||
message.success(t("certd.project.leaveSuccess"));
|
||||
// 退出成功后可以刷新页面或跳转到项目列表
|
||||
await getSystemProjects();
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.page-project-join {
|
||||
.project-container {
|
||||
padding: 24px;
|
||||
margin: 0 auto;
|
||||
.project-card {
|
||||
margin-bottom: 16px;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.project-card-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -35,6 +35,11 @@
|
||||
<a-divider type="vertical" />
|
||||
<vip-button mode="nav" style="font-size: 12px"></vip-button>
|
||||
</template>
|
||||
|
||||
<template v-if="settingsStore.isEnterprise">
|
||||
<a-divider type="vertical" />
|
||||
<project-current></project-current>
|
||||
</template>
|
||||
<template v-if="settingsStore.isComm">
|
||||
<a-divider type="vertical" />
|
||||
<suite-card class="m-0"></suite-card>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as api from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { computed, Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { userDict } from "../dicts";
|
||||
import * as api from "./api";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useI18n } from "/src/locales";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useSettingStore } from "/@/store/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { userDict } from "../../dicts";
|
||||
import { useDicts } from "/@/views/certd/dicts";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
@@ -35,6 +36,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
|
||||
const { projectMemberStatusDict } = useDicts();
|
||||
|
||||
return {
|
||||
crudOptions: {
|
||||
settings: {
|
||||
@@ -105,7 +108,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {},
|
||||
form: {
|
||||
rules: [{ required: true, message: "请选择用户" }],
|
||||
},
|
||||
editForm: {
|
||||
show: false,
|
||||
},
|
||||
@@ -128,11 +133,34 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择权限" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: t("certd.ent.projectMemberStatus"),
|
||||
type: "dict-select",
|
||||
dict: projectMemberStatusDict,
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
form: {
|
||||
show: true,
|
||||
rules: [{ required: true, message: "请选择状态" }],
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
cellRender: ({ row }) => {
|
||||
return (
|
||||
<div class="flex items-center">
|
||||
<fs-values-format model-value={row.status} dict={projectMemberStatusDict}></fs-values-format>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
createTime: {
|
||||
title: t("certd.createTime"),
|
||||
type: "datetime",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</fs-crud>
|
||||
<AdminModeIntro v-if="!projectStore.isEnterprise" title="当前为SaaS管理模式,项目管理需要切换到企业模式" :open="true"></AdminModeIntro>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
@@ -22,7 +23,8 @@ import createCrudOptions from "./crud";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { DeleteBatch } from "./api";
|
||||
import { useI18n } from "/src/locales";
|
||||
|
||||
import { useProjectStore } from "/@/store/project";
|
||||
import AdminModeIntro from "./intro.vue";
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
@@ -30,6 +32,7 @@ defineOptions({
|
||||
});
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
||||
|
||||
const projectStore = useProjectStore();
|
||||
const selectedRowKeys = context.selectedRowKeys;
|
||||
const handleBatchDelete = () => {
|
||||
if (selectedRowKeys.value?.length > 0) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user