diff --git a/packages/ui/certd-client/package.json b/packages/ui/certd-client/package.json index 2f8331e1..3d0f2048 100644 --- a/packages/ui/certd-client/package.json +++ b/packages/ui/certd-client/package.json @@ -26,10 +26,10 @@ "dependencies": { "@ant-design/colors": "^7.0.2", "@ant-design/icons-vue": "^6.1.0", - "@fast-crud/fast-crud": "^1.22.3", - "@fast-crud/fast-extends": "^1.22.3", - "@fast-crud/ui-antdv4": "^1.22.3", - "@fast-crud/ui-interface": "^1.22.3", + "@fast-crud/fast-crud": "^1.23.1", + "@fast-crud/fast-extends": "^1.23.1", + "@fast-crud/ui-antdv4": "^1.23.1", + "@fast-crud/ui-interface": "^1.23.1", "@iconify/vue": "^4.1.1", "@soerenmartius/vue3-clipboard": "^0.1.2", "@vue-js-cron/light": "^4.0.5", diff --git a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx index c71bf5fa..33952bde 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx @@ -348,6 +348,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp type: "link", search: { show: true, + title: "关键字", component: { name: "a-input" } diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue index 324efafa..0cf67338 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue @@ -230,7 +230,7 @@ export default { } const { doComputed } = useCompute(); const currentPlugin = doComputed(() => { - return currentPluginDefine.value; + return currentPluginDefine.value || {}; }, getContext); const changeCurrentPlugin = async (step: any) => { const stepType = step.type; diff --git a/packages/ui/certd-server/src/plugins/plugin-host/plugin/copy-to-local/index.ts b/packages/ui/certd-server/src/plugins/plugin-host/plugin/copy-to-local/index.ts index 7a8bb3b1..573565e7 100644 --- a/packages/ui/certd-server/src/plugins/plugin-host/plugin/copy-to-local/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-host/plugin/copy-to-local/index.ts @@ -17,12 +17,47 @@ import path from 'path'; }, }) export class CopyCertToLocalPlugin extends AbstractTaskPlugin { + @TaskInput({ + title: '域名证书', + helper: '请选择前置任务输出的域名证书', + component: { + name: 'output-selector', + from: ['CertApply', 'CertApplyLego'], + }, + required: true, + }) + cert!: CertInfo; + + @TaskInput({ + title: '证书类型', + helper: '支持pem、pfx、der、jks格式', + component: { + name: 'a-select', + options: [ + { value: 'pem', label: 'pem,用于Nginx等大部分应用' }, + { value: 'pfx', label: 'pfx,一般用于IIS' }, + { value: 'der', label: 'der,一般用于Apache' }, + { value: 'jks', label: 'jks,一般用于JAVA应用' }, + ], + }, + required: true, + }) + certType!: string; + @TaskInput({ title: '证书保存路径', helper: '全链证书,路径要包含文件名' + '\n推荐使用相对路径,将写入与数据库同级目录,无需映射,例如:tmp/cert.pem', component: { placeholder: 'tmp/full_chain.pem', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pem'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) crtPath!: string; @@ -32,6 +67,14 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin { component: { placeholder: 'tmp/cert.key', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pem'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) keyPath!: string; @@ -42,6 +85,13 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin { component: { placeholder: '/root/deploy/nginx/intermediate.pem', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pem'; + }) + } + `, rules: [{ type: 'filepath' }], }) icPath!: string; @@ -52,6 +102,14 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin { component: { placeholder: 'tmp/cert.pfx', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pfx'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) pfxPath!: string; @@ -63,6 +121,14 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin { component: { placeholder: 'tmp/cert.der 或 tmp/cert.cer', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'der'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) derPath!: string; @@ -73,21 +139,18 @@ export class CopyCertToLocalPlugin extends AbstractTaskPlugin { component: { placeholder: 'tmp/cert.jks', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'jks'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) jksPath!: string; - @TaskInput({ - title: '域名证书', - helper: '请选择前置任务输出的域名证书', - component: { - name: 'output-selector', - from: ['CertApply', 'CertApplyLego'], - }, - required: true, - }) - cert!: CertInfo; - @TaskOutput({ title: '证书保存路径', type: 'HostCrtPath', diff --git a/packages/ui/certd-server/src/plugins/plugin-host/plugin/upload-to-host/index.ts b/packages/ui/certd-server/src/plugins/plugin-host/plugin/upload-to-host/index.ts index 0f9e8b0f..8e9f2e94 100644 --- a/packages/ui/certd-server/src/plugins/plugin-host/plugin/upload-to-host/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-host/plugin/upload-to-host/index.ts @@ -18,12 +18,47 @@ import dayjs from 'dayjs'; }, }) export class UploadCertToHostPlugin extends AbstractTaskPlugin { + @TaskInput({ + title: '域名证书', + helper: '请选择前置任务输出的域名证书', + component: { + name: 'output-selector', + from: ['CertApply', 'CertApplyLego'], + }, + required: true, + }) + cert!: CertInfo; + + @TaskInput({ + title: '证书格式', + helper: '支持pem、pfx、der、jks格式', + component: { + name: 'a-select', + options: [ + { value: 'pem', label: 'pem,Nginx等大部分应用' }, + { value: 'pfx', label: 'pfx,一般用于IIS' }, + { value: 'der', label: 'der,一般用于Apache' }, + { value: 'jks', label: 'jks,一般用于JAVA应用' }, + ], + }, + required: true, + }) + certType!: string; + @TaskInput({ title: '证书保存路径', - helper: '全链证书,需要有写入权限,路径要包含证书文件名,例如:/tmp/cert.pem', + helper: '填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/cert.pem', component: { placeholder: '/root/deploy/nginx/full_chain.pem', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pem'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) crtPath!: string; @@ -33,6 +68,14 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin { component: { placeholder: '/root/deploy/nginx/cert.key', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pem'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) keyPath!: string; @@ -43,51 +86,71 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin { component: { placeholder: '/root/deploy/nginx/intermediate.pem', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pem'; + }) + } + `, rules: [{ type: 'filepath' }], }) icPath!: string; @TaskInput({ title: 'PFX证书保存路径', - helper: '用于IIS证书部署,需要有写入权限,路径要包含证书文件名,例如:/tmp/cert.pfx', + helper: '填写应用原本的证书保存路径,路径要包含证书文件名,例如:D:\\iis\\cert.pfx', component: { - placeholder: '/root/deploy/nginx/cert.pfx', + placeholder: 'D:\\iis\\cert.pfx', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'pfx'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) pfxPath!: string; @TaskInput({ title: 'DER证书保存路径', - helper: '用于Apache证书部署,需要有写入权限,路径要包含证书文件名,例如:/tmp/cert.der', + helper: '填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/cert.der', component: { - placeholder: '/root/deploy/nginx/cert.der', + placeholder: '/root/deploy/apache/cert.der', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'der'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) derPath!: string; @TaskInput({ title: 'jks证书保存路径', - helper: '需要有写入权限,路径要包含证书文件名,例如:/tmp/cert.jks', + helper: '填写应用原本的证书保存路径,路径要包含证书文件名,例如:/tmp/cert.jks', component: { - placeholder: '/root/deploy/nginx/cert.jks', + placeholder: '/root/deploy/java_app/cert.jks', }, + mergeScript: ` + return { + show: ctx.compute(({form})=>{ + return form.certType === 'jks'; + }) + } + `, + required: true, rules: [{ type: 'filepath' }], }) jksPath!: string; - @TaskInput({ - title: '域名证书', - helper: '请选择前置任务输出的域名证书', - component: { - name: 'output-selector', - from: ['CertApply', 'CertApplyLego'], - }, - required: true, - }) - cert!: CertInfo; - @TaskInput({ title: '主机登录配置', helper: 'access授权',