Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808 #10884

Merged
merged 14 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
83abdc5
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Aug 26, 2024
e6961e7
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Aug 28, 2024
6b36e30
Merge branch 'master' of https://github.com/TencentBlueKing/bk-ci int…
useryuyu Sep 14, 2024
abdfd73
Merge branch 'master' of https://github.com/TencentBlueKing/bk-ci int…
useryuyu Sep 14, 2024
adb00b0
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Sep 14, 2024
84c2653
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Sep 18, 2024
d37508b
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Sep 18, 2024
c1678f9
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Sep 20, 2024
bdd660c
Merge branch 'master' of https://github.com/TencentBlueKing/bk-ci int…
useryuyu Oct 23, 2024
4655f3a
Merge branch 'master' of https://github.com/TencentBlueKing/bk-ci int…
useryuyu Oct 23, 2024
660ae58
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Oct 24, 2024
b13fe4d
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Oct 24, 2024
40106f3
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Oct 25, 2024
9c239fb
增加构建详情的查看配置项,在构建详情界面点击插件时,默认进入的是 日志 or 配置 Tab页面。 #10808
useryuyu Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@
}
.card-item {
text-align: center;
word-wrap: break-word;
word-break: break-all;
padding: 5px;
i {
font-size: 12px;
font-weight: bold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
import Logo from '@/components/Logo'
import { extForFile } from '@/utils/pipelineConst'
import { convertFileSize } from '@/utils/util'
import { SET_PLUGIN_HEAD_TAB } from '@/store/modules/atom/constants'

export default {
components: {
Expand Down Expand Up @@ -107,6 +108,7 @@

created () {
this.initData()
this.$store.commit(`atom/${SET_PLUGIN_HEAD_TAB}`, { isGetPluginHeadTab: false })
},

methods: {
Expand Down Expand Up @@ -140,6 +142,9 @@
size: item.folder ? this.sizeFormatter(this.getFolderSize(item)) : this.sizeFormatter(item.size)
})) || []
this.hasPermission = permission
if (res) {
this.$store.commit(`atom/${SET_PLUGIN_HEAD_TAB}`, { isGetPluginHeadTab: true })
}
if (this.artifactories.length > 0) {
this.$emit('toggle', true)
}
Expand Down
53 changes: 35 additions & 18 deletions src/frontend/devops-pipeline/src/components/ExecDetail/plugin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<span
class="head-tab"
slot="tab"
v-if="isGetPluginHeadTab"
>
<template v-for="tab in tabList">
<template v-for="tab in sortedTabList">
<span
v-if="tab.show"
:key="tab.name"
Expand Down Expand Up @@ -43,7 +44,7 @@
v-if="currentTab === 'log'"
/>
<component
v-if="currentTab === key"
v-show="currentTab === key"
lockiechen marked this conversation as resolved.
Show resolved Hide resolved
:is="value.component"
v-bind="value.bindData"
v-for="(value, key) in componentList"
Expand Down Expand Up @@ -81,6 +82,10 @@
editingElementPos: {
type: Object,
required: true
},
properties: {
type: Array,
default: () => ['LOG', 'ARTIFACT', 'CONFIG']
}
},
data () {
Expand All @@ -89,15 +94,16 @@
tabList: [
{ name: 'log', show: true },
{ name: 'artifactory', show: false, completeLoading: false },
{ name: 'report', show: false, completeLoading: false },
{ name: 'setting', show: true }
{ name: 'setting', show: true },
{ name: 'report', show: false, completeLoading: false }
]
}
},

computed: {
...mapState('atom', [
'globalEnvs'
'globalEnvs',
'isGetPluginHeadTab'
]),

stages () {
Expand Down Expand Up @@ -163,6 +169,26 @@
// } catch (error) {
// return null
// }
},
sortedTabList () {
const mapping = {
LOG: 'log',
ARTIFACT: 'artifactory',
CONFIG: 'setting'
}

const orderedTabs = this.properties.map(prop => {
const tabName = mapping[prop]
return this.tabList.find(tab => tab.name === tabName)
}).filter(Boolean)

const reportTab = this.tabList.find(tab => tab.name === 'report')
if (reportTab) {
orderedTabs.push(reportTab)
}

this.currentTab = orderedTabs.find(tab => tab.show)?.name
return orderedTabs
}
},

Expand All @@ -171,29 +197,20 @@
this.tabList = [
{ name: 'log', show: true },
{ name: 'artifactory', show: true, completeLoading: false },
{ name: 'report', show: false, completeLoading: false },
{ name: 'setting', show: true }
{ name: 'setting', show: true },
{ name: 'report', show: false, completeLoading: false }
]
},
tabList: {
handler (val) {
const tab = val.find(tab => tab.name === this.currentTab)
if (!tab.show) {
this.currentTab = 'log'
}
},
deep: true
}
},

methods: {
toggleTab (key, show = false) {
const tab = this.tabList.find(tab => tab.name === key)
const tab = this.sortedTabList.find(tab => tab.name === key)
tab.show = show
},

completeLoading (key) {
const tab = this.tabList.find(tab => tab.name === key)
const tab = this.sortedTabList.find(tab => tab.name === key)
tab.completeLoading = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,34 @@
@confirm="submit"
@cancel="cancel"
>
<bk-form
:model="model"
form-type="vertical"
v-bkloading="{ isLoading: isSubmiting }"
ref="copyForm"
>
<bk-form-item
v-for="item in formModel"
:key="item.name"
:label="$t(item.name)"
:rules="item.rules"
:property="item.name"
<div v-bkloading="{ isLoading: isSubmiting }">
<bk-form
:model="model"
form-type="vertical"
ref="copyForm"
>
<bk-input
:placeholder="$t(item.placeholder)"
:value="item.value"
@input="item.handleInput"
/>
</bk-form-item>
</bk-form>
<PipelineGroupSelector
class="pipeline-group-selector-form"
ref="pipelineGroupSelector"
v-model="groupValue"
:has-manage-permission="isManage"
:pipeline-name="model.name"
/>
<bk-form-item
v-for="item in formModel"
:key="item.name"
:label="$t(item.name)"
:rules="item.rules"
:property="item.name"
>
<bk-input
:placeholder="$t(item.placeholder)"
:value="item.value"
@input="item.handleInput"
/>
</bk-form-item>
</bk-form>
<PipelineGroupSelector
class="pipeline-group-selector-form"
ref="pipelineGroupSelector"
v-model="groupValue"
:has-manage-permission="isManage"
:pipeline-name="model.name"
/>
</div>
</bk-dialog>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export const SET_COMMEND_ATOM_PAGE_OVER = 'SET_COMMEND_ATOM_PAGE_OVER'
export const SET_PIPELINE_INFO = 'SET_PIPELINE_INFO'
export const UPDATE_PIPELINE_INFO = 'UPDATE_PIPELINE_INFO'

export const SET_PLUGIN_HEAD_TAB = 'SET_PLUGIN_HEAD_TAB'

export const buildNoRules = [
{
value: 'CONSISTENT',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export default {
activePipelineVersion: null,
yamlHighlightBlockMap: {},
switchingVersion: false,
isElementModified: false
isElementModified: false,
isGetPluginHeadTab: false
},
mutations,
actions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import {
SET_STORE_LOADING,
SET_STORE_SEARCH,
SET_TEMPLATE,
SET_PLUGIN_HEAD_TAB,
SWITCHING_PIPELINE_VERSION,
TOGGLE_ATOM_SELECTOR_POPUP,
TOGGLE_STAGE_REVIEW_PANEL,
Expand Down Expand Up @@ -504,5 +505,10 @@ export default {

})
return state
},
[SET_PLUGIN_HEAD_TAB]: (state, { isGetPluginHeadTab }) => {
return Object.assign(state, {
isGetPluginHeadTab
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
<plugin
:exec-detail="execDetail"
:editing-element-pos="editingElementPos"
:properties="curProject.properties?.pluginDetailsDisplayOrder"
@close="hideSidePanel"
/>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
word-break: break-all;
font-size: 12px;
color: #666770;
white-space: pre;
&.show-more {
display: block;
}
Expand Down
Loading