From d558d5010230de4b320b3fa0a417dd8dc44332ac Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Fri, 21 Mar 2025 23:11:58 +0800 Subject: [PATCH] chore: --- .../src/plugin/cert-plugin/custom/d.ts | 1 - .../src/plugin/cert-plugin/custom/index.ts | 20 +-- packages/ui/certd-client/src/App.vue | 6 +- .../src/components/plugins/index.ts | 4 +- .../src/views/certd/monitor/cert/crud.tsx | 69 +--------- .../certd/monitor/cert/selector/index.vue | 123 ------------------ .../certd/monitor/cert/updater/index.vue | 55 ++++++++ .../views/certd/pipeline/cert-upload/use.tsx | 64 ++++----- .../component/shortcut/task-shortcut.vue | 43 +++++- .../views/certd/pipeline/pipeline/index.vue | 66 +++++++--- .../monitor/service/cert-upload-service.ts | 15 ++- .../src/plugins/plugin-dnsla/dns-provider.ts | 4 +- 12 files changed, 207 insertions(+), 263 deletions(-) delete mode 100644 packages/ui/certd-client/src/views/certd/monitor/cert/selector/index.vue create mode 100644 packages/ui/certd-client/src/views/certd/monitor/cert/updater/index.vue diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/d.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/d.ts index 1495fa0f..619ff4a4 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/d.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/custom/d.ts @@ -1,5 +1,4 @@ import { CertInfo } from "../acme"; - export interface ICertApplyUploadService { getCertInfo: (opts: { certId: number; userId: number }) => Promise; updateCert: (opts: { certId: number; cert: CertInfo; userId: number }) => Promise; 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 d5f49ba9..de57aa58 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 @@ -3,7 +3,6 @@ import type { CertInfo } from "../acme.js"; import { CertReader } from "../cert-reader.js"; import { CertApplyBaseConvertPlugin } from "../base-convert.js"; export * from "./d.js"; - import dayjs from "dayjs"; import { ICertApplyUploadService } from "./d"; export { CertReader }; @@ -22,7 +21,7 @@ export type { CertInfo }; shortcut: { certUpdate: { title: "更新证书", - icon: "ph:upload", + icon: "ion:upload", action: "onCertUpdate", form: { columns: { @@ -65,20 +64,19 @@ export type { CertInfo }; }) export class CertApplyUploadPlugin extends CertApplyBaseConvertPlugin { @TaskInput({ - title: "证书仓库ID", + title: "手动上传证书", component: { - name: "cert-info-selector", + name: "cert-info-updater", vModel: "modelValue", }, - helper: "请不要随意修改", + helper: "手动上传证书", order: -9999, required: true, mergeScript: ` return { component:{ on:{ - selectedChange(scope){ - console.log(scope) + updated(scope){ scope.form.input.domains = scope.$event?.domains } } @@ -144,7 +142,7 @@ export class CertApplyUploadPlugin extends CertApplyBaseConvertPlugin { async onCertUpdate(data: any) { const certApplyUploadService = await this.ctx.serviceGetter.get("CertApplyUploadService"); - await certApplyUploadService.updateCert({ + const res = await certApplyUploadService.updateCert({ certId: this.certInfoId, userId: this.ctx.user.id, cert: { @@ -152,6 +150,12 @@ export class CertApplyUploadPlugin extends CertApplyBaseConvertPlugin { key: data.key, }, }); + + return { + input: { + domains: res.domains, + }, + }; } } diff --git a/packages/ui/certd-client/src/App.vue b/packages/ui/certd-client/src/App.vue index b3ea6e0f..0b65e7b7 100644 --- a/packages/ui/certd-client/src/App.vue +++ b/packages/ui/certd-client/src/App.vue @@ -1,7 +1,7 @@