diff --git a/docker/run/docker-compose.yaml b/docker/run/docker-compose.yaml index cae99632..e73ee584 100644 --- a/docker/run/docker-compose.yaml +++ b/docker/run/docker-compose.yaml @@ -30,11 +30,6 @@ services: # 配置规则: certd_ + 配置项, 点号用_代替 # ↓↓↓↓ ----------------------------- 如果忘记管理员密码,可以设置为true,重启之后,管理员密码将改成123456,然后请及时修改回false - certd_system_resetAdminPasswd=false - # ↓↓↓↓ -------------------------------- 默认同时启动https,https访问地址https://your.domain:7002 - #- certd_https_key=./data/ssl/cert.key - #- certd_https_cert=./data/ssl/cert.crt - #- certd_https_enabled=true - #- certd_https_port=7002 # ↓↓↓↓ ------------------------------- 使用postgresql数据库 # - certd_flyway_scriptDir=./db/migration-pg # 升级脚本目录 # - certd_typeorm_dataSource_default_type=postgres # 数据库类型 diff --git a/packages/ui/certd-client/src/views/certd/pipeline/api.ts b/packages/ui/certd-client/src/views/certd/pipeline/api.ts index b01defa6..c76ad26e 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/api.ts +++ b/packages/ui/certd-client/src/views/certd/pipeline/api.ts @@ -84,6 +84,13 @@ export async function GetFiles(pipelineId: number) { }); } +export async function GetCount() { + return await request({ + url: apiPrefix + "/count", + method: "post" + }); +} + export type CertInfo = { crt: string; key: string; diff --git a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx index c1632098..afae5185 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx @@ -438,6 +438,9 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp status: { title: "状态", type: "dict-select", + search: { + show: true + }, dict: dict({ data: statusUtil.getOptions() }), diff --git a/packages/ui/certd-client/src/views/certd/pipeline/detail.vue b/packages/ui/certd-client/src/views/certd/pipeline/detail.vue index 1feb2f9c..563ea67a 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/detail.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/detail.vue @@ -1,7 +1,7 @@ @@ -14,6 +14,7 @@ import * as api from "./api"; import { useRoute } from "vue-router"; import { PipelineDetail, PipelineOptions, PluginGroups, RunHistory } from "./pipeline/type"; import { TourProps } from "ant-design-vue"; +import { LocalStorage } from "/@/utils/util.storage"; defineOptions({ name: "PipelineDetail" @@ -24,7 +25,7 @@ const pipelineId: Ref = ref(route.query.id); const pipelineOptions: PipelineOptions = { async getPipelineDetail({ pipelineId }) { const detail = await api.GetDetail(pipelineId); - onLoaded(); + onLoaded(detail); return { pipeline: { id: detail.pipeline.id, @@ -70,30 +71,37 @@ if (route.query.editMode !== "false") { } function useTour() { - const tourOpen = ref(false); - - const tourCurrent = ref(0); - //@ts-ignore - const tourSteps: TourProps["steps"] = ref([]); + const tour = ref({ + open: false, + current: 0, + steps: [], + onClose: () => { + tour.value.open = false; + }, + onFinish: () => { + tour.value.open = false; + LocalStorage.set("tour-off", true, 999999999); + } + }); const tourHandleOpen = (val: boolean): void => { initSteps(); - tourOpen.value = val; + tour.value.open = val; }; function initSteps() { //@ts-ignore - tourSteps.value = [ + tour.value.steps = [ { title: "恭喜创建证书流水线成功", - description: "这里就是我们刚创建的证书任务,点击可以修改证书申请参数", + description: "这里就是我们刚创建的证书任务,点击可以修改证书申请参数", target: () => { return document.querySelector(".pipeline .stages .stage_0 .task"); } }, { title: "添加部署证书任务", - description: "证书申请成功之后还需要部署证书,点击这里可以添加部署任务", + description: "证书申请成功之后还需要部署证书,点击这里可以添加证书部署任务", target: () => { return document.querySelector(".pipeline .stages .last-stage .tasks .task"); } @@ -109,18 +117,28 @@ function useTour() { } return { - tourOpen, - tourCurrent, - tourSteps, + tour, tourHandleOpen }; } -const { tourOpen, tourCurrent, tourSteps, tourHandleOpen } = useTour(); +const { tour, tourHandleOpen } = useTour(); -async function onLoaded() { - await nextTick(); - tourHandleOpen(true); +async function onLoaded(pipeline: PipelineDetail) { + const count = LocalStorage.get("pipeline-count") ?? 0; + if (count > 1) { + return; + } + const off = LocalStorage.get("tour-off") ?? false; + if (off) { + return; + } + const res = await api.GetCount(); + LocalStorage.set("pipeline-count", res.count); + if (res.count <= 1) { + await nextTick(); + tourHandleOpen(true); + } }