CN-421 fix: 解析域名更改列名
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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,63 +42,63 @@ 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 => {
|
||||
if (response.code === 200) {
|
||||
if (this.$_.isEmpty(response.data.result)) {
|
||||
// this.noData0 = true
|
||||
} else {
|
||||
// this.noData0 = false
|
||||
//const chartOption = this.$_.cloneDeep(this.chartOption)
|
||||
const data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
||||
return {
|
||||
data: d,
|
||||
name: d.categoryName,
|
||||
value: parseInt(d.uniqDomains),
|
||||
unitType: chartParams.unitType
|
||||
}
|
||||
})
|
||||
this.chartOption.series[0].data = data
|
||||
const byType = new Promise(resolve => {
|
||||
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 data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
||||
return {
|
||||
data: d,
|
||||
name: d.categoryName,
|
||||
value: parseInt(d.uniqDomains),
|
||||
unitType: chartParams.unitType
|
||||
}
|
||||
}
|
||||
}).finally(() =>{
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
const byReputation = new Promise(resolve => {
|
||||
post(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 data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
||||
return {
|
||||
data: d,
|
||||
name: d.reputationLevel,
|
||||
value: parseInt(d.uniqDomains),
|
||||
unitType: chartParams.unitType
|
||||
}
|
||||
})
|
||||
this.chartOption2.series[0].data = data
|
||||
//this.myChart2.setOption(chartOption)
|
||||
})
|
||||
this.chartOption.series[0].data = data
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
const byReputation = new Promise(resolve => {
|
||||
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 data = response.data.result.sort(reverseSortBy('uniqDomains')).map(d => {
|
||||
return {
|
||||
data: d,
|
||||
name: d.reputationLevel,
|
||||
value: parseInt(d.uniqDomains),
|
||||
unitType: chartParams.unitType
|
||||
}
|
||||
}
|
||||
}).finally(() =>{
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
Promise.all([byType, byReputation]).finally(response => {
|
||||
this.loadEchart(2)
|
||||
})
|
||||
})
|
||||
this.chartOption2.series[0].data = data
|
||||
// this.myChart2.setOption(chartOption)
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
Promise.all([byType, byReputation]).finally(response => {
|
||||
this.loadEchart(2)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(' ')}}
|
||||
|
||||
Reference in New Issue
Block a user