diff --git a/src/assets/css/components/views/entityExplorer/entityList/detailOverview.scss b/src/assets/css/components/views/entityExplorer/entityList/detailOverview.scss index 222a66d0..b7481062 100644 --- a/src/assets/css/components/views/entityExplorer/entityList/detailOverview.scss +++ b/src/assets/css/components/views/entityExplorer/entityList/detailOverview.scss @@ -83,6 +83,14 @@ padding-bottom: 0; } } + .row__charts-msg { + width:105px; + } + .row__charts { + height:20px; + width:60px; + padding-left:5px; + } } .row__desc { color: #666666; diff --git a/src/utils/api.js b/src/utils/api.js index 3901a9f3..6d7836ee 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -37,8 +37,26 @@ export const api = { entitySecurityNum: '/interface/entity/list/detectionNum', ipBytes: '/interface/entity/detail/ip/bytes', domainBytes: '/interface/entity/detail/domain/bytes', - appBytes: '/interface/entity/detail/app/bytes' - + appBytes: '/interface/entity/detail/app/bytes', + // app detail + entityAppDetailTraffic: '/interface/entity/detail/overview/app/traffic', + entityAppDetailRelation: '/interface/entity/detail/overview/app/relation', + entityAppDetailAlert: '/interface/entity/detail/overview/app/alert', + entityAppDetailSecurity: '/interface/entity/detail/overview/app/security', + // domain detail + entityDomainDetailBasic: '/interface/entity/detail/overview/domain/basic', + entityDomainDetailTraffic: '/interface/entity/detail/overview/domain/traffic', + entityDomainDetailRelation: '/interface/entity/detail/overview/domain/relation', + entityDomainDetailNetworkQuantity: '/interface/entity/detail/overview/domain/networkQuantity', + entityDomainDetailLinkIn: '/interface/entity/detail/overview/domain/linkIn', + entityDomainDetailLinkOut: '/interface/entity/detail/overview/domain/linkOut', + entityDomainDetailAlert: '/interface/entity/detail/overview/domain/alert', + entityDomainDetailSecurity: '/interface/entity/detail/overview/domain/security', + // ip detail + entityIpDetailTraffic: '/interface/entity/detail/overview/ip/traffic', + entityIpDetailRelation: '/interface/entity/detail/overview/ip/relation', + entityIpDetailAlert: '/interface/entity/detail/overview/ip/alert', + entityIpDetailSecurity: '/interface/entity/detail/overview/ip/security' } /* panel */ diff --git a/src/views/entityExplorer/entityList/EntityList.vue b/src/views/entityExplorer/entityList/EntityList.vue index b34381db..34c27898 100644 --- a/src/views/entityExplorer/entityList/EntityList.vue +++ b/src/views/entityExplorer/entityList/EntityList.vue @@ -26,6 +26,7 @@
APP ID
-
XXX
+
{{entityData.appId|| '-'}}
{{$t('entities.category')}}
-
XXX
+
{{entityData.appCategory|| '-'}}
{{$t('entities.subcategory')}}
-
XXX
+
{{entityData.appSubcategory || '-'}}
{{$t('entities.riskLevel')}}
-
XXX
+
{{entityData.appRisk || '-'}}
@@ -25,17 +25,25 @@
{{$t('overall.peak')}}
-
XXX
+
{{entityData.max}} Kb/s
{{$t('overall.mean')}}
-
XXX
+
{{entityData.avg}} Kb/s
{{$t('overall.throughput')}}
-
XXX
-
XXX
+
+
{{$t('overall.sent')}}:{{entityData.bytesSentRate}}bps
+ +
+
+
+
{{$t('overall.received')}}:{{entityData.bytesReceivedRate}}bps
+ +
+
@@ -45,11 +53,11 @@
- 5 + {{entityData.domainCount}} {{$t('entities.relatedDomains')}}
- 8 + {{entityData.ipCount}} {{$t('entities.relatedServerIp')}}
@@ -60,31 +68,15 @@
{{$t('entities.recentAlert')}}
-
30
+
{{entityData.alertNum || '-'}}
-
-
2011-11-15 12:23:34
+
+
{{alert.startTime}}
-
High
-
High RTT Times
+
{{alert.alertSeverity}}
+
{{alert.alertName}}
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Middle
-
High RTT Times
-
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Low
-
High RTT Times
-
-
中位数超出阈值
+
{{$t('overall.showMore')}}>>
@@ -96,31 +88,15 @@
{{$t('entities.recentSecurity')}}
-
20
+
{{entityData.securityNum || '-'}}
-
-
2011-11-15 12:23:34
+
+
{{security.startTime}}
-
High
-
High RTT Times
+
{{security.securitySeverity}}
+
{{security.sourceName}}
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Middle
-
High RTT Times
-
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Low
-
High RTT Times
-
-
中位数超出阈值
+
{{$t('overall.showMore')}}>>
@@ -130,7 +106,44 @@ diff --git a/src/views/entityExplorer/entityList/detailOverview/DetailOverview.vue b/src/views/entityExplorer/entityList/detailOverview/DetailOverview.vue index 84c2b5cb..9808f1b2 100644 --- a/src/views/entityExplorer/entityList/detailOverview/DetailOverview.vue +++ b/src/views/entityExplorer/entityList/detailOverview/DetailOverview.vue @@ -1,13 +1,13 @@ @@ -16,6 +16,7 @@ import App from './App' import Domain from './Domain' import Ip from './Ip' + export default { /* 详情概览 */ name: 'DetailOverview', diff --git a/src/views/entityExplorer/entityList/detailOverview/Domain.vue b/src/views/entityExplorer/entityList/detailOverview/Domain.vue index c85e13f9..2011b603 100644 --- a/src/views/entityExplorer/entityList/detailOverview/Domain.vue +++ b/src/views/entityExplorer/entityList/detailOverview/Domain.vue @@ -4,27 +4,27 @@
{{$t('entities.category')}}
-
XXX
+
{{entityData.domainCategory || '-'}}
{{$t('entities.domainDetail.categoryGroup')}}
-
XXX
+
{{entityData.domainCategoryGroup || '-'}}
{{$t('entities.reputationLevel')}}
-
XXX
+
{{entityData.domainReputationScore || '-'}}
{{$t('entities.registration')}}
-
China, Beijing
+
{{entityData.domainWhoisAddress || '-'}}
{{$t('entities.org')}}
-
XXX
+
{{entityData.domainWhoisOrg || '-'}}
{{$t('overall.remark')}}
-
XXX
+
{{entityData.domainDescription || '-'}}
@@ -33,17 +33,25 @@
{{$t('overall.peak')}}
-
XXX
+
{{entityData.max}} Kb/s
{{$t('overall.mean')}}
-
XXX
+
{{entityData.avg}} Kb/s
{{$t('overall.throughput')}}
-
XXX
-
XXX
+
+
{{$t('overall.sent')}}:{{entityData.bytesSentRate}}bps
+ +
+
+
+
{{$t('overall.received')}}:{{entityData.bytesReceivedRate}}bps
+ +
+
@@ -53,11 +61,11 @@
- 5 + {{entityData.appCount}} {{$t('entities.relatedApp')}}
- 8 + {{entityData.ipCount}} {{$t('entities.relatedServerIp')}}
@@ -69,7 +77,7 @@
{{$t('entities.avgRoundTripTime')}}
@@ -145,12 +153,12 @@
- 50% {{$t('entities.outLinkTrafficPercentage')}} + {{entityData.linkOutPercent?entityData.linkOutPercent+'%':'-'}}
- 80% {{$t('entities.inLinkTrafficPercentage')}} + {{entityData.linkInPercent?entityData.linkInPercent+'%':'-'}}
@@ -160,31 +168,15 @@
{{$t('entities.recentAlert')}}
-
30
+
{{entityData.alertNum || '-'}}
-
-
2011-11-15 12:23:34
+
+
{{alert.startTime}}
-
High
-
High RTT Times
+
{{alert.alertSeverity}}
+
{{alert.alertName}}
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Middle
-
High RTT Times
-
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Low
-
High RTT Times
-
-
中位数超出阈值
+
{{$t('overall.showMore')}}>>
@@ -196,31 +188,15 @@
{{$t('entities.recentSecurity')}}
-
20
+
{{entityData.securityNum || '-'}}
-
-
2011-11-15 12:23:34
+
+
{{security.startTime}}
-
High
-
High RTT Times
+
{{security.securitySeverity}}
+
{{security.sourceName}}
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Middle
-
High RTT Times
-
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Low
-
High RTT Times
-
-
中位数超出阈值
+
{{$t('overall.showMore')}}>>
@@ -231,10 +207,46 @@ diff --git a/src/views/entityExplorer/entityList/detailOverview/Ip.vue b/src/views/entityExplorer/entityList/detailOverview/Ip.vue index 77b44380..3c7e5262 100644 --- a/src/views/entityExplorer/entityList/detailOverview/Ip.vue +++ b/src/views/entityExplorer/entityList/detailOverview/Ip.vue @@ -4,11 +4,11 @@
{{$t('overall.location')}}
-
China, Beijing
+
{{entityData.ipLocationCountry || '-'}}
ASN
-
24537
+
{{entityData.ipAsn || '-'}}
@@ -17,17 +17,25 @@
{{$t('overall.peak')}}
-
XXX
+
{{entityData.max}} Kb/s
{{$t('overall.mean')}}
-
XXX
+
{{entityData.avg}} Kb/s
{{$t('overall.throughput')}}
-
XXX
-
XXX
+
+
{{$t('overall.sent')}}:{{entityData.bytesSentRate}}bps
+ +
+
+
+
{{$t('overall.received')}}:{{entityData.bytesReceivedRate}}bps
+ +
+
@@ -37,11 +45,11 @@
- 5 + {{entityData.domainCount}} {{$t('entities.relatedDomains')}}
- 8 + {{entityData.appCount}} {{$t('entities.relatedServerIp')}}
@@ -52,31 +60,15 @@
{{$t('entities.recentAlert')}}
-
30
+
{{entityData.alertNum || '-'}}
-
-
2011-11-15 12:23:34
+
+
{{alert.startTime}}
-
High
-
High RTT Times
+
{{alert.alertSeverity}}
+
{{alert.alertName}}
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Middle
-
High RTT Times
-
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Low
-
High RTT Times
-
-
中位数超出阈值
+
{{$t('overall.showMore')}}>>
@@ -88,31 +80,15 @@
{{$t('entities.recentSecurity')}}
-
20
+
{{entityData.securityNum || '-'}}
-
-
2011-11-15 12:23:34
+
+
{{security.startTime}}
-
High
-
High RTT Times
+
{{security.securitySeverity}}
+
{{security.sourceName}}
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Middle
-
High RTT Times
-
-
中位数超出阈值
-
-
-
2011-11-15 12:23:34
-
-
Low
-
High RTT Times
-
-
中位数超出阈值
+
{{$t('overall.showMore')}}>>
@@ -122,7 +98,37 @@ diff --git a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js new file mode 100644 index 00000000..9ed1e75d --- /dev/null +++ b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js @@ -0,0 +1,205 @@ +import _ from 'lodash' +import { get } from '@/utils/http' +import * as echarts from 'echarts' +import { entityListLineOption } from '@/components/charts/chart-options' +import { unitTypes } from '@/utils/constants' + +export default { + props: { + entity: Object + }, + data () { + return { + entityData: { + domainCount: 0, + appCount: 0, + ipCount: 0, + securityNum: 0, + alertNum: 0, + chartOptionSent: null, + chartOptionReceived: null, + chartOption: null, + sentChart: null, + receivedChart: null + } + } + }, + computed: { + entityName () { + let name + switch (this.entityData.entityType) { + case ('ip'): { + name = this.entity.ipAddr + break + } + case ('domain'): { + name = this.entity.domainName + break + } + case ('app'): { + name = this.entity.appName + break + } + default: break + } + return name + } + }, + methods: { + queryEntityDetailTraffic () { + this.sentChart = echarts.init(document.getElementById(`entityDetailSend${this.entityName}`)) + this.receivedChart = echarts.init(document.getElementById(`entityDetailReceived${this.entityName}`)) + get(this.trafficUrl, this.getQueryParams()).then(response => { + if (response.code === 200) { + response.data.result.forEach(t => { + if (t.legend === 'bytesRate') { + this.entityData.max = t.aggregation.max + this.entityData.avg = t.aggregation.avg + } else if (t.legend === 'bytesSentRate') { + this.entityData.bytesSentRate = t.aggregation.last + this.chartOptionSent = { + ...this.chartOption, + series: [ + { + name: this.$t('entities.sentThroughput'), + type: 'line', + legendHoverLink: false, + itemStyle: { + normal: { + lineStyle: { + width: 1 + } + } + }, + color: '#69b072', + data: t.values.map(v => [Number(v[0]) * 1000, Number(v[1]), unitTypes.byte]), + showSymbol: false + } + ] + } + } else if (t.legend === 'bytesReceivedRate') { + this.entityData.bytesReceivedRate = t.aggregation.last + this.chartOptionReceived = { + ...this.chartOption, + series: [ + { + name: this.$t('entities.receivedThroughput'), + type: 'line', + legendHoverLink: false, + itemStyle: { + normal: { + lineStyle: { + width: 1 + } + } + }, + color: '#7899c6', + data: t.values.map(v => [Number(v[0]) * 1000, Number(v[1]), unitTypes.byte]), + showSymbol: false + } + ] + } + } + }) + } + this.sentChart.setOption(this.chartOptionSent) + this.receivedChart.setOption(this.chartOptionReceived) + }).finally(() => { + setTimeout(() => { + this.$nextTick(() => { + this.sentChart && this.sentChart.resize() + this.receivedChart && this.receivedChart.resize() + }) + }, 250) + }) + }, + + queryEntityDetailRelation () { + get(this.relationUrl, this.getQueryParams()).then(response => { + if (response.code === 200) { + this.handleRelationData(response.data.result) + } + }) + }, + + queryEntityDetailNetworkQuantity () { + if (this.networkQuantityUrl) { + get(this.networkQuantityUrl, this.getQueryParams()).then(response => { + if (response.code === 200) { + this.entityData.establishLatency = response.data.result.establishLatency + this.entityData.httpResponseLatency = response.data.result.httpResponseLatency + this.entityData.sslConLatency = response.data.result.sslConLatency + this.entityData.sequenceGapLossPercent = response.data.result.sequenceGapLossPercent + this.entityData.pktRetransPercent = response.data.result.pktRetransPercent + } + }) + } + }, + + queryEntityDetailLinkInUrl () { + if (this.linkInUrl) { + get(this.linkInUrl, this.getQueryParams()).then(response => { + if (response.code === 200 && response.data.aggregation) { + const sum = response.data.aggregation.sum + const max = response.data.aggregation.max + this.entityData.linkInPercent = (parseFloat(max / sum) * 100).toFixed(2) + } + }) + } + }, + + queryEntityDetailLinkOutUrl () { + if (this.linkOutUrl) { + get(this.linkOutUrl, this.getQueryParams()).then(response => { + if (response.code === 200 && response.data.aggregation) { + const sum = response.data.aggregation.sum + const max = response.data.aggregation.max + this.entityData.linkOutPercent = (parseFloat(max / sum) * 100).toFixed(2) + } + }) + } + }, + + queryEntityDetailAlert () { + get(this.alertUrl, this.getQueryParams()).then(response => { + if (response.code === 200) { + this.entityData.alertNum = response.data.result.length + this.entityData.alertList = response.data.result + } + }) + }, + + queryEntityDetailSecurity () { + get(this.securityUrl, this.getQueryParams()).then(response => { + if (response.code === 200) { + this.entityData.securityNum = response.data.result.length + this.entityData.securityList = response.data.result + } + }) + }, + + queryEntityDetail () { + this.queryEntityDetailTraffic() + this.queryEntityDetailRelation() + this.queryEntityDetailAlert() + this.queryEntityDetailSecurity() + if (this.entityData.entityType === 'domain') { + this.queryEntityDetailNetworkQuantity() + this.queryEntityDetailLinkOutUrl() + this.queryEntityDetailLinkInUrl() + } + } + }, + setup () { + return { + chartOption: entityListLineOption + } + }, + mounted () { + if (this.listMode === 'list') { + this.entityData = _.cloneDeep(this.entity) + this.chartOption = _.cloneDeep(entityListLineOption) + setTimeout(() => { this.queryEntityDetail() }) + } + } +} diff --git a/src/views/entityExplorer/entityList/entityListMixin.js b/src/views/entityExplorer/entityList/entityListMixin.js index ed1686bd..c5e18467 100644 --- a/src/views/entityExplorer/entityList/entityListMixin.js +++ b/src/views/entityExplorer/entityList/entityListMixin.js @@ -85,7 +85,7 @@ export default { startTime: Math.floor(now.getTime() / 1000 - 3600), endTime: Math.floor(now.getTime() / 1000) }, - ip: this.entityData.ipAddr + ip: this.entityData.ip } break } @@ -142,7 +142,7 @@ export default { queryAlert () { get(api.entityAlertNum, { entityType: this.entityData.entityType, name: this.entityName }).then(response => { if (response.code === 200) { - this.entityData.securityCount = response.data.result[0].value + this.entityData.alertCount = response.data.result[0].value } }) },