Compare commits

...

3 Commits
dev ... 23.09

Author SHA1 Message Date
chenjinsong
fc56a1fc0c fix: networkoverview的曲线图去掉尾部最多4个0值点 2023-09-28 13:23:28 +08:00
chenjinsong
ccd2b3d08b fix: 修复实体列表流量速率显示为横杠的问题 2023-09-28 10:01:13 +08:00
chenjinsong
60bbb8b165 fix: 修复实体列表实体属性为空串时,不显示'-'的问题 2023-09-27 19:53:09 +08:00
2 changed files with 27 additions and 10 deletions

View File

@@ -464,8 +464,7 @@ export default {
newData.push(obj) newData.push(obj)
}) })
} }
if (data && data.length > 0) {
if (data !== undefined && data.length > 0) {
newData.forEach((item) => { newData.forEach((item) => {
item.type = getLineType(item.type) item.type = getLineType(item.type)
if (item.type === val) { if (item.type === val) {
@@ -478,6 +477,24 @@ export default {
}) })
} }
lineData.splice(0, 1) lineData.splice(0, 1)
// TODO 下面的逻辑是判断total曲线的尾部数据从尾往前数0值的个数若个数大于0所有曲线都从尾部去掉相同数量的点最多4个
const totalData = lineData[0]
if (totalData.values.length > 4) {
let count = 0
for (let i = totalData.values.length - 1; i >= totalData.values.length - 4; i--) {
if (totalData.values[i].length > 1 && totalData.values[i][1] === 0) {
count++
} else {
break
}
}
if (count > 0) {
lineData.forEach(l => {
l.values.splice(l.values.length - count, count)
})
}
}
if (val === 'Sessions/s') { if (val === 'Sessions/s') {
const tabs = _.cloneDeep(this.tabsTemplate) const tabs = _.cloneDeep(this.tabsTemplate)
lineData.forEach((d, i) => { lineData.forEach((d, i) => {

View File

@@ -26,7 +26,7 @@
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-country"></i> <i class="cn-icon cn-icon-country"></i>
<span class="row-item-label">{{ $t('overall.country') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('overall.country') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.location ? entityData.location.country : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'location.country', '-') || '-' }}</span>
</div> </div>
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-position"></i> <i class="cn-icon cn-icon-position"></i>
@@ -36,36 +36,36 @@
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-cloud"></i> <i class="cn-icon cn-icon-cloud"></i>
<span class="row-item-label">{{ $t('entities.asn') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('entities.asn') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.asn ? entityData.asn.asn : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'asn.asn', '-') || '-' }}</span>
</div> </div>
</template> </template>
<template v-else-if="entityData.entityType === 'domain'"> <template v-else-if="entityData.entityType === 'domain'">
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-category-group"></i> <i class="cn-icon cn-icon-category-group"></i>
<span class="row-item-label">{{ $t('entities.category') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('entities.category') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.category ? entityData.category.categoryGroup : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'category.categoryGroup', '-') || '-' }}</span>
</div> </div>
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-sub-category"></i> <i class="cn-icon cn-icon-sub-category"></i>
<span class="row-item-label">{{ $t('entities.subcategory') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('entities.subcategory') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.category ? entityData.category.categoryName : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'category.categoryName', '-') || '-' }}</span>
</div> </div>
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-credit-rating"></i> <i class="cn-icon cn-icon-credit-rating"></i>
<span class="row-item-label">{{ $t('entities.reputationLevel') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('entities.reputationLevel') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.category ? entityData.category.reputationLevel : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'category.reputationLevel', '-') || '-' }}</span>
</div> </div>
</template> </template>
<template v-else-if="entityData.entityType === 'app'"> <template v-else-if="entityData.entityType === 'app'">
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-category2"></i> <i class="cn-icon cn-icon-category2"></i>
<span class="row-item-label">{{ $t('entities.category') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('entities.category') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.category ? entityData.category.appCategory : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'category.appCategory', '-') || '-' }}</span>
</div> </div>
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-sub-category"></i> <i class="cn-icon cn-icon-sub-category"></i>
<span class="row-item-label">{{ $t('entities.subcategory') }}&nbsp;:&nbsp;&nbsp;</span> <span class="row-item-label">{{ $t('entities.subcategory') }}&nbsp;:&nbsp;&nbsp;</span>
<span class="row-item-value">{{ entityData.category ? entityData.category.appSubcategory : '-' }}</span> <span class="row-item-value">{{ $_.get(entityData, 'category.appSubcategory', '-') || '-' }}</span>
</div> </div>
<div class="basic-info__item"> <div class="basic-info__item">
<i class="cn-icon cn-icon-credit-rating"></i> <i class="cn-icon cn-icon-credit-rating"></i>
@@ -258,7 +258,7 @@ export default {
} }
axios.get(`${url}?resource=${this.entity.entityValue}`).then(response => { axios.get(`${url}?resource=${this.entity.entityValue}`).then(response => {
this.$nextTick(() => { this.$nextTick(() => {
this.entityData = { ...response.data.data, ...this.entity } this.entityData = { ...this.entityData, ...response.data.data, ...this.entity }
}) })
}) })
}, },