Skip to content

Commit

Permalink
Merge pull request #272 from leozhang2018/fix-no-connectors
Browse files Browse the repository at this point in the history
Show repo info in task list.
  • Loading branch information
lilianzhu authored Dec 8, 2021
2 parents 5a98aca + d318aa7 commit d1cdb28
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
39 changes: 38 additions & 1 deletion src/common/task_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,20 @@
label="服务名称"
show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.build_services && row.build_services.length > 0 && row.build_services.slice().sort().join(', ') || 'N/A' }}</span>
<div v-for="(item,index) in getRepo(row)" :key="index">
<el-tooltip v-if="item.builds.length > 0" class="item" effect="light" :open-delay="250" placement="right">
<div slot="content">
<div v-for="(build,buildIndex) in item.builds" :key="buildIndex">
<span v-if="build.tag">Tag-{{build.tag }}</span>
<span v-if="build.branch">Branch-{{ build.branch }}</span>
<span v-if="build.pr">PR-{{ build.pr }}</span>
<span v-if="build.commit_id">{{build.commit_id.substring(0, 7)}}</span>
</div>
</div>
<span class="service-name pointer">{{item.service_name}}</span>
</el-tooltip>
<span v-else class="service-name">{{item.service_name}}</span>
</div>
</template>
</el-table-column>
<el-table-column width="120"
Expand Down Expand Up @@ -150,6 +163,7 @@
<script>
import { wordTranslate } from '@utils/word_translate.js'
import moment from 'moment'
import { get, orderBy } from 'lodash'
export default {
data () {
return {
Expand All @@ -166,6 +180,16 @@ export default {
})
return env_name
},
getRepo (row) {
const buildStage = row.stages.find(stage => stage.type === 'buildv2')
const buildStageArray = this.$utils.mapToArray(buildStage.sub_tasks, 'service_name').map((element) => {
return {
service_name: element.service_name,
builds: get(element, 'job_ctx.builds', '')
}
})
return orderBy(buildStageArray, ['service_name'], ['asc'])
},
convertTimestamp (value) {
return moment.unix(value).format('MM-DD HH:mm')
},
Expand Down Expand Up @@ -249,3 +273,16 @@ export default {
}
}
</script>
<style lang="less" scoped>
.task-list-container {
.service-name {
color: #000;
font-weight: 500;
&.pointer {
cursor: pointer;
}
}
}
</style>
12 changes: 12 additions & 0 deletions src/components/projects/pipeline/workflow_list/pipeline_row.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
</header>

<slot name="more"></slot>
<section class="desc">
<span>{{description}}</span>
</section>
<section class="dash-basicinfo">
<span class="avg-run-time">平均执行时间</span>
<span class="value">{{avgRuntime}}</span>
Expand Down Expand Up @@ -113,6 +116,10 @@ export default {
avgSuccessRate: {
type: String,
required: false
},
description: {
type: String,
required: false
}
},
computed: {
Expand Down Expand Up @@ -266,6 +273,11 @@ export default {
width: 19%;
}
.desc {
color: #666;
font-size: 14px;
}
.dash-basicinfo {
width: 80px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:recentFailID="workflow.recentFailedTask?`#${workflow.recentFailedTask.taskID}`:'-'"
:recentFailLink="makeTaskDetailLink(workflow.projectName,workflow.recentFailedTask)"
:updateTime="$utils.convertTimestamp(workflow.update_time)"
:description="workflow.description"
@refreshWorkflow="refreshWorkflow">
<section slot="more"
class="stages">
Expand Down

0 comments on commit d1cdb28

Please sign in to comment.