CN-182 fix: 修复IP详情页活跃APP列表无数据的问题

This commit is contained in:
chenjinsong
2021-09-28 14:34:06 +08:00
parent 050e663c81
commit 238e303dc5
3 changed files with 5 additions and 3 deletions

View File

@@ -4,7 +4,6 @@
</div> </div>
</template> </template>
<script> <script>
import { get } from '@/utils/http'
export default { export default {
name: 'App', name: 'App',

View File

@@ -12,6 +12,10 @@ export const tableTitleMapping = {
label: 'APP ID', label: 'APP ID',
prop: 'appId' prop: 'appId'
}, },
app: {
label: 'APP',
prop: 'app'
},
sessions: { sessions: {
label: i18n.global.t('overall.sessions'), label: i18n.global.t('overall.sessions'),
prop: 'sessions' prop: 'sessions'

View File

@@ -949,7 +949,7 @@ export default {
if (data.length > 0) { if (data.length > 0) {
const dataColumns = Object.keys(data[0]) // 返回数据的字段 const dataColumns = Object.keys(data[0]) // 返回数据的字段
const columns = dataColumns.map(c => tableTitleMapping[c]) // 展示字段 const columns = dataColumns.map(c => tableTitleMapping[c]) // 展示字段
const keys = ['clientIp', 'serverIp', 'appId', 'domain'] const keys = ['clientIp', 'serverIp', 'appId', 'app', 'domain']
return columns.sort((a, b) => { return columns.sort((a, b) => {
if (keys.indexOf(a.prop) > -1) { if (keys.indexOf(a.prop) > -1) {
return -1 return -1
@@ -1467,7 +1467,6 @@ export default {
} }
this.table.tableData = response.data.result this.table.tableData = response.data.result
this.table.tableColumns = this.getTableTitle(response.data.result) this.table.tableColumns = this.getTableTitle(response.data.result)
console.info(this.table.tableColumns)
this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData) this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
} else { } else {
this.isError = true this.isError = true