From ffd2e8149e3a06bf3eec456ff85dbed793af9e90 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sat, 21 Mar 2026 23:51:30 +0800 Subject: [PATCH 01/11] =?UTF-8?q?perf:=20=E7=81=AB=E5=B1=B1=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E9=83=A8=E7=BD=B2alb=E8=AF=81=E4=B9=A6=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E9=83=A8=E7=BD=B2=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E4=BB=A5=E5=8F=8A=E5=88=A0=E9=99=A4=E5=B7=B2?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=89=A9=E5=B1=95=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/plugin-deploy-to-alb.ts | 165 +++++++++++++++++- .../plugins/plugin-volcengine/ve-client.ts | 11 ++ 2 files changed, 167 insertions(+), 9 deletions(-) diff --git a/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-alb.ts b/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-alb.ts index 5fdc0136b..0329d71b5 100644 --- a/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-alb.ts +++ b/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-alb.ts @@ -3,6 +3,7 @@ import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert"; import { VolcengineAccess } from "../access.js"; import { VolcengineClient } from "../ve-client.js"; +import dayjs from "dayjs"; @IsTaskPlugin({ name: "VolcengineDeployToALB", @@ -32,6 +33,7 @@ export class VolcengineDeployToALB extends AbstractTaskPlugin { certDomains!: string[]; + @TaskInput({ title: "Access授权", helper: "火山引擎AccessKeyId、AccessKeySecret", @@ -126,6 +128,22 @@ export class VolcengineDeployToALB extends AbstractTaskPlugin { listenerList!: string | string[]; + @TaskInput({ + title: "证书部署类型", + helper: "选择部署默认证书还是扩展证书", + component: { + name: "a-select", + options: [ + { label: "默认证书", value: "default" }, + { label: "扩展证书", value: "extension" } + ] + }, + value: "default", + required: true + }) + certType!: string; + + async onInstance() { } @@ -149,20 +167,101 @@ export class VolcengineDeployToALB extends AbstractTaskPlugin { const service = await this.getAlbService(); for (const listener of this.listenerList) { this.logger.info(`开始部署监听器${listener}证书`); - await service.request({ - action: "ModifyListenerAttributes", - query: { - ListenerId: listener, - CertificateSource: "cert_center", - CertCenterCertificateId: certId - } - }); - this.logger.info(`部署监听器${listener}证书成功`); + if (this.certType === "default") { + // 部署默认证书 + const res = await service.request({ + action: "ModifyListenerAttributes", + query: { + ListenerId: listener, + CertificateSource: "cert_center", + CertCenterCertificateId: certId + } + }); + this.logger.info(`部署监听器${listener}默认证书成功,res:${JSON.stringify(res)}`); + } else { + // 部署扩展证书 + await this.deployExtensionCertificate(service, listener, certId as string); + } + await this.ctx.utils.sleep(5000); } this.logger.info("部署完成"); } + private async deployExtensionCertificate(service: any, listenerId: string, certId: string) { + // 获取监听器当前的扩展证书列表 + const domainExtensions = await this.getListenerDomainExtensions(service, listenerId); + + // 删除过期的扩展证书 + try { + await this.deleteExpiredExtensions(service, listenerId, domainExtensions); + } catch (error) { + this.logger.error(`删除过期扩展证书失败:${error.message ||error}`); + } + + // 新增扩展证书 + const query: any = { + ListenerId: listenerId, + "DomainExtensions.1.Action": "create", + "DomainExtensions.1.CertificateSource": "cert_center", + "DomainExtensions.1.CertCenterCertificateId": certId + }; + + // 如果有证书域名信息,添加到扩展证书中 + if (this.certDomains && this.certDomains.length > 0) { + query["DomainExtensions.1.Domain"] = this.certDomains[0]; + } + + await service.request({ + action: "ModifyListenerAttributes", + query: query + }); + this.logger.info(`部署监听器${listenerId}扩展证书成功`); + } + + private async getListenerDomainExtensions(service: any, listenerId: string): Promise { + const res = await service.request({ + action: "DescribeListenerAttributes", + method: "GET", + query: { + ListenerId: listenerId + } + }); + + return res.Result.DomainExtensions || []; + } + + private async deleteExpiredExtensions(service: any, listenerId: string, domainExtensions: any[]) { + const expiredExtensions = []; + for (const ext of domainExtensions) { + if (!await this.isCertificateExpired(ext)) { + expiredExtensions.push(ext); + } + } + if (expiredExtensions.length === 0) { + this.logger.info(`没有过期的扩展证书,跳过删除`); + return; + } + + const query: any = { + ListenerId: listenerId + }; + expiredExtensions.forEach((ext, index) => { + const idx = index + 1; + query[`DomainExtensions.${idx}.Action`] = "delete"; + query[`DomainExtensions.${idx}.DomainExtensionId`] = ext.DomainExtensionId; + }); + + this.logger.info(`准备删除过期扩展证书,数量:${expiredExtensions.length}个,query:${JSON.stringify(query)}`); + + await service.request({ + action: "ModifyListenerAttributes", + query: query + }); + this.logger.info(`删除${expiredExtensions.length}个过期扩展证书成功`); + await this.ctx.utils.sleep(5000); + } + private async getCertService(access: VolcengineAccess) { const client = new VolcengineClient({ @@ -189,6 +288,54 @@ export class VolcengineDeployToALB extends AbstractTaskPlugin { return service; } + private async isCertificateExpired(extension: any): Promise { + try { + let certificateId: string; + + // 根据证书来源获取证书ID + if (extension.CertificateSource === "cert_center") { + certificateId = extension.CertCenterCertificateId; + } else if (extension.CertificateSource === "alb") { + this.logger.warn(`ALB证书不支持过期检查,跳过`); + return false; + } else if (extension.CertificateSource === "pca_leaf") { + this.logger.warn(`PCA Leaf证书不支持过期检查,跳过`); + return false; + } else { + this.logger.warn(`未知的证书来源: ${extension.CertificateSource},跳过`); + return false; + } + + if (!certificateId) { + this.logger.warn(`证书ID为空,跳过`); + return false; + } + + // 获取证书服务 + const access = await this.getAccess(this.accessId); + const certService = await this.getCertService(access); + + // 获取证书详情 + const certDetail = await certService.GetCertificateDetail(certificateId); + + // 判断证书是否过期 + if (certDetail.NotAfter) { + const expireTime = dayjs(certDetail.NotAfter); + const now = dayjs(); + const isExpired = expireTime.isBefore(now); + if (isExpired) { + this.logger.info(`证书 ${certificateId} 已过期,过期时间: ${expireTime.toISOString()}`); + } + return isExpired; + } + + return false; + } catch (error) { + this.logger.error(`检查证书是否过期失败: ${error.message || error}`); + return false; + } + } + async onGetListenerList(data: any) { if (!this.accessId) { throw new Error("请选择Access授权"); diff --git a/packages/ui/certd-server/src/plugins/plugin-volcengine/ve-client.ts b/packages/ui/certd-server/src/plugins/plugin-volcengine/ve-client.ts index c1eb2a150..3ee02041d 100644 --- a/packages/ui/certd-server/src/plugins/plugin-volcengine/ve-client.ts +++ b/packages/ui/certd-server/src/plugins/plugin-volcengine/ve-client.ts @@ -42,6 +42,17 @@ export class VolcengineClient { }); return res.Result.InstanceId || res.Result.RepeatId; }; + + service.GetCertificateDetail = async (certificateId: string) => { + const res = await service.request({ + action: "CertificateGetInstance", + method: "POST", + body: { + InstanceId: certificateId + } + }); + return res.Result; + }; return service; } From 6d5e5bd692bf2f2b95bb797da860ccc89154fb92 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sat, 21 Mar 2026 23:59:11 +0800 Subject: [PATCH 02/11] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96access=20edit?= =?UTF-8?q?=20=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/certd/access/access-selector/access/crud.tsx | 7 +++++++ packages/ui/certd-client/src/views/certd/access/crud.tsx | 2 ++ packages/ui/certd-client/src/views/certd/addon/crud.tsx | 2 ++ .../ui/certd-client/src/views/certd/notification/crud.tsx | 2 ++ .../notification/notification-selector/modal/crud.tsx | 2 ++ 5 files changed, 15 insertions(+) diff --git a/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx b/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx index 880361bb3..cb8ef793d 100644 --- a/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx @@ -18,6 +18,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const { form, row } = req; form.id = row.id; form.type = props.type; + delete form.access; + delete form.keyId; const res = await context.api.UpdateObj(form); lastResRef.value = res; return res; @@ -30,6 +32,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const addRequest = async (req: AddReq) => { const { form } = req; form.type = props.type; + delete form.access; const res = await context.api.AddObj(form); lastResRef.value = res; return res; @@ -70,6 +73,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat width: "1050px", }, }, + rowHandle: { width: 200, }, @@ -89,6 +93,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat }, // 点击行 }; }, + remove: { + confirmMessage: "授权如果已经被使用,可能会导致流水线无法正常运行,请谨慎操作", + }, }, columns: { id: { diff --git a/packages/ui/certd-client/src/views/certd/access/crud.tsx b/packages/ui/certd-client/src/views/certd/access/crud.tsx index f3be184f6..c423bb816 100644 --- a/packages/ui/certd-client/src/views/certd/access/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/access/crud.tsx @@ -15,6 +15,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const editRequest = async (req: EditReq) => { const { form, row } = req; form.id = row.id; + delete form.access; const res = await api.UpdateObj(form); return res; }; @@ -25,6 +26,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const addRequest = async (req: AddReq) => { const { form } = req; + delete form.access; const res = await api.AddObj(form); return res; }; diff --git a/packages/ui/certd-client/src/views/certd/addon/crud.tsx b/packages/ui/certd-client/src/views/certd/addon/crud.tsx index 824d242bb..08c783e4a 100644 --- a/packages/ui/certd-client/src/views/certd/addon/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/addon/crud.tsx @@ -16,6 +16,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const editRequest = async (req: EditReq) => { const { form, row } = req; form.id = row.id; + delete form.body; const res = await api.UpdateObj(form); return res; }; @@ -26,6 +27,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const addRequest = async (req: AddReq) => { const { form } = req; + delete form.body; const res = await api.AddObj(form); return res; }; diff --git a/packages/ui/certd-client/src/views/certd/notification/crud.tsx b/packages/ui/certd-client/src/views/certd/notification/crud.tsx index 53baf1ade..3928dbb36 100644 --- a/packages/ui/certd-client/src/views/certd/notification/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/notification/crud.tsx @@ -11,6 +11,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const editRequest = async (req: EditReq) => { const { form, row } = req; form.id = row.id; + delete form.body; const res = await api.UpdateObj(form); return res; }; @@ -21,6 +22,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const addRequest = async (req: AddReq) => { const { form } = req; + delete form.body; const res = await api.AddObj(form); return res; }; diff --git a/packages/ui/certd-client/src/views/certd/notification/notification-selector/modal/crud.tsx b/packages/ui/certd-client/src/views/certd/notification/notification-selector/modal/crud.tsx index 944e29a39..a988e7962 100644 --- a/packages/ui/certd-client/src/views/certd/notification/notification-selector/modal/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/notification/notification-selector/modal/crud.tsx @@ -14,6 +14,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const editRequest = async (req: EditReq) => { const { form, row } = req; form.id = row.id; + delete form.body; const res = await context.api.UpdateObj(form); lastResRef.value = res; return res; @@ -25,6 +26,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat const addRequest = async (req: AddReq) => { const { form } = req; + delete form.body; const res = await context.api.AddObj(form); lastResRef.value = res; return res; From 431afd618f547cecf9a29433f46d4367619e2ecf Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 22 Mar 2026 00:49:54 +0800 Subject: [PATCH 03/11] =?UTF-8?q?perf:=20=E4=BC=81=E4=B8=9A=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E9=9D=A2=E5=A2=9E=E5=8A=A0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB=E7=9A=84=E5=BC=95=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/locales/langs/en-US/certd.ts | 2 + .../src/locales/langs/zh-CN/certd.ts | 1 + .../certd-client/src/store/settings/index.tsx | 109 +++++++++--------- .../src/views/certd/project/detail/index.vue | 7 +- .../src/views/sys/settings/tabs/mode.vue | 14 ++- .../src/views/sys/settings/tabs/oauth.vue | 2 +- 6 files changed, 79 insertions(+), 56 deletions(-) diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index d300dc382..61ea3973c 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -795,6 +795,8 @@ export default { reverseProxyEmpty: "No reverse proxy list configured", environmentVars: "Environment Variables", environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE", + + bindUrl: "Bind URL", }, }, modal: { diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 39c496214..fcc346979 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -804,6 +804,7 @@ export default { reverseProxyEmpty: "未配置反向代理", environmentVars: "环境变量", environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE", + bindUrl: "绑定URL", }, }, modal: { diff --git a/packages/ui/certd-client/src/store/settings/index.tsx b/packages/ui/certd-client/src/store/settings/index.tsx index 09ccb3e24..955c242b4 100644 --- a/packages/ui/certd-client/src/store/settings/index.tsx +++ b/packages/ui/certd-client/src/store/settings/index.tsx @@ -272,14 +272,27 @@ export const useSettingStore = defineStore({ }, async checkUrlBound() { const userStore = useUserStore(); - const settingStore = useSettingStore(); if (!userStore.isAdmin) { return; } + const bindUrl = this.installInfo.bindUrl; + const bindUrl2 = this.installInfo.bindUrl2; + if (!bindUrl) { + //绑定url + await this.doBindUrl("url"); + } else { + //检查当前url 是否与绑定的url一致 + const url = window.location.href; + if (!url.startsWith(bindUrl) && !url.startsWith(bindUrl2)) { + this.openBindUrlModal(); + } + } + }, + + openBindUrlModal() { const event: any = { ModalRef: null }; mitter.emit("getModal", event); const Modal = event.ModalRef; - let modalRef: any = null; const bindUrl = this.installInfo.bindUrl; const bindUrl2 = this.installInfo.bindUrl2; @@ -289,57 +302,47 @@ export const useSettingStore = defineStore({ modalRef.destroy(); } }; - - if (!bindUrl) { - //绑定url - await this.doBindUrl("url"); - } else { - //检查当前url 是否与绑定的url一致 - const url = window.location.href; - if (!url.startsWith(bindUrl) && !url.startsWith(bindUrl2)) { - modalRef = Modal.warning({ - title: "URL地址未绑定,是否绑定此地址?", - width: 500, - keyboard: false, - content: () => { - return ( -
-
- - 绑定地址1: - {bindUrl || "未占用"} - - doBindRequest("url")}> - 绑定到地址1 - -
-
- - 绑定地址2: - {bindUrl2 || "未占用"} - - doBindRequest("url2")}> - 绑定到地址2 - -
-
- ); - }, - onOk: async () => { - // await this.doBindUrl(); - window.location.href = bindUrl; - }, - okButtonProps: { - danger: true, - }, - okText: "不,回到原来的地址", - cancelText: "不,回到原来的地址", - onCancel: () => { - window.location.href = bindUrl; - }, - }); - } - } + const modalRef: any = Modal.warning({ + title: "URL地址未绑定,是否绑定此地址?", + width: 500, + keyboard: false, + content: () => { + return ( +
+
+ + 绑定地址1: + {bindUrl || "未占用"} + + doBindRequest("url")}> + 绑定到地址1 + +
+
+ + 绑定地址2: + {bindUrl2 || "未占用"} + + doBindRequest("url2")}> + 绑定到地址2 + +
+
+ ); + }, + onOk: async () => { + // await this.doBindUrl(); + window.location.href = bindUrl; + }, + okButtonProps: { + danger: true, + }, + okText: "不,回到原来的地址", + cancelText: "不,回到原来的地址", + onCancel: () => { + window.location.href = bindUrl; + }, + }); }, async loadProductInfo() { try { diff --git a/packages/ui/certd-client/src/views/certd/project/detail/index.vue b/packages/ui/certd-client/src/views/certd/project/detail/index.vue index f3cce0f7c..c2bb178cc 100644 --- a/packages/ui/certd-client/src/views/certd/project/detail/index.vue +++ b/packages/ui/certd-client/src/views/certd/project/detail/index.vue @@ -49,6 +49,7 @@ defineOptions({ const route = useRoute(); const projectIdStr = route.query.projectId as string; +const migrate = route.query.migrate as string; let projectId = Number(projectIdStr); const projectStore = useProjectStore(); if (!projectId) { @@ -116,7 +117,11 @@ onMounted(async () => { return; } await loadProjectDetail(); - crudExpose.doRefresh(); + await crudExpose.doRefresh(); + + if (migrate === "true") { + openTransferDialog(); + } }); onActivated(async () => { await crudExpose.doRefresh(); diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue index ee466d074..746f5197e 100644 --- a/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue +++ b/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue @@ -8,9 +8,10 @@
SaaS模式:每个用户管理自己的流水线和授权资源,独立使用。
企业模式:通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。
+
建议在开始使用时固定一个合适的模式,之后就不要随意切换了。
+
设置为企业模式之后,之前创建的个人数据不会显示,您可以选择 将个人数据迁移到项目
商业版不建议设置为企业模式,除非你确定要转成企业内部使用
- @@ -33,6 +34,7 @@ import { useI18n } from "/src/locales"; import { dict } from "@fast-crud/fast-crud"; import { useProjectStore } from "/@/store/project"; import AdminModeIntro from "/@/views/sys/enterprise/project/intro.vue"; +import { useRouter } from "vue-router"; const { t } = useI18n(); defineOptions({ @@ -82,5 +84,15 @@ const onFinish = async (form: any) => { saveLoading.value = false; } }; + +const router = useRouter(); +const goCurrentProject = () => { + router.push({ + path: "/certd/project/detail", + query: { + migrate: "true", + }, + }); +}; diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue index c6782fe07..0d8bacfd5 100644 --- a/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue +++ b/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue @@ -8,7 +8,7 @@
{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}
- {{ t("certd.sys.setting.passkeyHostnameNotSame") }} + {{ t("certd.sys.setting.passkeyHostnameNotSame") }} {{ t("certd.sys.setting.bindUrl") }}
From acc2df29def017fb8165f931b41ef95414966afc Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 22 Mar 2026 23:31:24 +0800 Subject: [PATCH 04/11] =?UTF-8?q?perf:=20=E6=94=AF=E6=8C=81=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E7=B2=98=E8=B4=B4=E4=BB=BB=E5=8A=A1=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/certd-client/src/style/certd.less | 13 ++++ .../pipeline/component/task-form/copy.ts | 39 ++++++++++++ .../pipeline/component/task-form/index.vue | 63 ++++++++++++++++--- 3 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/copy.ts diff --git a/packages/ui/certd-client/src/style/certd.less b/packages/ui/certd-client/src/style/certd.less index eeb601bce..05393d6c5 100644 --- a/packages/ui/certd-client/src/style/certd.less +++ b/packages/ui/certd-client/src/style/certd.less @@ -118,3 +118,16 @@ span.fs-icon-svg { } } + +button.ant-btn.ant-btn-default.isPlus{ + color: #c5913f; + border: 1px solid #c5913f; + + &:disabled { + cursor: not-allowed; + border-color: hsl(240 5.9% 90%); + color: rgba(50, 54, 57, 0.25); + background-color: rgba(50, 54, 57, 0.04); + box-shadow: none; + } +} \ No newline at end of file diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/copy.ts b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/copy.ts new file mode 100644 index 000000000..e3eab5346 --- /dev/null +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/copy.ts @@ -0,0 +1,39 @@ +import { reactive, ref } from "vue"; + +export class CopyeStore { + type: "step" | "steps" | "task" | "tasks"; + target: any; + + getCopyedCount() { + if (this.type === "step") { + return 1; + } else if (this.type === "steps") { + return this.target.length; + } else if (this.type === "task") { + return 1; + } else if (this.type === "tasks") { + return this.target.length; + } else { + return 0; + } + } + + setStep(target: any) { + this.target = target; + this.type = "step"; + } + setSteps(target: any) { + this.target = target; + this.type = "steps"; + } + setTask(target: any) { + this.target = target; + this.type = "task"; + } + setTasks(target: any) { + this.target = target; + this.type = "tasks"; + } +} + +export const Copyed: any = reactive(new CopyeStore()); diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/index.vue index e144c0097..e73268161 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-form/index.vue @@ -29,7 +29,17 @@ @@ -68,14 +78,15 @@