Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#11463 from vhwweng/issue_11444
Browse files Browse the repository at this point in the history
feat:环境-节点管理列表增加执行信息并支持排序 TencentBlueKing#11444
  • Loading branch information
bkci-bot authored Feb 28, 2025
2 parents 0b5cf35 + 16d9afd commit c934a08
Show file tree
Hide file tree
Showing 10 changed files with 772 additions and 243 deletions.
2 changes: 1 addition & 1 deletion src/frontend/bk-permission/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bk-permission",
"version": "0.1.5",
"version": "0.1.6",
"description": "",
"main": "./dist/main.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,16 @@ export default {
break;
case 'submit_add_group_perm':
case 'submit_delete_group_perm':
case 'submit_edit_group_perm':
case 'renewal_user_confirm':
case 'renewal_template_confirm': {
case 'submit_edit_group_perm': {
const groupId = data.data.id;
this.syncGroupPermissions(groupId)
break;
}
case 'renewal_user_confirm':
case 'renewal_template_confirm': {
const groupId = data.data.id;
this.syncGroupIAM(this.groupList[this.curGroupIndex].groupId)
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<bk-exception
:type="type"
scene="part"
>
<div style="font-size: 14px;">{{ typeMap[type] }}</div>
<template v-if="type === 'search-empty'">
<div class="empty-tips">
{{ $t('environment.可以尝试 调整关键词 或') }}
<button
class="bk-text-button"
@click="handleClear"
>
{{ $t('environment.清空筛选条件') }}
</button>
</div>
</template>
</bk-exception>
</template>

<script>
export default {
name: 'EmptyTableStatus',
props: {
type: {
type: String,
default: 'empty'
}
},
data () {
return {
typeMap: {
empty: this.$t('environment.暂无数据'),
'search-empty': this.$t('environment.搜索结果为空')
}
}
},
methods: {
handleClear () {
this.$emit('clear')
}
}
}
</script>

<style lang="scss" scoped>
::v-deep .bk-exception-img.part-img {
margin-top: 15%;
}
.empty-tips {
margin-top: 8px;
font-size: 12px;
color: #979BA5;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,15 @@
try {
const res = await this.$store.dispatch('environment/requestNodeList', {
projectId: this.projectId,
envHashId: this.envHashId
envHashId: this.envHashId,
params: {
page: -1
}
})
this.importNodeList.splice(0, this.importNodeList.length)
res.forEach(item => {
res.records.forEach(item => {
item.isChecked = false
item.isDisplay = true
this.importNodeList.push(item)
Expand Down
20 changes: 17 additions & 3 deletions src/frontend/devops-environment/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ const actions = {
/**
* 节点列表
*/
requestNodeList ({ commit }, { projectId }) {
return vue.$ajax.get(`${prefix}/user/envnode/${projectId}`).then(response => {
requestNodeList ({ commit }, { projectId, params }) {
return vue.$ajax.get(`${prefix}/user/envnode/${projectId}/listNew`, { params }).then(response => {
return response
})
},
Expand Down Expand Up @@ -294,8 +294,22 @@ const actions = {
return vue.$ajax.post(`${prefix}/user/environment/thirdPartyAgent/projects/${projectId}/nodes/${nodeHashId}/dockerParallelTaskCount?count=${count}`).then(response => {
return response
})
}
},
/**
* 获取构建机最近执行记录
*/
getLatestBuildPipelineList ({ commit }, { projectId }) {
return vue.$ajax.get(`${prefix}/user/environment/thirdPartyAgent/projects/${projectId}/listLatestBuildPipelines`)
},

exportNodeListCSV ({ commit }, { projectId, params }) {
const queryString = new URLSearchParams(params).toString()
return vue.$ajax.post(`${prefix}/user/envnode/${projectId}/listNew_export?${queryString}`, {}, {
originalResponse: true
}).then(response => {
return response
})
}
}

export default actions
7 changes: 5 additions & 2 deletions src/frontend/devops-environment/src/views/create_env.vue
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,15 @@
try {
const res = await this.$store.dispatch('environment/requestNodeList', {
projectId: this.projectId
projectId: this.projectId,
params: {
page: -1
}
})
this.nodeList.splice(0, this.nodeList.length)
res.forEach(item => {
res.records.forEach(item => {
item.isChecked = false
if (this.createEnvForm.envType === 'BUILD') {
Expand Down
Loading

0 comments on commit c934a08

Please sign in to comment.