diff --git a/.gitignore b/.gitignore index b9c2e515e..d9e59e533 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -./packages/core/lego +./packages/core/lego # IntelliJ project files node_modules/ npm-debug.log @@ -34,4 +34,8 @@ test.js /logs .pnpm-lock.yaml pnpm-lock.yaml -.studio/ \ No newline at end of file +.studio/ + +# Certd 推广报告,仅本地使用 +/popularize/ + diff --git a/packages/ui/certd-client/src/router/source/modules/sys.ts b/packages/ui/certd-client/src/router/source/modules/sys.ts index 06c756892..c042885ba 100644 --- a/packages/ui/certd-client/src/router/source/modules/sys.ts +++ b/packages/ui/certd-client/src/router/source/modules/sys.ts @@ -311,7 +311,7 @@ export const sysResources = [ }, icon: "ion:bag-check", permission: "sys:settings:edit", - keepAlive: true, + keepAlive: false, auth: true, }, }, diff --git a/packages/ui/certd-client/src/use/use-mounted.ts b/packages/ui/certd-client/src/use/use-mounted.ts new file mode 100644 index 000000000..047181f36 --- /dev/null +++ b/packages/ui/certd-client/src/use/use-mounted.ts @@ -0,0 +1,24 @@ +import { onActivated, onMounted } from "vue"; + +/** + * 可靠的页面刷新钩子: + * - 如果组件实际被 KeepAlive 缓存命中,由 onActivated 触发 init; + * - 如果没有被缓存,由 onMounted 兜底触发,避免不刷新也不触发 onActivated。 + */ +export function useMounted(init: () => void | Promise) { + let activated = false; + + onActivated(() => { + activated = true; + init(); + }); + + onMounted(() => { + // 让 onActivated 有机会先执行;组件未被 KeepAlive 缓存时 onActivated 不会触发,由这里兜底。 + setTimeout(() => { + if (!activated) { + init(); + } + }); + }); +} diff --git a/packages/ui/certd-client/src/views/certd/access/index.vue b/packages/ui/certd-client/src/views/certd/access/index.vue index 16cf15356..c577e8d37 100644 --- a/packages/ui/certd-client/src/views/certd/access/index.vue +++ b/packages/ui/certd-client/src/views/certd/access/index.vue @@ -11,7 +11,8 @@ diff --git a/packages/ui/certd-client/src/views/certd/history/index.vue b/packages/ui/certd-client/src/views/certd/history/index.vue index e21262064..bd56e930f 100644 --- a/packages/ui/certd-client/src/views/certd/history/index.vue +++ b/packages/ui/certd-client/src/views/certd/history/index.vue @@ -14,12 +14,18 @@ diff --git a/packages/ui/certd-client/src/views/certd/monitor/cert/index.vue b/packages/ui/certd-client/src/views/certd/monitor/cert/index.vue index 3f7a76463..2390de5b5 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/cert/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/cert/index.vue @@ -11,9 +11,12 @@ diff --git a/packages/ui/certd-client/src/views/certd/monitor/history/index.vue b/packages/ui/certd-client/src/views/certd/monitor/history/index.vue index eb8db7058..43b805d6d 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/history/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/history/index.vue @@ -21,9 +21,12 @@ diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/index.vue b/packages/ui/certd-client/src/views/certd/monitor/site/index.vue index 53672d2c6..d39b13db9 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/site/index.vue @@ -26,9 +26,12 @@ diff --git a/packages/ui/certd-client/src/views/certd/monitor/site/ip/index.vue b/packages/ui/certd-client/src/views/certd/monitor/site/ip/index.vue index e61813ece..62191fb2c 100644 --- a/packages/ui/certd-client/src/views/certd/monitor/site/ip/index.vue +++ b/packages/ui/certd-client/src/views/certd/monitor/site/ip/index.vue @@ -5,7 +5,9 @@ diff --git a/packages/ui/certd-client/src/views/certd/notification/index.vue b/packages/ui/certd-client/src/views/certd/notification/index.vue index cdf741462..befc7efe0 100644 --- a/packages/ui/certd-client/src/views/certd/notification/index.vue +++ b/packages/ui/certd-client/src/views/certd/notification/index.vue @@ -11,7 +11,8 @@ diff --git a/packages/ui/certd-client/src/views/certd/pipeline/group/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/group/index.vue index 8d9a9bc97..5a54f40e3 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/group/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/group/index.vue @@ -11,7 +11,8 @@ 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 0d3221f23..37b7a6784 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 @@ -28,6 +28,7 @@ diff --git a/packages/ui/certd-client/src/views/certd/suite/mine/index.vue b/packages/ui/certd-client/src/views/certd/suite/mine/index.vue index f62295758..f3f64f7e9 100644 --- a/packages/ui/certd-client/src/views/certd/suite/mine/index.vue +++ b/packages/ui/certd-client/src/views/certd/suite/mine/index.vue @@ -15,14 +15,14 @@ diff --git a/packages/ui/certd-client/src/views/sys/pipeline/index.vue b/packages/ui/certd-client/src/views/sys/pipeline/index.vue index 6b8cfeee9..dd7654ee7 100644 --- a/packages/ui/certd-client/src/views/sys/pipeline/index.vue +++ b/packages/ui/certd-client/src/views/sys/pipeline/index.vue @@ -14,7 +14,9 @@ diff --git a/packages/ui/certd-client/src/views/sys/suite/invite/level.vue b/packages/ui/certd-client/src/views/sys/suite/invite/level.vue index a8cefe29b..7e2bfb8c6 100644 --- a/packages/ui/certd-client/src/views/sys/suite/invite/level.vue +++ b/packages/ui/certd-client/src/views/sys/suite/invite/level.vue @@ -46,11 +46,15 @@ diff --git a/packages/ui/certd-client/src/views/sys/suite/user-suite/index.vue b/packages/ui/certd-client/src/views/sys/suite/user-suite/index.vue index f00230e42..ecffddb91 100644 --- a/packages/ui/certd-client/src/views/sys/suite/user-suite/index.vue +++ b/packages/ui/certd-client/src/views/sys/suite/user-suite/index.vue @@ -11,7 +11,9 @@ diff --git a/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-vke.ts b/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-vke.ts index 35377e1b0..d314898a4 100644 --- a/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-vke.ts +++ b/packages/ui/certd-server/src/plugins/plugin-volcengine/plugins/plugin-deploy-to-vke.ts @@ -1,9 +1,10 @@ -import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline"; -import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib"; +import { utils } from "@certd/basic"; +import { IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from "@certd/pipeline"; import { CertApplyPluginNames, CertInfo } from "@certd/plugin-cert"; +import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from "@certd/plugin-lib"; +import { AbstractPlusTaskPlugin } from "@certd/plugin-plus"; import { VolcengineAccess } from "../access.js"; import { VolcengineClient } from "../ve-client.js"; -import { utils } from "@certd/basic"; const regionOptions = [ { label: "北京", value: "cn-beijing" }, @@ -20,13 +21,14 @@ const regionOptions = [ icon: "svg:icon-volcengine", group: pluginGroups.volcengine.key, desc: "替换火山引擎VKE集群中的TLS Secret证书", + needPlus:true, default: { strategy: { runStrategy: RunStrategy.SkipWhenSucceed, }, }, }) -export class VolcengineDeployToVKE extends AbstractTaskPlugin { +export class VolcengineDeployToVKE extends AbstractPlusTaskPlugin { @TaskInput({ title: "域名证书", helper: "请选择前置任务输出的域名证书",