From 635f069012d4193cfb7cb051c96e28eec1247ca2 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Fri, 26 Jun 2026 00:49:46 +0800 Subject: [PATCH] =?UTF-8?q?perf(plugin):=20=E5=9C=A8=E7=BA=BF=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=BE=91=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E4=BE=9D=E8=B5=96=E5=92=8C=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- .../components/plugins/common/kv-input.vue | 113 ++++++++++++++++++ .../locales/langs/en-US/certd/sys-plugin.ts | 4 +- .../locales/langs/zh-CN/certd/sys-plugin.ts | 2 + .../src/views/sys/plugin/crud.tsx | 32 ++++- 5 files changed, 145 insertions(+), 8 deletions(-) create mode 100644 packages/ui/certd-client/src/components/plugins/common/kv-input.vue diff --git a/AGENTS.md b/AGENTS.md index 443a9d69f..f3c87f037 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,7 @@ # Certd 开发 Agent 上下文 进入仓库后先读本文。本文同时包含常驻规则、仓库地图、常用入口和验证命令;不要依赖分散规则文件。 +思考时也要使用中文。 ## 项目定位 @@ -60,7 +61,6 @@ Certd 是可私有化部署的 SSL/TLS 证书自动化管理平台,提供 Web - 后端聚焦单测:`corepack pnpm --dir packages\ui\certd-server test:unit`。 - 后端完整测试:`corepack pnpm --dir packages\ui\certd-server test`。 -- 前端构建:`corepack pnpm --dir packages\ui\certd-client build`。 - 前端改动文件格式化:`packages\ui\certd-client\node_modules\.bin\prettier.cmd --write `。 - 前端改动文件 ESLint 修复:`packages\ui\certd-client\node_modules\.bin\eslint.cmd --fix `。 - 后端改动文件 lint fix:`corepack pnpm --dir packages\ui\certd-server run lint`。 diff --git a/packages/ui/certd-client/src/components/plugins/common/kv-input.vue b/packages/ui/certd-client/src/components/plugins/common/kv-input.vue new file mode 100644 index 000000000..54ffae385 --- /dev/null +++ b/packages/ui/certd-client/src/components/plugins/common/kv-input.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd/sys-plugin.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd/sys-plugin.ts index c163d40c5..f08179671 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd/sys-plugin.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd/sys-plugin.ts @@ -26,7 +26,9 @@ export default { store: "Store", version: "Version", pluginDependencies: "Plugin Dependencies", - pluginDependenciesHelper: "Dependencies to install first in format: [author/]pluginName[:version]", + pluginDependenciesHelper: "Format: [author/]pluginName[:version]. Required plugins must be installed first", + thirdPartyDependencies: "Third-party Dependencies", + thirdPartyDependenciesHelper: "Format: npmPackageName: version. Auto-installed at runtime", editableRunStrategy: "Editable Run Strategy", editable: "Editable", notEditable: "Not Editable", diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd/sys-plugin.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd/sys-plugin.ts index 2ceaea20a..e2d01ac1f 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd/sys-plugin.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd/sys-plugin.ts @@ -27,6 +27,8 @@ export default { version: "版本", pluginDependencies: "插件依赖", pluginDependenciesHelper: "格式: [作者/]插件名[:版本],需先安装依赖插件", + thirdPartyDependencies: "第三方依赖", + thirdPartyDependenciesHelper: "格式: npm包名: 版本号,运行时自动安装", editableRunStrategy: "可编辑运行策略", editable: "可编辑", notEditable: "不可编辑", diff --git a/packages/ui/certd-client/src/views/sys/plugin/crud.tsx b/packages/ui/certd-client/src/views/sys/plugin/crud.tsx index 32c0fc9cf..e04f9dabe 100644 --- a/packages/ui/certd-client/src/views/sys/plugin/crud.tsx +++ b/packages/ui/certd-client/src/views/sys/plugin/crud.tsx @@ -7,6 +7,7 @@ import { Modal, message } from "ant-design-vue"; //@ts-ignore import yaml from "js-yaml"; import { usePluginImport } from "./use-import"; +import KvInput from "/@/components/plugins/common/kv-input.vue"; import { usePluginConfig } from "./use-config"; import { useSettingStore } from "/src/store/settings/index"; import { usePluginStore } from "/@/store/plugin"; @@ -37,6 +38,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat return res; }; + // const infoRequest = async ({ row }: AddReq) => { + // return await api.GetObj(row.id); + // }; + const selectedRowKeys: Ref = ref([]); context.selectedRowKeys = selectedRowKeys; @@ -66,6 +71,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat addRequest, editRequest, delRequest, + // infoRequest, }, actionbar: { buttons: { @@ -187,6 +193,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat id: opts.res.id, }, }); + } else { + crudExpose.doRefresh(); } }, }, @@ -363,10 +371,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat type: "text", form: { component: { - name: "a-select", - mode: "tags", - open: false, - allowClear: true, + name: KvInput, + vModel: "modelValue", }, helper: t("certd.pluginDependenciesHelper"), }, @@ -374,6 +380,20 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat show: false, }, }, + "extra.dependPackages": { + title: t("certd.thirdPartyDependencies"), + type: "text", + form: { + component: { + name: KvInput, + vModel: "modelValue", + }, + helper: t("certd.thirdPartyDependenciesHelper"), + }, + column: { + show: false, + }, + }, "extra.showRunStrategy": { title: t("certd.editableRunStrategy"), type: "dict-switch", @@ -419,12 +439,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat show: false, }, valueBuilder({ row }) { - if (row.extra) { + if (typeof row.extra === "string") { row.extra = yaml.load(row.extra); } }, valueResolve({ row }) { - if (row.extra) { + if (row.extra && typeof row.extra === "object") { row.extra = yaml.dump(row.extra); } },