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 = {
state: {
showRightBox: false,
@@ -15,7 +17,8 @@ const panel = {
x: 0,
y: 0
},
chartList: []
chartList: [],
currentMap: dnsServerRole.RTDNSM
},
mutations: {
setShowRightBox (state, flag) {
@@ -62,6 +65,9 @@ const panel = {
},
cleanChartList (state) {
state.chartList = []
},
setCurrentMap (state, currentMap) {
state.currentMap = currentMap
}
},
getters: {
@@ -103,6 +109,9 @@ const panel = {
},
getChartList (state) {
return state.chartList
},
getCurrentMap (state) {
return state.currentMap
}
},
actions: {

View File

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

View File

@@ -204,7 +204,8 @@ export default {
const requestUrl = url || (chartParams && chartParams.url)
// 默认参数特殊处理
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) {

View File

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