fix: 修复app详情列表曲线图缺失、统计数据错位问题
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="entity-list">
|
<div class="entity-list">
|
||||||
|
<div class="entity__loading" v-show="loading">
|
||||||
|
<i class="el-icon-loading"></i>
|
||||||
|
</div>
|
||||||
<div class="entity-list__content">
|
<div class="entity-list__content">
|
||||||
<div class="cn-entity" v-for="(d, i) in entityList" :key="i">
|
<div class="cn-entity" v-for="(d, i) in entityList" :key="i">
|
||||||
<div class="cn-entity__header">
|
<div class="cn-entity__header">
|
||||||
@@ -29,9 +32,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="header__bottom__line" ></div>
|
<div class="header__bottom__line"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cn-entity__body" >
|
<div class="cn-entity__body">
|
||||||
<template v-if="from === 'ip'">
|
<template v-if="from === 'ip'">
|
||||||
<div class="body__row">
|
<div class="body__row">
|
||||||
<span class="body__row-label"><i class="cn-icon cn-icon-country" ></i>{{$t('overall.country')}}:</span>
|
<span class="body__row-label"><i class="cn-icon cn-icon-country" ></i>{{$t('overall.country')}}:</span>
|
||||||
@@ -49,9 +52,11 @@
|
|||||||
<div class="body__drawing-box">
|
<div class="body__drawing-box">
|
||||||
<div class="body__drawing" :id="`entityListChart${d.id}`"></div>
|
<div class="body__drawing" :id="`entityListChart${d.id}`"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="entity-statics-down"><i class="cn-icon cn-icon-fall entity-statics-icon" style=""></i>{{d.latestReceived || 0}} bps</div>
|
<div class="body__statics">
|
||||||
<div class="entity-statics-up" ><i class="cn-icon cn-icon-rise" style=""></i>{{d.latestSent || 0}} bps</div>
|
<div class="entity-statics-down"><i class="cn-icon cn-icon-fall entity-statics-icon" style=""></i>{{d.latestReceived || 0}} bps</div>
|
||||||
<div class="body__detail" @click="entityDetail({ip: d.ip, type: 4})">{{$t('overall.detail')}}></div>
|
<div class="entity-statics-up" ><i class="cn-icon cn-icon-rise" style=""></i>{{d.latestSent || 0}} bps</div>
|
||||||
|
<div class="body__detail" @click="entityDetail({ip: d.ip, type: 4})">{{$t('overall.detail')}}></div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="from === 'domain'">
|
<template v-else-if="from === 'domain'">
|
||||||
<div class="body__row">
|
<div class="body__row">
|
||||||
@@ -70,9 +75,11 @@
|
|||||||
<div class="body__drawing-box">
|
<div class="body__drawing-box">
|
||||||
<div class="body__drawing" :id="`entityListChart${d.id}`"></div>
|
<div class="body__drawing" :id="`entityListChart${d.id}`"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="entity-statics-down" style=" "><i class="cn-icon cn-icon-fall entity-statics-icon" style=""></i>{{d.latestReceived || 0}} bps</div>
|
<div class="body__statics">
|
||||||
<div class="entity-statics-up" ><i class="cn-icon cn-icon-rise" style=""></i>{{d.latestSent || 0}} bps</div>
|
<div class="entity-statics-down" style=" "><i class="cn-icon cn-icon-fall entity-statics-icon" style=""></i>{{d.latestReceived || 0}} bps</div>
|
||||||
<div class="body__detail" @click="entityDetail({domain: d.domainName, type: 5})">{{$t('overall.detail')}}></div>
|
<div class="entity-statics-up" ><i class="cn-icon cn-icon-rise" style=""></i>{{d.latestSent || 0}} bps</div>
|
||||||
|
<div class="body__detail" @click="entityDetail({domain: d.domainName, type: 5})">{{$t('overall.detail')}}></div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="from === 'app'">
|
<template v-else-if="from === 'app'">
|
||||||
<div class="body__row">
|
<div class="body__row">
|
||||||
@@ -91,9 +98,11 @@
|
|||||||
<div class="body__drawing-box">
|
<div class="body__drawing-box">
|
||||||
<div class="body__drawing" :id="`entityListChart${d.id}`"></div>
|
<div class="body__drawing" :id="`entityListChart${d.id}`"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="entity-statics-down" style=" "><i class="cn-icon cn-icon-fall entity-statics-icon" style=""></i>{{d.latestReceived || 0}} bps</div>
|
<div class="body__statics">
|
||||||
<div class="entity-statics-up" ><i class="cn-icon cn-icon-rise" style=""></i>{{d.latestSent || 0}} bps</div>
|
<div class="entity-statics-down" style=" "><i class="cn-icon cn-icon-fall entity-statics-icon" style=""></i>{{d.latestReceived || 0}} bps</div>
|
||||||
<div class="body__detail" @click="entityDetail({app: d.appName, type: 6})">{{$t('overall.detail')}}></div>
|
<div class="entity-statics-up" ><i class="cn-icon cn-icon-rise" style=""></i>{{d.latestSent || 0}} bps</div>
|
||||||
|
<div class="body__detail" @click="entityDetail({app: d.appName, type: 6})">{{$t('overall.detail')}}></div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,7 +136,8 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
listData: Array,
|
listData: Array,
|
||||||
from: String,
|
from: String,
|
||||||
pageObj: Object
|
pageObj: Object,
|
||||||
|
loading: Boolean
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
@@ -359,4 +369,17 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.entity__loading {
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.entity__loading i {
|
||||||
|
position: absolute;
|
||||||
|
left: calc(50% - 15px);
|
||||||
|
top: calc(50% - 15px);
|
||||||
|
font-size: 30px;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
.entity-list__content {
|
.entity-list__content {
|
||||||
/* display: grid;
|
/* display: grid;
|
||||||
@@ -126,37 +127,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
height:240px;
|
height:240px;
|
||||||
|
|
||||||
.entity-statics-down{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 20px;
|
|
||||||
left: 30px;
|
|
||||||
font-family: PingFangSC-Medium;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666666;
|
|
||||||
font-weight: 500;
|
|
||||||
margin-right:24px;
|
|
||||||
i {
|
|
||||||
color:#5881B7;
|
|
||||||
font-size:14px;
|
|
||||||
margin-right:6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.entity-statics-up{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 20px;
|
|
||||||
left: 112px;
|
|
||||||
font-family: PingFangSC-Medium;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666666;
|
|
||||||
font-weight: 500;
|
|
||||||
i {
|
|
||||||
color:#62B16C;
|
|
||||||
font-size:14px;
|
|
||||||
margin-right:6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
.body__row {
|
.body__row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -204,18 +174,42 @@
|
|||||||
color: #666666;
|
color: #666666;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
.body__detail {
|
.body__statics {
|
||||||
padding: 9px 0 0 30px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-family: PingFangSC-Regular;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #8FA1BE;
|
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
right: 30px;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 30px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666666;
|
||||||
|
.entity-statics-down{
|
||||||
|
padding-right: 20px;
|
||||||
|
min-width: 80px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
color:#5881B7;
|
||||||
|
font-size:14px;
|
||||||
|
padding-right:6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.entity-statics-up{
|
||||||
|
padding-right: 20px;
|
||||||
|
min-width: 80px;;
|
||||||
|
i {
|
||||||
|
color: #62B16C;
|
||||||
|
font-size: 14px;
|
||||||
|
padding-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.body__detail {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #8FA1BE;
|
||||||
|
position: absolute;
|
||||||
|
right: 30px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -915,12 +915,13 @@ export default {
|
|||||||
const sumData = []
|
const sumData = []
|
||||||
data.forEach(r => {
|
data.forEach(r => {
|
||||||
const hit = sumData.find(s => s.id === r.serverId)
|
const hit = sumData.find(s => s.id === r.serverId)
|
||||||
|
const value = Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
|
||||||
if (hit) {
|
if (hit) {
|
||||||
hit.value += Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
|
hit.value += value
|
||||||
} else {
|
} else {
|
||||||
sumData.push({
|
sumData.push({
|
||||||
id: r.serverId,
|
id: r.serverId,
|
||||||
value: Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
|
value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
<entity-list
|
<entity-list
|
||||||
:list-data="listData"
|
:list-data="listData"
|
||||||
:from="from"
|
:from="from"
|
||||||
|
:loading="loading"
|
||||||
:page-obj="pageObjRight"
|
:page-obj="pageObjRight"
|
||||||
@showDetail="entityDetail"
|
@showDetail="entityDetail"
|
||||||
@pageNo="pageNoRight"
|
@pageNo="pageNoRight"
|
||||||
@@ -71,7 +72,8 @@ export default {
|
|||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
showDetail: false,
|
showDetail: false,
|
||||||
currentEntity: {}
|
currentEntity: {},
|
||||||
|
loading: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -121,17 +123,25 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async search () {
|
async search () {
|
||||||
|
const vm = this
|
||||||
const params = { from: this.from, q: doubleQuotationToSingle(this.searchContent) }
|
const params = { from: this.from, q: doubleQuotationToSingle(this.searchContent) }
|
||||||
this.listData = (await getEntityList({ ...this.pageObjRight, ...params })).map(d => ({
|
this.loading = true
|
||||||
...d,
|
try {
|
||||||
id: window.btoa(d.ip || d.domainName || d.appId),
|
this.listData = (await getEntityList({ ...this.pageObjRight, ...params })).map(d => ({
|
||||||
latestSent: null,
|
...d,
|
||||||
latestReceived: null
|
id: window.btoa(d.ip || d.domainName || d.appName),
|
||||||
}))
|
latestSent: null,
|
||||||
this.pageObjRight.total = await getEntityCount(params)
|
latestReceived: null
|
||||||
const { topFilterData, bottomFilterData } = await this.queryFilterData(params)
|
}))
|
||||||
this.topFilterData = topFilterData
|
this.pageObjRight.total = await getEntityCount(params)
|
||||||
this.bottomFilterData = bottomFilterData
|
const { topFilterData, bottomFilterData } = await this.queryFilterData(params)
|
||||||
|
this.topFilterData = topFilterData
|
||||||
|
this.bottomFilterData = bottomFilterData
|
||||||
|
} finally {
|
||||||
|
setTimeout(() => {
|
||||||
|
vm.loading = false
|
||||||
|
}, 250)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/* 重置条件 */
|
/* 重置条件 */
|
||||||
reset () {
|
reset () {
|
||||||
|
|||||||
Reference in New Issue
Block a user