CN-402 fix: 部分字段不显示的问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import i18n from '@/i18n'
|
||||
import _ from 'lodash'
|
||||
import { storageKey, iso36112 } from '@/utils/constants'
|
||||
import { storageKey, iso36112, topDomain } from '@/utils/constants'
|
||||
import { getIso36112JsonData } from '@/utils/api'
|
||||
import { format } from 'echarts'
|
||||
import router from '@/router'
|
||||
@@ -606,6 +606,31 @@ export function copyValue (item) {
|
||||
ElMessage.success(i18n.global.t('tip.copySuccess'))
|
||||
}
|
||||
|
||||
export function computeSecondaryDomain (name) {
|
||||
// 命中的顶级域名
|
||||
let hitTopDomain = ''
|
||||
// 同顶级域名比对
|
||||
const hits = []
|
||||
topDomain.forEach(td => {
|
||||
const hitIndex = name.lastIndexOf(td)
|
||||
if (hitIndex > -1 && hitIndex + td.length === name.length) {
|
||||
hits.push(td)
|
||||
}
|
||||
})
|
||||
if (hits.length > 0) {
|
||||
hits.sort((a, b) => {
|
||||
return b.split('.').length - a.split('.').length
|
||||
})
|
||||
hitTopDomain = hits[0]
|
||||
} else {
|
||||
const arr = name.split('.')
|
||||
hitTopDomain = arr[arr.length - 1]
|
||||
}
|
||||
const index = name.lastIndexOf(hitTopDomain)
|
||||
const preArr = name.substring(0, index).split('.')
|
||||
return [preArr[preArr.length - 2], hitTopDomain].join('.')
|
||||
}
|
||||
|
||||
export function getCurrentRoute () {
|
||||
return router.currentRoute && router.currentRoute.path
|
||||
}
|
||||
|
||||
@@ -92,12 +92,12 @@
|
||||
|
||||
<script>
|
||||
import { api, getData } from '@/utils/api'
|
||||
import { eventSeverityColor,unitTypes ,topDomain} from '@/utils/constants'
|
||||
import { eventSeverityColor, unitTypes } from '@/utils/constants'
|
||||
import { getSecond } from '@/utils/date-util'
|
||||
import { get } from '@/utils/http'
|
||||
import * as echarts from 'echarts'
|
||||
import { metricOption } from '@/views/detections/options/detectionOptions'
|
||||
import { sortBy,reverseSortBy } from '@/utils/tools'
|
||||
import { sortBy, reverseSortBy, computeSecondaryDomain } from '@/utils/tools'
|
||||
export default {
|
||||
name: 'DetectionPerformanceEventDomainOverview',
|
||||
props: {
|
||||
@@ -134,35 +134,10 @@ export default {
|
||||
}
|
||||
return result || '-'
|
||||
}
|
||||
},
|
||||
computeSecondaryDomain () {
|
||||
return function (name) {
|
||||
// 命中的顶级域名
|
||||
let hitTopDomain = ''
|
||||
// 同顶级域名比对
|
||||
const hits = []
|
||||
topDomain.forEach(td => {
|
||||
const hitIndex = name.lastIndexOf(td)
|
||||
if (hitIndex > -1 && hitIndex + td.length === name.length) {
|
||||
hits.push(td)
|
||||
}
|
||||
})
|
||||
if (hits.length > 0) {
|
||||
hits.sort((a, b) => {
|
||||
return b.split('.').length - a.split('.').length
|
||||
})
|
||||
hitTopDomain = hits[0]
|
||||
} else {
|
||||
const arr = name.split('.')
|
||||
hitTopDomain = arr[arr.length - 1]
|
||||
}
|
||||
const index = name.lastIndexOf(hitTopDomain)
|
||||
const preArr = name.substring(0, index).split('.')
|
||||
return [preArr[preArr.length - 2], hitTopDomain].join('.')
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computeSecondaryDomain,
|
||||
query () {
|
||||
this.queryBasic().then(responses => {
|
||||
responses && (this.basicInfo = responses)
|
||||
|
||||
@@ -135,17 +135,17 @@
|
||||
<div class="overview__content">
|
||||
<div class="overview__row">
|
||||
<div class="row__label">{{$t('entities.recentAlert')}}</div>
|
||||
<div class="row__content">{{entityData.alertNum || '-'}}</div>
|
||||
<div class="row__content">{{entityData.performanceNum || '-'}}</div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(alert, index) in entityData.alertList" :key="index">
|
||||
<div class="row__label row__label--width160">{{alert.startTime}}</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(performance, index) in entityData.performanceList" :key="index">
|
||||
<div class="row__label row__label--width160">{{performance.startTime}}</div>
|
||||
<div class="row__content row__content--width200">
|
||||
<div class="alert-level-tag alert-level-tag--high">{{alert.alertSeverity}}</div>
|
||||
<div>{{alert.alertName}}</div>
|
||||
<div class="alert-level-tag alert-level-tag--high">{{performance.eventSeverity}}</div>
|
||||
<div>{{performance.name}}</div>
|
||||
</div>
|
||||
<div class="row__desc"></div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-if="entityData.alertList && entityData.alertList.length > 3">
|
||||
<div class="overview__row overview__row--small-font" v-if="entityData.performanceList && entityData.performanceList.length > 3">
|
||||
<div class="show-more">{{$t('overall.showMore')}}>></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -160,7 +160,7 @@
|
||||
<div class="overview__row overview__row--small-font" v-for="(security, index) in entityData.securityList" :key="index">
|
||||
<div class="row__label row__label--width160">{{security.startTime}}</div>
|
||||
<div class="row__content row__content--width200">
|
||||
<div class="alert-level-tag alert-level-tag--high">{{security.securitySeverity}}</div>
|
||||
<div class="alert-level-tag alert-level-tag--high">{{security.eventSeverity}}</div>
|
||||
<div>{{security.sourceName}}</div>
|
||||
</div>
|
||||
<div class="row__desc"></div>
|
||||
@@ -210,7 +210,7 @@ export default {
|
||||
networkQuantityUrl: api.entityAppDetailNetworkQuantity,
|
||||
linkInUrl: api.entityAppDetailLinkIn,
|
||||
linkOutUrl: api.entityAppDetailLinkOut,
|
||||
performanceUrl: api.entityIpDetailPerformance,
|
||||
performanceUrl: api.entityAppDetailPerformance,
|
||||
securityUrl: api.entityAppDetailSecurity,
|
||||
trafficUrlMap: api.entityAppDetailTrafficMap,
|
||||
relatedServerDomainUrl: api.entityAppRelatedServerDomain,
|
||||
|
||||
@@ -139,17 +139,17 @@
|
||||
<div class="overview__content">
|
||||
<div class="overview__row">
|
||||
<div class="row__label">{{$t('entities.recentAlert')}}</div>
|
||||
<div class="row__content">{{entityData.alertNum || '-'}}</div>
|
||||
<div class="row__content">{{entityData.performanceNum || '-'}}</div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(alert, index) in entityData.alertList" :key="index">
|
||||
<div class="row__label row__label--width160">{{alert.startTime}}</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(performance, index) in entityData.performanceList" :key="index">
|
||||
<div class="row__label row__label--width160">{{performance.startTime}}</div>
|
||||
<div class="row__content row__content--width200">
|
||||
<div class="alert-level-tag alert-level-tag--high">{{alert.alertSeverity}}</div>
|
||||
<div>{{alert.alertName}}</div>
|
||||
<div class="alert-level-tag alert-level-tag--high">{{performance.eventSeverity}}</div>
|
||||
<div>{{performance.name}}</div>
|
||||
</div>
|
||||
<div class="row__desc"></div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-if="entityData.alertList && entityData.alertList.length > 3">
|
||||
<div class="overview__row overview__row--small-font" v-if="entityData.performanceList && entityData.performanceList.length > 3">
|
||||
<div class="show-more">{{$t('overall.showMore')}}>></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@
|
||||
<div class="overview__row overview__row--small-font" v-for="(security, i) in entityData.securityList" :key="i">
|
||||
<div class="row__label row__label--width160">{{security.startTime}}</div>
|
||||
<div class="row__content row__content--width200">
|
||||
<div class="alert-level-tag alert-level-tag--high">{{security.securitySeverity}}</div>
|
||||
<div class="alert-level-tag alert-level-tag--high">{{security.eventSeverity}}</div>
|
||||
<div>{{security.sourceName}}</div>
|
||||
</div>
|
||||
<div class="row__desc"></div>
|
||||
|
||||
@@ -123,17 +123,17 @@
|
||||
<div class="overview__content">
|
||||
<div class="overview__row">
|
||||
<div class="row__label">{{$t('entities.recentAlert')}}</div>
|
||||
<div class="row__content">{{entityData.alertNum || '-'}}</div>
|
||||
<div class="row__content">{{entityData.performanceNum || '-'}}</div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(alert, index) in entityData.alertList" :key="index">
|
||||
<div class="row__label row__label--width160">{{alert.startTime}}</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(performance, index) in entityData.performanceList" :key="index">
|
||||
<div class="row__label row__label--width160">{{performance.startTime}}</div>
|
||||
<div class="row__content row__content--width200">
|
||||
<div class="alert-level-tag alert-level-tag--high">{{alert.alertSeverity}}</div>
|
||||
<div>{{alert.alertName}}</div>
|
||||
<div class="alert-level-tag alert-level-tag--high">{{performance.eventSeverity}}</div>
|
||||
<div>{{performance.name}}</div>
|
||||
</div>
|
||||
<div class="row__desc"></div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-if="entityData.alertList && entityData.alertList.length > 3">
|
||||
<div class="overview__row overview__row--small-font" v-if="entityData.performanceList && entityData.performanceList.length > 3">
|
||||
<div class="show-more">{{$t('overall.showMore')}}>></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,9 +146,9 @@
|
||||
<div class="row__content">{{entityData.securityNum || '-'}}</div>
|
||||
</div>
|
||||
<div class="overview__row overview__row--small-font" v-for="(security, index) in entityData.securityList" :key="index">
|
||||
<div class="row__label row__label--width160">{{security.startTime}}</div>
|
||||
<div class="row__label row__label--width160">{{dayJs.tz(getMillisecond(security.startTime)).format('YYYY-MM-DD HH:mm:ss') || '-'}}</div>
|
||||
<div class="row__content row__content--width200">
|
||||
<div class="alert-level-tag alert-level-tag--high">{{security.securitySeverity}}</div>
|
||||
<div class="alert-level-tag alert-level-tag--high">{{security.eventSeverity}}</div>
|
||||
<div>{{security.sourceName}}</div>
|
||||
</div>
|
||||
<div class="row__desc"></div>
|
||||
@@ -180,7 +180,7 @@ import Chart from '@/views/charts/Chart'
|
||||
import _ from 'lodash'
|
||||
import { get } from '@/utils/http'
|
||||
import relatedServer from '@/mixins/relatedServer'
|
||||
import { getSecond } from '@/utils/date-util'
|
||||
import { getSecond, getMillisecond } from '@/utils/date-util'
|
||||
|
||||
export default {
|
||||
name: 'Ip',
|
||||
@@ -191,7 +191,6 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// entityData: {}
|
||||
entityType: 'ip',
|
||||
trafficUrl: api.entityIpDetailTraffic,
|
||||
trafficUrlMap: api.entityIpDetailTrafficMap,
|
||||
@@ -273,6 +272,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMillisecond,
|
||||
getQueryParams () {
|
||||
const queryParams = {
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
|
||||
@@ -213,8 +213,8 @@ export default {
|
||||
queryEntityDetailPerformance () {
|
||||
get(this.performanceUrl, this.getQueryParams()).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.entityData.alertNum = response.data.result.length
|
||||
this.entityData.alertList = response.data.result
|
||||
this.entityData.performanceNum = response.data.result.length
|
||||
this.entityData.performanceList = response.data.result
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user