CN-820 fix: 修复地图报错问题
This commit is contained in:
@@ -99,48 +99,48 @@ export default {
|
|||||||
}
|
}
|
||||||
if (params.type === 'serverIp' || params.type === 'clientIp') params.type = 'ip'
|
if (params.type === 'serverIp' || params.type === 'clientIp') params.type = 'ip'
|
||||||
getData(api.npm.overview.map, params).then(res => {
|
getData(api.npm.overview.map, params).then(res => {
|
||||||
const subParams = {
|
|
||||||
...params,
|
|
||||||
params: res.map(r => `'${r.country}'`).join(',')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.showError = false
|
this.showError = false
|
||||||
|
if (res && res.length > 0) {
|
||||||
// 计算分数
|
const subParams = {
|
||||||
const tcpRequest = get(api.npm.overview.mapTcp, subParams)
|
...params,
|
||||||
const httpRequest = get(api.npm.overview.mapHttp, subParams)
|
params: res.map(r => `'${r.country}'`).join(',')
|
||||||
const sslRequest = get(api.npm.overview.mapSsl, subParams)
|
}
|
||||||
const tcpLostRequest = get(api.npm.overview.mapPacketLoss, subParams)
|
// 计算分数
|
||||||
const packetRetransRequest = get(api.npm.overview.mapPacketRetrans, subParams)
|
const tcpRequest = get(api.npm.overview.mapTcp, subParams)
|
||||||
Promise.all([tcpRequest, httpRequest, sslRequest, tcpLostRequest, packetRetransRequest]).then(res2 => {
|
const httpRequest = get(api.npm.overview.mapHttp, subParams)
|
||||||
const keyPre = ['tcp', 'http', 'ssl', 'tcpLost', 'packetRetrans']
|
const sslRequest = get(api.npm.overview.mapSsl, subParams)
|
||||||
const mapData = res
|
const tcpLostRequest = get(api.npm.overview.mapPacketLoss, subParams)
|
||||||
res2.forEach((r, i) => {
|
const packetRetransRequest = get(api.npm.overview.mapPacketRetrans, subParams)
|
||||||
if (r.code === 200) {
|
Promise.all([tcpRequest, httpRequest, sslRequest, tcpLostRequest, packetRetransRequest]).then(res2 => {
|
||||||
mapData.forEach(t => {
|
const keyPre = ['tcp', 'http', 'ssl', 'tcpLost', 'packetRetrans']
|
||||||
const find = r.data.result.find(d => d.country === t.country)
|
const mapData = res
|
||||||
t[keyPre[i] + 'Score'] = find
|
res2.forEach((r, i) => {
|
||||||
})
|
if (r.code === 200) {
|
||||||
} else {
|
mapData.forEach(t => {
|
||||||
this.showError = true
|
const find = r.data.result.find(d => d.country === t.country)
|
||||||
this.errorMsg = r.message
|
t[keyPre[i] + 'Score'] = find
|
||||||
}
|
})
|
||||||
|
} else {
|
||||||
|
this.showError = true
|
||||||
|
this.errorMsg = r.message
|
||||||
|
}
|
||||||
|
})
|
||||||
|
mapData.forEach(t => {
|
||||||
|
const data = {
|
||||||
|
establishLatencyMs: t.tcpScore ? t.tcpScore.establishLatencyMs : null,
|
||||||
|
httpResponseLatency: t.httpScore ? t.httpScore.httpResponseLatency : null,
|
||||||
|
sslConLatency: t.sslScore ? t.sslScore.sslConLatency : null,
|
||||||
|
tcpLostlenPercent: t.tcpLostScore ? t.tcpLostScore.tcpLostlenPercent : null,
|
||||||
|
pktRetransPercent: t.packetRetransScore ? t.packetRetransScore.pktRetransPercent : null
|
||||||
|
}
|
||||||
|
t.score = computeScore(data)
|
||||||
|
if (t.score === '-') {
|
||||||
|
t.score = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loadMarkerData(imageSeries, mapData)
|
||||||
})
|
})
|
||||||
mapData.forEach(t => {
|
}
|
||||||
const data = {
|
|
||||||
establishLatencyMs: t.tcpScore ? t.tcpScore.establishLatencyMs : null,
|
|
||||||
httpResponseLatency: t.httpScore ? t.httpScore.httpResponseLatency : null,
|
|
||||||
sslConLatency: t.sslScore ? t.sslScore.sslConLatency : null,
|
|
||||||
tcpLostlenPercent: t.tcpLostScore ? t.tcpLostScore.tcpLostlenPercent : null,
|
|
||||||
pktRetransPercent: t.packetRetransScore ? t.packetRetransScore.pktRetransPercent : null
|
|
||||||
}
|
|
||||||
t.score = computeScore(data)
|
|
||||||
if (t.score === '-') {
|
|
||||||
t.score = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.loadMarkerData(imageSeries, mapData)
|
|
||||||
})
|
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.showError = true
|
this.showError = true
|
||||||
this.errorMsg = e.message
|
this.errorMsg = e.message
|
||||||
|
|||||||
Reference in New Issue
Block a user