From cb2b71b3467effbaeed037a23f9f88499b9d06be Mon Sep 17 00:00:00 2001 From: aaron <462826@qq.com> Date: Thu, 27 Jan 2022 09:10:24 +0800 Subject: [PATCH] hide tabs for unit test --- internal/server/modules/v1/utils/exec/unit.go | 4 ++-- ui/src/assets/css/custom.less | 3 +++ .../IndexLayout/components/RightTop.vue | 6 ++++++ .../components/RightTopProject.vue | 19 ++++++++++++++++++- ui/src/utils/dom.ts | 19 +++++++++++++++++++ ui/src/views/exec/history/index.vue | 12 +++++++----- 6 files changed, 55 insertions(+), 8 deletions(-) diff --git a/internal/server/modules/v1/utils/exec/unit.go b/internal/server/modules/v1/utils/exec/unit.go index 46022f63..3cd15fee 100644 --- a/internal/server/modules/v1/utils/exec/unit.go +++ b/internal/server/modules/v1/utils/exec/unit.go @@ -89,7 +89,7 @@ func RunUnitTest(ch chan int, sendOutputMsg, sendExecMsg func(info, isRunning st isTerminal := false reader1 := bufio.NewReader(stdout) for { - line, err2 := reader1.ReadString('\n') + line, err3 := reader1.ReadString('\n') if line != "" { sendOutputMsg(line, "", wsMsg) logUtils.ExecConsole(1, line) @@ -98,7 +98,7 @@ func RunUnitTest(ch chan int, sendOutputMsg, sendExecMsg func(info, isRunning st isTerminal = true } - if err2 != nil || io.EOF == err2 { + if err3 != nil || io.EOF == err3 { break } diff --git a/ui/src/assets/css/custom.less b/ui/src/assets/css/custom.less index dab3a4f9..5fd3ecc9 100644 --- a/ui/src/assets/css/custom.less +++ b/ui/src/assets/css/custom.less @@ -3,6 +3,9 @@ @import './variables.less'; @import './mixin.less'; +.t-hidden { + display: none !important; +} .t-icon { cursor: pointer; } diff --git a/ui/src/layouts/IndexLayout/components/RightTop.vue b/ui/src/layouts/IndexLayout/components/RightTop.vue index b763f8c3..6a0ee766 100644 --- a/ui/src/layouts/IndexLayout/components/RightTop.vue +++ b/ui/src/layouts/IndexLayout/components/RightTop.vue @@ -12,6 +12,7 @@ v-if="!item.hidden" :to="item.path" :class="{'active': belongTopMenu === item.path }" + :id="pathToId(item.path)" class="indexlayout-top-menu-li" > {{t(item.title)}} @@ -40,6 +41,7 @@ import RightTopProject from './RightTopProject.vue'; interface RightTopSetupData { t: (key: string | number) => string; topMenuCon: Ref; + pathToId: (val) => void } export default defineComponent({ @@ -87,10 +89,14 @@ export default defineComponent({ const { topNavEnable } = toRefs(props); const { topMenuCon } = useTopMenuWidth(topNavEnable); + const pathToId = (path) => { + return path.replaceAll('/', 'menu-') + } return { t, topMenuCon, + pathToId, } } }) diff --git a/ui/src/layouts/IndexLayout/components/RightTopProject.vue b/ui/src/layouts/IndexLayout/components/RightTopProject.vue index 031ef410..7d73a273 100644 --- a/ui/src/layouts/IndexLayout/components/RightTopProject.vue +++ b/ui/src/layouts/IndexLayout/components/RightTopProject.vue @@ -20,12 +20,13 @@