CN-537 UI模块-折线图legend统一国际化等
This commit is contained in:
@@ -115,6 +115,9 @@ export default {
|
||||
} else {
|
||||
const seriesTemplate = this.chartOption.series[0]
|
||||
this.chartOption.series = this.chartData.map((r) => {
|
||||
if (r.legend && legendMapping[`${this.entity && this.entity.ip ? 'ip_' : ''}${r.legend}`]) {
|
||||
r.legend = this.$t(legendMapping[`${this.entity && this.entity.ip ? 'ip_' : ''}${r.legend}`])
|
||||
}
|
||||
const serie = {
|
||||
...seriesTemplate,
|
||||
name: legendMapping[
|
||||
@@ -123,7 +126,7 @@ export default {
|
||||
? legendMapping[
|
||||
`${this.entity && this.entity.ip ? 'ip_' : ''}${r.legend}`
|
||||
]
|
||||
: humpToSpace(r.legend),
|
||||
: (legendMapping[r.legend] ? legendMapping[r.legend] : humpToSpace(r.legend)),
|
||||
data: r.values.map((v) => [
|
||||
Number(v[0]) * 1000,
|
||||
Number(v[1]),
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
import chartEchartMixin from './chart-echart-mixin'
|
||||
import unitConvert from '@/utils/unit-convert'
|
||||
import { unitTypes } from '@/utils/constants'
|
||||
import { legendMapping } from '@/views/charts/charts/chart-table-title'
|
||||
|
||||
export default {
|
||||
name: 'ChartEchartWithStatistics',
|
||||
@@ -41,6 +42,9 @@ export default {
|
||||
})
|
||||
const seriesTemplate = this.chartOption.series[0]
|
||||
this.chartOption.series = this.chartData.map((r, i) => {
|
||||
if (r.legend && legendMapping[r.legend]) {
|
||||
r.legend = this.$t(legendMapping[r.legend])
|
||||
}
|
||||
return {
|
||||
...seriesTemplate,
|
||||
name: r.legend,
|
||||
|
||||
@@ -243,6 +243,7 @@ import {
|
||||
isCommon3SingleValue,
|
||||
isDetectionsProtocol
|
||||
} from '@/views/charts/charts/tools'
|
||||
import { legendMapping } from '@/views/charts/charts/chart-table-title'
|
||||
|
||||
export default {
|
||||
name: 'chartSingleValue',
|
||||
@@ -356,6 +357,9 @@ export default {
|
||||
const seriesTemplate = this.chartOption.series[0]
|
||||
const result = response.data.result
|
||||
this.chartOption.series = result.map((r, i) => {
|
||||
if (r.legend && legendMapping[r.legend]) {
|
||||
r.legend = this.$t(legendMapping[r.legend])
|
||||
}
|
||||
return {
|
||||
...seriesTemplate,
|
||||
name: r.legend,
|
||||
|
||||
@@ -43,16 +43,41 @@ export const tableTitleMapping = {
|
||||
}
|
||||
export const legendMapping = {
|
||||
bytes_received_rate: i18n.global.t('trafficSummary.throughputPerSecondC2s'),
|
||||
bytesReceivedRate: i18n.global.t('trafficSummary.throughputPerSecondC2s'),
|
||||
bytes_sent_rate: i18n.global.t('trafficSummary.throughputPerSecondS2c'),
|
||||
bytesSentRate: i18n.global.t('trafficSummary.throughputPerSecondS2c'),
|
||||
bytes_rate: i18n.global.t('trafficSummary.throughputPerSecond'),
|
||||
bytesRate: i18n.global.t('trafficSummary.throughputPerSecond'),
|
||||
ip_bytes_received_rate: i18n.global.t('trafficSummary.receivedPerSecond'),
|
||||
ip_bytes_sent_rate: i18n.global.t('trafficSummary.sentPerSecond'),
|
||||
ip_bytes_rate: i18n.global.t('trafficSummary.throughputPerSecond'),
|
||||
session_rate: i18n.global.t('trafficSummary.sessionsPerSecond'),
|
||||
sessionRate: i18n.global.t('trafficSummary.sessionsPerSecond'),
|
||||
packets_rate: i18n.global.t('trafficSummary.packetsPerSecond'),
|
||||
packetsRate: i18n.global.t('trafficSummary.packetsPerSecond'),
|
||||
packets_received_rate: i18n.global.t('trafficSummary.packetsPerSecondC2s'),
|
||||
packetsReceivedRate: i18n.global.t('trafficSummary.packetsPerSecondC2s'),
|
||||
packets_sent_rate: i18n.global.t('trafficSummary.packetsPerSecondS2c'),
|
||||
packetsSentRate: i18n.global.t('trafficSummary.packetsPerSecondS2c'),
|
||||
ip_packets_rate: i18n.global.t('trafficSummary.packetsPerSecond'),
|
||||
ip_packets_received_rate: i18n.global.t('trafficSummary.packetsPerSecondC2s'),
|
||||
ip_packets_sent_rate: i18n.global.t('trafficSummary.packetsPerSecondS2c')
|
||||
ip_packets_sent_rate: i18n.global.t('trafficSummary.packetsPerSecondS2c'),
|
||||
dnsLatency: i18n.global.t('dns.latency'),
|
||||
queryRate: i18n.global.t('dns.query.rate'),
|
||||
formatErrorRate: i18n.global.t('dns.formatErrorRate'),
|
||||
serverFailureRate: i18n.global.t('dns.serverFailureRate'),
|
||||
nonExistentDomainRate: i18n.global.t('dns.nonExistentDomainRate'),
|
||||
notImplementedRate: i18n.global.t('dns.notImplementedRate'),
|
||||
queryRefusedRate: i18n.global.t('dns.queryRefusedRate'),
|
||||
sequenceGapLossPercent: i18n.global.t('entity.ip.sequenceGapLossPercent'),
|
||||
establishLatency: i18n.global.t('entity.ip.establishLatency'),
|
||||
httpResponseLatency: i18n.global.t('entity.ip.httpResponseLatency'),
|
||||
sslConLatency: i18n.global.t('entity.ip.sslConLatency'),
|
||||
pktRetransPercent: i18n.global.t('entity.ip.pktRetransPercent'),
|
||||
time: i18n.global.t('entity.ip.time'),
|
||||
clientIpCount: i18n.global.t('entity.ip.clientIpCount'),
|
||||
serverIpCount: i18n.global.t('entity.ip.serverIpCount'),
|
||||
appCount: i18n.global.t('entity.ip.appCount'),
|
||||
domainCount: i18n.global.t('entity.ip.domainCount')
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user