CN-549 DNS dashboard图表调整,根域名服务器改为转发域名服务器

This commit is contained in:
hyx
2022-05-10 16:21:36 +08:00
parent 2d89787573
commit da0eb999e7
4 changed files with 37 additions and 18 deletions

View File

@@ -1,3 +1,5 @@
import { dnsServerRole } from '@/utils/constants'
const panel = { const panel = {
state: { state: {
showRightBox: false, showRightBox: false,
@@ -15,7 +17,8 @@ const panel = {
x: 0, x: 0,
y: 0 y: 0
}, },
chartList: [] chartList: [],
currentMap: dnsServerRole.RTDNSM
}, },
mutations: { mutations: {
setShowRightBox (state, flag) { setShowRightBox (state, flag) {
@@ -62,6 +65,9 @@ const panel = {
}, },
cleanChartList (state) { cleanChartList (state) {
state.chartList = [] state.chartList = []
},
setCurrentMap (state, currentMap) {
state.currentMap = currentMap
} }
}, },
getters: { getters: {
@@ -103,6 +109,9 @@ const panel = {
}, },
getChartList (state) { getChartList (state) {
return state.chartList return state.chartList
},
getCurrentMap (state) {
return state.currentMap
} }
}, },
actions: { actions: {

View File

@@ -209,7 +209,8 @@ export const dnsServerRole = {
OPRDNS: 'OPRDNS', OPRDNS: 'OPRDNS',
ADNS: 'ADNS', ADNS: 'ADNS',
SBDNS: 'SBDNS', SBDNS: 'SBDNS',
RTDNSM: 'RTDNSM' RTDNSM: 'RTDNSM',
FWDNS: 'FWDNS'
} }
// 整屏滚动的路径映射 // 整屏滚动的路径映射

View File

@@ -204,7 +204,8 @@ export default {
const requestUrl = url || (chartParams && chartParams.url) const requestUrl = url || (chartParams && chartParams.url)
// 默认参数特殊处理 // 默认参数特殊处理
if (requestUrl && requestUrl.indexOf('dnsServerRole') > -1) { if (requestUrl && requestUrl.indexOf('dnsServerRole') > -1) {
this.queryParams.dnsServerRole = extraParams.dnsServerRole || dnsServerRole.RTDNS const currentMap = this.$store.getters.getCurrentMap
this.queryParams.dnsServerRole = extraParams.dnsServerRole || currentMap || dnsServerRole.RTDNSM
} }
if (requestUrl) { if (requestUrl) {

View File

@@ -48,8 +48,8 @@ export default {
currentLegendIndex: 0, currentLegendIndex: 0,
legends: [ legends: [
{ {
name: this.$t('dns.rootDomainServers'), name: this.$t('dns.rtMirrors'),
type: dnsServerRole.RTDNS, type: dnsServerRole.RTDNSM,
value: 0 value: 0
}, },
{ {
@@ -68,15 +68,15 @@ export default {
value: 0 value: 0
}, },
{ {
name: this.$t('dns.rtMirrors'), name: this.$t('dns.forwardServers'),
type: dnsServerRole.RTDNSM, type: dnsServerRole.FWDNS,
value: 0 value: 0
} }
], ],
markerColors: [ markerColors: [
{ {
background: '#C0DEFE', background: '#ECC6F7',
border: '#68AFFC' border: '#B620E0'
}, },
{ {
background: '#DBCFFA', background: '#DBCFFA',
@@ -91,8 +91,8 @@ export default {
border: '#FFB84E' border: '#FFB84E'
}, },
{ {
background: '#ECC6F7', background: '#C0DEFE',
border: '#B620E0' border: '#68AFFC'
}, },
{ {
background: '#FDC6C6', background: '#FDC6C6',
@@ -420,10 +420,14 @@ export default {
}, },
changeLegend (index) { changeLegend (index) {
this.currentLegendIndex = index this.currentLegendIndex = index
this.$store.commit('setCurrentMap', this.legends[index].type)
this.$emit('getChartData', null, { dnsServerRole: this.legends[index].type }) this.$emit('getChartData', null, { dnsServerRole: this.legends[index].type })
}, },
dnsTypeI18n (role) { dnsTypeI18n (role) {
let i18n = '' let i18n = ''
if (!role) {
role = this.legends[this.currentLegendIndex].type
}
switch (role.toUpperCase()) { switch (role.toUpperCase()) {
case dnsServerRole.RTDNS: { case dnsServerRole.RTDNS: {
i18n = 'dns.rootDomainServers' i18n = 'dns.rootDomainServers'
@@ -446,7 +450,11 @@ export default {
break break
} }
case dnsServerRole.RTDNSM: { case dnsServerRole.RTDNSM: {
i18n = 'RTDNSM' i18n = 'dns.rtMirrors'
break
}
case dnsServerRole.FWDNS: {
i18n = 'dns.forwardServers'
break break
} }
default: break default: break
@@ -522,9 +530,9 @@ export default {
}, },
setup (props) { setup (props) {
const circleColor = {} const circleColor = {}
circleColor[dnsServerRole.RTDNS] = { circleColor[dnsServerRole.RTDNSM] = {
background: '#C0DEFE', background: '#ECC6F7',
border: '#478AD5' border: '#BF49DF'
} }
circleColor[dnsServerRole.TLDNS] = { circleColor[dnsServerRole.TLDNS] = {
background: '#DBCFFA', background: '#DBCFFA',
@@ -542,9 +550,9 @@ export default {
background: '#FDC6C6', background: '#FDC6C6',
border: '#FA7777' border: '#FA7777'
} }
circleColor[dnsServerRole.RTDNSM] = { circleColor[dnsServerRole.FWDNS] = {
background: '#ECC6F7', background: '#C0DEFE',
border: '#BF49DF' border: '#478AD5'
} }
return { return {
myChart: shallowRef(null), myChart: shallowRef(null),