fix(xpack): 修复收集任务表头设置的bug

This commit is contained in:
ibuler
2021-05-17 18:01:18 +08:00
committed by Jiangjie.Bai
parent 65c6922621
commit 328e068aca
3 changed files with 12 additions and 4 deletions

View File

@@ -228,7 +228,8 @@ export default {
const _tableConfig = localStorage.getItem('tableConfig')
? JSON.parse(localStorage.getItem('tableConfig'))
: {}
const configShowColumnsNames = _.get(_tableConfig[this.$route.name], 'showColumns', null)
const tableName = this.config.name || this.$route.name
const configShowColumnsNames = _.get(_tableConfig[tableName], 'showColumns', null)
let showColumnsNames = configShowColumnsNames || defaultColumnsNames
if (showColumnsNames.length === 0) {
showColumnsNames = totalColumnsNames
@@ -270,7 +271,8 @@ export default {
const _tableConfig = localStorage.getItem('tableConfig')
? JSON.parse(localStorage.getItem('tableConfig'))
: {}
_tableConfig[this.$route.name] = {
const tableName = this.config.name || this.$route.name
_tableConfig[tableName] = {
'showColumns': columns
}
localStorage.setItem('tableConfig', JSON.stringify(_tableConfig))

View File

@@ -24,7 +24,8 @@ export default {
url: '/api/v1/assets/gathered-users/',
hasTree: true,
columns: [
'hostname', 'ip', 'username', 'date_last_login', 'present', 'ip_last_login', 'date_updated'
'hostname', 'ip', 'username', 'date_last_login', 'present',
'ip_last_login', 'date_updated'
],
columnsMeta: {
hostname: {

View File

@@ -14,10 +14,14 @@ export default {
return {
tableConfig: {
name: 'TaskListTable',
url: '/api/v1/xpack/gathered-user/tasks/',
columns: [
'name', 'nodes', 'periodic_display', 'executed_times', 'actions'
],
columnsShow: {
min: ['name', 'nodes', 'periodic_display', 'executed_times', 'actions']
},
columnsMeta: {
name: {
formatter: null
@@ -61,7 +65,8 @@ export default {
hasRefresh: false,
hasExport: false,
hasMoreActions: false,
createRoute: 'GatherUserTaskCreate'
createRoute: 'GatherUserTaskCreate',
hasColumnSetting: false
}
}
}