chore: 增加清理依赖缓存提示

This commit is contained in:
xiaojunnuo
2026-06-21 22:32:51 +08:00
parent 42fcb91f2e
commit 1f1b1858c7
8 changed files with 22 additions and 15 deletions
@@ -41,6 +41,7 @@ export default {
pluginBetaWarning: "Custom plugins are in BETA and may have breaking changes in future",
pleaseSelectRecord: "Please select records first",
clearRuntimeDeps: "Clear Runtime Deps Cache",
clearRuntimeDepsConfirm: "Are you sure to clear the runtime dependencies cache? Required dependencies will be reinstalled on the next pipeline execution.",
clearRuntimeDepsSuccess: "Runtime dependencies cache cleared successfully",
clearRuntimeDepsTooltip: "Restart the certd container after clearing, otherwise cached modules will not be reloaded",
clearRuntimeDepsConfirm: "Are you sure to clear the runtime dependencies cache? Please restart the certd container afterwards to ensure dependencies are reloaded.",
clearRuntimeDepsSuccess: "Runtime dependencies cache cleared successfully, please restart the certd container",
};
@@ -41,6 +41,7 @@ export default {
pluginBetaWarning: "自定义插件处于BETA测试版,后续可能会有破坏性变更",
pleaseSelectRecord: "请先勾选记录",
clearRuntimeDeps: "清理第三方依赖缓存",
clearRuntimeDepsConfirm: "确定要清理第三方依赖缓存吗?清理后下次执行流水线时将重新安装所需依赖。",
clearRuntimeDepsSuccess: "第三方依赖缓存清理成功",
clearRuntimeDepsTooltip: "清除后需重启 certd 容器,否则已缓存模块不会重新读取",
clearRuntimeDepsConfirm: "确定要清理第三方依赖缓存吗?清理后请重启 certd 容器以确保重新加载依赖。",
clearRuntimeDepsSuccess: "第三方依赖缓存清理成功,请重启 certd 容器",
};
@@ -87,6 +87,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: true,
icon: "ion:trash-outline",
text: t("certd.clearRuntimeDeps"),
tooltip: { title: t("certd.clearRuntimeDepsTooltip") },
type: "primary",
danger: true,
async click() {
+1 -1
View File
@@ -37,7 +37,7 @@
"tsc": "tsc --skipLibCheck",
"slimming": "node ./slimming.js",
"pub": "echo 1",
"compile": "tsc --skipLibCheck --watch",
"compile": "",
"lint1": "eslint --fix"
},
"dependencies": {
@@ -441,16 +441,20 @@ export class RuntimeDepsService {
private getDefineByPluginKey(pluginKey: string, owner?: RuntimeDependencyPluginDefine): RuntimeDependencyPluginDefine {
const parts = pluginKey.split(":");
const [pluginType, subtype, name] = parts;
if (parts.length < 2 || (pluginType === "addon" && parts.length !== 3) || (pluginType !== "addon" && parts.length !== 2)) {
let [pluginType, subtype, name] = parts;
if (parts.length === 2) {
name = subtype;
}else if (parts.length === 3) {
//无修改
} else {
const ownerName = owner?.name || pluginKey;
throw new Error(`插件依赖格式错误: ${ownerName} 依赖 ${pluginKey},请使用 plugin:name、access:name、notification:name、dnsProvider:name 或 addon:subtype:name 格式`);
}
const registryMap: Record<string, { registry: Registry<any>; key: string; pluginType: string; addonType?: string }> = {
plugin: { registry: pluginRegistry, key: subtype, pluginType: "plugin" },
access: { registry: accessRegistry, key: subtype, pluginType: "access" },
notification: { registry: notificationRegistry, key: subtype, pluginType: "notification" },
dnsProvider: { registry: dnsProviderRegistry, key: subtype, pluginType: "dnsProvider" },
plugin: { registry: pluginRegistry, key: name, pluginType: "plugin" },
access: { registry: accessRegistry, key: name, pluginType: "access" },
notification: { registry: notificationRegistry, key: name, pluginType: "notification" },
dnsProvider: { registry: dnsProviderRegistry, key: name, pluginType: "dnsProvider" },
addon: { registry: addonRegistry, key: `${subtype}:${name}`, pluginType: "addon", addonType: subtype },
};
const target = registryMap[pluginType];