From 21620ac6bdeb57e43509156a77037fc07c44282a Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sat, 11 Apr 2026 23:41:20 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=B5=81=E6=B0=B4=E7=BA=BF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=BC=96=E8=BE=91=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9C=AA=E4=BF=9D=E5=AD=98=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/basic/src/utils/util.request.ts | 2 +- .../src/views/certd/pipeline/pipeline/index.vue | 16 +++++++++++++++- .../1panel/plugins/deploy-to-panel.ts | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/core/basic/src/utils/util.request.ts b/packages/core/basic/src/utils/util.request.ts index d98ea3c50..e52884d71 100644 --- a/packages/core/basic/src/utils/util.request.ts +++ b/packages/core/basic/src/utils/util.request.ts @@ -126,7 +126,7 @@ export function createAxiosService({ logger }: { logger: ILogger }) { if (config.skipSslVerify || config.httpProxy) { let rejectUnauthorized = true; if (config.skipSslVerify) { - logger.info("跳过SSL验证"); + logger.info("忽略接口请求的SSL校验"); rejectUnauthorized = false; } const proxy: any = {}; diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue index 50eaff95a..cca147c3c 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue @@ -334,7 +334,7 @@ import { useCertViewer } from "/@/views/certd/pipeline/use"; import { useI18n } from "/@/locales"; import TriggerIcon from "./component/trigger-icon.vue"; import { useCrudPermission } from "/@/plugin/permission"; - +import { onBeforeRouteLeave } from "vue-router"; export default defineComponent({ name: "PipelineEdit", // eslint-disable-next-line vue/no-unused-components @@ -372,10 +372,22 @@ export default defineComponent({ }, emits: ["update:modelValue", "update:editMode"], setup(props, ctx) { + onBeforeRouteLeave((to, from) => { + const newPipelineStr = JSON.stringify(pipeline.value || {}); + if (pipelineOriginStr.value && pipelineOriginStr.value !== newPipelineStr) { + const answer = window.confirm("流水线还未保存,确定要离开吗?"); + if (!answer) { + return false; // 返回 false 即可阻止本次路由跳转 + } + return true; + } + }); + const { t } = useI18n(); //右侧选中的pipeline const currentPipeline: Ref = ref({}); const pipeline: Ref = ref({}); + const pipelineOriginStr = ref(""); const pipelineDetail: Ref = ref({}); const histories: Ref = ref([]); @@ -423,6 +435,7 @@ export default defineComponent({ await loadCurrentHistoryDetail(); pipeline.value = currentHistory.value.pipeline; currentPipeline.value = currentHistory.value.pipeline; + pipelineOriginStr.value = JSON.stringify(pipeline.value); }; async function loadHistoryList(reload = false, historyId: number = null) { @@ -880,6 +893,7 @@ export default defineComponent({ pipeline.value.version = version; currentPipeline.value.version = version; } + pipelineOriginStr.value = JSON.stringify(pipeline.value); } if (offEdit) { toggleEditMode(false); diff --git a/packages/ui/certd-server/src/plugins/plugin-plus/1panel/plugins/deploy-to-panel.ts b/packages/ui/certd-server/src/plugins/plugin-plus/1panel/plugins/deploy-to-panel.ts index 9a0efa392..4dbdc197e 100644 --- a/packages/ui/certd-server/src/plugins/plugin-plus/1panel/plugins/deploy-to-panel.ts +++ b/packages/ui/certd-server/src/plugins/plugin-plus/1panel/plugins/deploy-to-panel.ts @@ -63,18 +63,18 @@ export class OnePanelDeployToPanelPlugin extends AbstractTaskPlugin { helper: "SSL模式,只有2.1.x以上版本才支持,旧版本保持默认即可", component: { name: "a-select", + vMode: "value", options: [ { label: "启用SSL(旧版本)", value: "enable" }, { label: "Strict模式(>=2.1.x)", value: "Enable" }, { label: "Mux模式(>=2.1.x)", value: "Mux" } ], - value: "enable", }, + value: "enable", required: true, }) sslMode!: string; - access: OnePanelAccess; async onInstance() { this.access = await this.getAccess(this.accessId);