CN-376 fix: 实体列表显示活跃数据
This commit is contained in:
@@ -154,14 +154,14 @@
|
||||
<div class="basic-info__item">
|
||||
<i class="cn-icon cn-icon-entity-alert"></i>
|
||||
<span>{{ $t('entities.recentAlert') }} : </span>
|
||||
<span>{{ entityData.alertCount || '-' }}</span>
|
||||
<span>{{ entityData.performanceCount}}</span>
|
||||
</div>
|
||||
<div class="basic-info__item">
|
||||
<i class="cn-icon cn-icon-safe"></i>
|
||||
<span
|
||||
>{{ $t('entities.recentSecurity') }} : </span
|
||||
>
|
||||
<span>{{ entityData.securityCount || '-' }}</span>
|
||||
<span>{{ entityData.securityCount}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -192,6 +192,7 @@ import _ from 'lodash'
|
||||
import ChartSingleValue from '@/views/charts/charts/ChartSingleValue'
|
||||
import { get } from '@/utils/http'
|
||||
import relatedServer from '@/mixins/relatedServer'
|
||||
import { getSecond } from '@/utils/date-util'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
@@ -209,7 +210,7 @@ export default {
|
||||
networkQuantityUrl: api.entityAppDetailNetworkQuantity,
|
||||
linkInUrl: api.entityAppDetailLinkIn,
|
||||
linkOutUrl: api.entityAppDetailLinkOut,
|
||||
alertUrl: api.entityAppDetailAlert,
|
||||
performanceUrl: api.entityIpDetailPerformance,
|
||||
securityUrl: api.entityAppDetailSecurity,
|
||||
trafficUrlMap: api.entityAppDetailTrafficMap,
|
||||
relatedServerDomainUrl: api.entityAppRelatedServerDomain,
|
||||
@@ -266,8 +267,8 @@ export default {
|
||||
methods: {
|
||||
getQueryParams () {
|
||||
const queryParams = {
|
||||
startTime: parseInt(this.timeFilter.startTime / 1000),
|
||||
endTime: parseInt(this.timeFilter.endTime / 1000),
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime),
|
||||
appName: this.entity.appName
|
||||
}
|
||||
return queryParams
|
||||
|
||||
@@ -196,6 +196,8 @@ 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'
|
||||
|
||||
export default {
|
||||
name: 'Domain',
|
||||
components: {
|
||||
@@ -212,7 +214,7 @@ export default {
|
||||
networkQuantityUrl: api.entityDomainDetailNetworkQuantity,
|
||||
linkInUrl: api.entityDomainDetailLinkIn,
|
||||
linkOutUrl: api.entityDomainDetailLinkOut,
|
||||
alertUrl: api.entityDomainDetailAlert,
|
||||
performanceUrl: api.entityDomainDetailPerformance,
|
||||
securityUrl: api.entityDomainDetailSecurity,
|
||||
trafficUrlMap: api.entityDomainDetailTrafficMap,
|
||||
relatedServerIpUrl: api.entityDomainRelatedServerIp,
|
||||
@@ -270,8 +272,8 @@ export default {
|
||||
methods: {
|
||||
getQueryParams () {
|
||||
const queryParams = {
|
||||
startTime: parseInt(this.timeFilter.startTime / 1000),
|
||||
endTime: parseInt(this.timeFilter.endTime / 1000),
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime),
|
||||
domain: this.entity.domainName
|
||||
}
|
||||
return queryParams
|
||||
|
||||
@@ -180,6 +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'
|
||||
|
||||
export default {
|
||||
name: 'Ip',
|
||||
@@ -198,7 +199,7 @@ export default {
|
||||
networkQuantityUrl: api.entityIpDetailNetworkQuantity,
|
||||
linkInUrl: api.entityIpDetailLinkIn,
|
||||
linkOutUrl: api.entityIpDetailLinkOut,
|
||||
alertUrl: api.entityIpDetailAlert,
|
||||
performanceUrl: api.entityIpDetailPerformance,
|
||||
securityUrl: api.entityIpDetailSecurity,
|
||||
relatedServerDomainUrl: api.entityIpRelatedServerDomain,
|
||||
relatedServerAppUrl: api.entityIpRelatedServerApp,
|
||||
@@ -274,8 +275,8 @@ export default {
|
||||
methods: {
|
||||
getQueryParams () {
|
||||
const queryParams = {
|
||||
startTime: parseInt(this.timeFilter.startTime / 1000),
|
||||
endTime: parseInt(this.timeFilter.endTime / 1000),
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime),
|
||||
ip: this.entity.ipAddr
|
||||
}
|
||||
return queryParams
|
||||
|
||||
@@ -210,8 +210,8 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
queryEntityDetailAlert () {
|
||||
get(this.alertUrl, this.getQueryParams()).then(response => {
|
||||
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
|
||||
@@ -230,8 +230,7 @@ export default {
|
||||
|
||||
queryEntityDetail () {
|
||||
this.queryEntityDetailTraffic()
|
||||
// this.queryEntityDetailRelation()
|
||||
this.queryEntityDetailAlert()
|
||||
this.queryEntityDetailPerformance()
|
||||
this.queryEntityDetailSecurity()
|
||||
this.queryEntityDetailNetworkQuantity()
|
||||
this.queryEntityDetailLinkOutUrl()
|
||||
|
||||
@@ -4,6 +4,7 @@ import { api } from '@/utils/api'
|
||||
import * as echarts from 'echarts'
|
||||
import { entityListLineOption } from '@/views/charts/charts/chart-options'
|
||||
import { riskLevelMapping, unitTypes } from '@/utils/constants'
|
||||
import { getSecond } from '@/utils/date-util'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -149,27 +150,61 @@ export default {
|
||||
},
|
||||
querySecurity () {
|
||||
const queryParams = {
|
||||
startTime: parseInt(this.timeFilter.startTime / 1000),
|
||||
endTime: parseInt(this.timeFilter.endTime / 1000),
|
||||
entityType: this.entityData.entityType,
|
||||
name: this.entityName
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime)
|
||||
}
|
||||
get(api.entitySecurityNum, queryParams).then(response => {
|
||||
let url
|
||||
switch (this.entityData.entityType) {
|
||||
case ('ip'): {
|
||||
url = api.entityIpDetailSecurity
|
||||
queryParams.ip = this.entityName
|
||||
break
|
||||
}
|
||||
case ('domain'): {
|
||||
url = api.entityDomainDetailSecurity
|
||||
queryParams.domain = this.entityName
|
||||
break
|
||||
}
|
||||
case ('app'): {
|
||||
url = api.entityAppDetailSecurity
|
||||
queryParams.appName = this.entityName
|
||||
break
|
||||
}
|
||||
default: break
|
||||
}
|
||||
get(url, queryParams).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.entityData.securityCount = response.data.result[0].count
|
||||
this.entityData.securityCount = response.data.result && response.data.result.length
|
||||
}
|
||||
})
|
||||
},
|
||||
queryAlert () {
|
||||
queryPerformance () {
|
||||
const queryParams = {
|
||||
startTime: parseInt(this.timeFilter.startTime / 1000),
|
||||
endTime: parseInt(this.timeFilter.endTime / 1000),
|
||||
entityType: this.entityData.entityType,
|
||||
name: this.entityName
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime)
|
||||
}
|
||||
get(api.entityAlertNum, queryParams).then(response => {
|
||||
let url
|
||||
switch (this.entityData.entityType) {
|
||||
case ('ip'): {
|
||||
url = api.entityIpDetailPerformance
|
||||
queryParams.ip = this.entityName
|
||||
break
|
||||
}
|
||||
case ('domain'): {
|
||||
url = api.entityDomainDetailPerformance
|
||||
queryParams.domain = this.entityName
|
||||
break
|
||||
}
|
||||
case ('app'): {
|
||||
url = api.entityAppDetailPerformance
|
||||
queryParams.appName = this.entityName
|
||||
break
|
||||
}
|
||||
default: break
|
||||
}
|
||||
get(url, queryParams).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.entityData.alertCount = response.data.result[0].value
|
||||
this.entityData.performanceCount = response.data.result && response.data.result.length
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -259,7 +294,7 @@ export default {
|
||||
this.entityData = _.cloneDeep(this.entity)
|
||||
setTimeout(() => { this.queryTraffic() })
|
||||
setTimeout(() => { this.querySecurity() })
|
||||
setTimeout(() => { this.queryAlert() })
|
||||
setTimeout(() => { this.queryPerformance() })
|
||||
if (this.listMode === 'block') {
|
||||
setTimeout(() => { this.queryTrafficLine() })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user