CN-421 fix: 解析域名更改列名

This commit is contained in:
chenjinsong
2022-03-31 16:44:16 +08:00
parent d933966def
commit 6afdcc0cad
3 changed files with 57 additions and 56 deletions

View File

@@ -138,6 +138,7 @@ export const chartTableColumnMapping = {
serverIp: 'overall.serverIp',
domain: 'overall.domain',
appName: 'overall.appName',
dnsQname: 'QName',
queryRate: 'dns.queryRate',
queryCount: 'dns.queryCount',
dnsLatency: 'dns.averageResolveLatency',

View File

@@ -25,7 +25,7 @@ import {
ipHostedDomain
} from '@/views/charts/charts/options/pie'
import chartEchartMixin from './chart-echart-mixin'
import { get,post } from '@/utils/http'
import { get, post } from '@/utils/http'
import { reverseSortBy } from '@/utils/tools'
export default {
@@ -42,21 +42,21 @@ export default {
this.initDom(id, 2)
const chartParams = this.chartInfo.params
const domains = this.chartData.toString()
//const domains = "office.com,dbank.com"
// const domains = "office.com,dbank.com"
this.$emit('showLoading', true)
let typeUrl = chartParams.byCategoryUrl.slice(0,chartParams.byCategoryUrl.indexOf('?'))
let reputationUrlUrl = chartParams.byReputationUrl.slice(0,chartParams.byReputationUrl.indexOf('?'))
const typeUrl = chartParams.byCategoryUrl.slice(0, chartParams.byCategoryUrl.indexOf('?'))
const reputationUrlUrl = chartParams.byReputationUrl.slice(0, chartParams.byReputationUrl.indexOf('?'))
const byType = new Promise(resolve => {
post(typeUrl, { domains: domains }).then(response => {
//post(replaceUrlPlaceholder(chartParams.byCategoryUrl, { domains: domains })).then(response => {
get(typeUrl, { domains: domains }).then(response => {
// post(replaceUrlPlaceholder(chartParams.byCategoryUrl, { domains: domains })).then(response => {
if (response.code === 200) {
if (this.$_.isEmpty(response.data.result)) {
// this.noData0 = true
} else {
// this.noData0 = false
//const chartOption = this.$_.cloneDeep(this.chartOption)
// const chartOption = this.$_.cloneDeep(this.chartOption)
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
return {
data: d,
@@ -68,18 +68,18 @@ export default {
this.chartOption.series[0].data = data
}
}
}).finally(() =>{
}).finally(() => {
resolve()
})
})
const byReputation = new Promise(resolve => {
post(reputationUrlUrl, { domains: domains }).then(response => {
get(reputationUrlUrl, { domains: domains }).then(response => {
if (response.code === 200) {
if (this.$_.isEmpty(response.data.result)) {
// this.noData1 = true
} else {
// this.noData1 = false
//const chartOption = this.$_.cloneDeep(this.chartOption)
// const chartOption = this.$_.cloneDeep(this.chartOption)
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
return {
data: d,
@@ -89,10 +89,10 @@ export default {
}
})
this.chartOption2.series[0].data = data
//this.myChart2.setOption(chartOption)
// this.myChart2.setOption(chartOption)
}
}
}).finally(() =>{
}).finally(() => {
resolve()
})
})

View File

@@ -12,7 +12,7 @@
v-for="(c, i) in table.tableColumns.common"
show-overflow-tooltip
:key="i"
:label="$t(chartTableColumnMapping[c])"
:label="$t(chartTableColumnMapping[c] || c)"
:prop="c"
>
</el-table-column>
@@ -20,10 +20,10 @@
v-for="(c, i) in table.tableColumns.order"
show-overflow-tooltip
:key="i"
:label="$t(chartTableColumnMapping[c])"
:label="$t(chartTableColumnMapping[c] || c)"
:prop="c"
>
<template #header>{{$t(chartTableColumnMapping[c])}}</template>
<template #header>{{$t(chartTableColumnMapping[c] || c)}}</template>
<template #default="{ row }">
<span v-if="c === 'bytes'">
{{unitConvert(row[c], unitTypes.byte).join(' ')}}