From 87853a201535f3bfe8505c40f8f5229d82ffcc73 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 9 Jul 2025 14:34:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20output-selector=20from=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=94=AF=E6=8C=81=E6=9B=B4=E4=B8=B0=E5=AF=8C=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 规则: pluginName:valueType:keyName --- .../src/plugin/cert-plugin/base-convert.ts | 1 + .../src/plugin/cert-plugin/custom/index.ts | 1 + .../plugins/plugin-cert/src/plugin/index.ts | 2 +- .../plugins/common/cert-domains-getter.vue | 5 +- .../plugins/common/output-selector/index.vue | 54 +++++++++++++------ .../ui/certd-client/src/constants/index.ts | 2 +- .../ui/certd-client/src/store/plugin/index.ts | 5 +- .../views/certd/pipeline/pipeline/index.vue | 9 ++-- .../modules/plugin/service/default-plugin.ts | 2 +- .../plugin/upload-to-aliyun/index.ts | 2 +- 10 files changed, 54 insertions(+), 29 deletions(-) diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/base-convert.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/base-convert.ts index e83fcbe9..48381706 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/base-convert.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/base-convert.ts @@ -67,6 +67,7 @@ export abstract class CertApplyBaseConvertPlugin extends AbstractTaskPlugin { @TaskOutput({ title: "域名证书", + type: "cert", }) cert?: CertInfo; diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/index.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/index.ts index 223467eb..3f147332 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/index.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/index.ts @@ -87,6 +87,7 @@ export class CertApplyUploadPlugin extends CertApplyBaseConvertPlugin { @TaskOutput({ title: "证书MD5", + type: "certMd5", }) certMd5?: string; diff --git a/packages/plugins/plugin-cert/src/plugin/index.ts b/packages/plugins/plugin-cert/src/plugin/index.ts index f563084c..bcc89825 100644 --- a/packages/plugins/plugin-cert/src/plugin/index.ts +++ b/packages/plugins/plugin-cert/src/plugin/index.ts @@ -3,4 +3,4 @@ export { EVENT_CERT_APPLY_SUCCESS } from "./cert-plugin/base-convert.js"; export * from "./cert-plugin/index.js"; export * from "./cert-plugin/lego/index.js"; export * from "./cert-plugin/custom/index.js"; -export const CertApplyPluginNames = ["CertApply", "CertApplyLego", "CertApplyUpload"]; +export const CertApplyPluginNames = [":cert:"]; diff --git a/packages/ui/certd-client/src/components/plugins/common/cert-domains-getter.vue b/packages/ui/certd-client/src/components/plugins/common/cert-domains-getter.vue index cdf8500d..0f78c50b 100644 --- a/packages/ui/certd-client/src/components/plugins/common/cert-domains-getter.vue +++ b/packages/ui/certd-client/src/components/plugins/common/cert-domains-getter.vue @@ -54,8 +54,9 @@ function getDomainFromPipeline(inputKey: string) { return; } - if (!CertApplyPluginNames.includes(certStep.type)) { - targetStepId = getStepIdFromInputKey(certStep.input?.cert); + const firstLevelValue = certStep.input.cert; + if (firstLevelValue && typeof firstLevelValue === "string" && firstLevelValue.indexOf(".") > 0) { + targetStepId = getStepIdFromInputKey(firstLevelValue); certStep = findStepFromPipeline(targetStepId); if (!certStep) { errorRef.value = "找不到目标步骤,请先选择域名证书"; diff --git a/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue b/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue index 654e75a4..7f6c95d4 100644 --- a/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue +++ b/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue @@ -4,6 +4,7 @@