fix: 修正蜂窝图下一跳逻辑、修复link下钻后带宽占用不显示的问题
This commit is contained in:
@@ -238,10 +238,13 @@ export default {
|
|||||||
directionArr.forEach((item1) => {
|
directionArr.forEach((item1) => {
|
||||||
const newObj = { egressBitsRate: 0, ingressBitsRate: 0, totalBitsRate: 0, linkDirection: item1 }
|
const newObj = { egressBitsRate: 0, ingressBitsRate: 0, totalBitsRate: 0, linkDirection: item1 }
|
||||||
nextHopData.forEach((item2) => {
|
nextHopData.forEach((item2) => {
|
||||||
if (item1 === item2.egressLinkDirection || item1 === item2.ingressLinkDirection) {
|
if (item1 === item2.egressLinkDirection) {
|
||||||
newObj.egressBitsRate += item2.egressBitsRate
|
newObj.egressBitsRate += item2.egressBitsRate
|
||||||
|
newObj.totalBitsRate += item2.egressBitsRate
|
||||||
|
}
|
||||||
|
if (item1 === item2.ingressLinkDirection) {
|
||||||
newObj.ingressBitsRate += item2.ingressBitsRate
|
newObj.ingressBitsRate += item2.ingressBitsRate
|
||||||
newObj.totalBitsRate += (newObj.egressBitsRate + newObj.ingressBitsRate)
|
newObj.totalBitsRate += item2.ingressBitsRate
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
newNextHopData.push(newObj)
|
newNextHopData.push(newObj)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="link-traffic-list-center">
|
<div class="link-traffic-list-center">
|
||||||
<div class="link-traffic-list-center-label">{{$t('linkMonitor.bandwidthUsage')}}</div>
|
<div class="link-traffic-list-center-label">{{$t('linkMonitor.bandwidthUsage')}}</div>
|
||||||
<div class="link-traffic-list-center-value" v-if="bandWidth">{{unitConvert(linkTrafficListData.totalBitsRate / bandWidth, unitTypes.percent).join('')}}</div>
|
<div class="link-traffic-list-center-value" v-if="bandWidth">{{unitConvert(lineData[0].analysis.avg / bandWidth, unitTypes.percent).join('')}}</div>
|
||||||
<div class="link-traffic-list-center-value" v-else>-</div>
|
<div class="link-traffic-list-center-value" v-else>-</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="link-traffic-list-center">
|
<div class="link-traffic-list-center">
|
||||||
@@ -93,6 +93,37 @@ export default {
|
|||||||
if (condition.length > 1) {
|
if (condition.length > 1) {
|
||||||
params.egressParam = condition.find(c => c.indexOf('common_egress_link_id') > -1 || c.indexOf('egress_link_direction') > -1)
|
params.egressParam = condition.find(c => c.indexOf('common_egress_link_id') > -1 || c.indexOf('egress_link_direction') > -1)
|
||||||
params.ingressParam = condition.find(c => c.indexOf('common_ingress_link_id') > -1 || c.indexOf('ingress_link_direction') > -1)
|
params.ingressParam = condition.find(c => c.indexOf('common_ingress_link_id') > -1 || c.indexOf('ingress_link_direction') > -1)
|
||||||
|
let bandwidthAll = 0
|
||||||
|
let ingressLinkId = null
|
||||||
|
let egressLinkId = null
|
||||||
|
let linkDirection = null
|
||||||
|
const egressParamSplit = params.egressParam.split('=')
|
||||||
|
const ingressParamSplit = params.ingressParam.split('=')
|
||||||
|
if (egressParamSplit[0] && (egressParamSplit[0].trim() === 'common_egress_link_id')) {
|
||||||
|
egressLinkId = egressParamSplit[1].trim()
|
||||||
|
} else if (egressParamSplit[0].trim() === 'egress_link_direction') {
|
||||||
|
linkDirection = egressParamSplit[1].trim()
|
||||||
|
}
|
||||||
|
if (ingressParamSplit[0] && (ingressParamSplit[0].trim() === 'common_ingress_link_id')) {
|
||||||
|
ingressLinkId = ingressParamSplit[1].trim()
|
||||||
|
}
|
||||||
|
if (egressLinkId && ingressLinkId) {
|
||||||
|
this.cnLinkInfo.forEach(e => {
|
||||||
|
if (ingressLinkId == e.originalLinkId) {
|
||||||
|
bandwidthAll += e.bandwidth
|
||||||
|
}
|
||||||
|
if (egressLinkId == e.originalLinkId) {
|
||||||
|
bandwidthAll += e.bandwidth
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (linkDirection) {
|
||||||
|
this.cnLinkInfo.forEach(e => {
|
||||||
|
if (linkDirection === `'${e.nextHop}'`) {
|
||||||
|
bandwidthAll += e.bandwidth
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.bandWidth = bandwidthAll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
@@ -110,35 +141,6 @@ export default {
|
|||||||
if (this.linkTrafficListData.npmScore > 6) {
|
if (this.linkTrafficListData.npmScore > 6) {
|
||||||
this.linkTrafficListData.npmScore = 6
|
this.linkTrafficListData.npmScore = 6
|
||||||
}
|
}
|
||||||
const condition = this.queryCondition.toLowerCase().split(' or ')
|
|
||||||
if (condition.length > 1) {
|
|
||||||
let bandwidthAll = 0
|
|
||||||
const condition0 = condition[0].split('=')
|
|
||||||
const condition1 = condition[1].split('=')
|
|
||||||
let ingressLinkId = null
|
|
||||||
let egressLinkId = null
|
|
||||||
if (condition0[0] && (condition0[0].trim() === 'common_egress_link_id' || condition0[0].trim() === 'egress_link_direction')) {
|
|
||||||
egressLinkId = condition0[1].trim()
|
|
||||||
}
|
|
||||||
if (condition0[0] && (condition0[0].trim() === 'common_ingress_link_id' || condition0[0].trim() === 'ingress_link_direction')) {
|
|
||||||
ingressLinkId = condition0[1].trim()
|
|
||||||
}
|
|
||||||
if (condition1[0] && (condition1[0].trim() === 'common_egress_link_id' || condition1[0].trim() === 'egress_link_direction')) {
|
|
||||||
egressLinkId = condition1[1].trim()
|
|
||||||
}
|
|
||||||
if (condition1[0] && (condition1[0].trim() === 'common_ingress_link_id' || condition1[0].trim() === 'ingress_link_direction')) {
|
|
||||||
ingressLinkId = condition1[1].trim()
|
|
||||||
}
|
|
||||||
this.cnLinkInfo.forEach(e => {
|
|
||||||
if (ingressLinkId === e.originalLinkId) {
|
|
||||||
bandwidthAll += e.bandwidth
|
|
||||||
}
|
|
||||||
if (egressLinkId === e.originalLinkId) {
|
|
||||||
bandwidthAll += e.bandwidth
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.bandWidth = bandwidthAll
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user