@@ -37,7 +37,7 @@
:prop="item.prop"
#default="{row}">
- {{ nameColumn === 'domainCategoryName' ? row['categoryName'] :(nameColumn === 'domainReputationLevel'? row['reputationLevel']:(nameColumn==='appCategory'?row['appCategoryName']:row['appRiskLevel']))}}
+ {{ nameColumn === 'domainCategoryName' ? row['categoryName'] :(nameColumn === 'domainReputationLevel'? row['reputationLevel']:(nameColumn==='appCategory'?row['appCategoryName']:appRisk(row['appRiskLevel'])))}}
{{ tableNameColumn === 'appName' ? row['appName'] : row['domain']}}
@@ -65,7 +65,7 @@
:prop="item.prop"
#default="{row}">
- {{ nameColumn === 'domainCategoryName' ? row['categoryName'] :(nameColumn === 'domainReputationLevel'? row['reputationLevel']:(nameColumn==='appCategory'?row['appCategoryName']:row['appRiskLevel']))}}
+ {{ nameColumn === 'domainCategoryName' ? row['categoryName'] :(nameColumn === 'domainReputationLevel'? row['reputationLevel']:(nameColumn==='appCategory'?row['appCategoryName']:appRisk(row['appRiskLevel'])))}}
{{ tableNameColumn === 'appName' ? row['appName'] : row['domain']}}
@@ -87,7 +87,7 @@
import unitConvert from '@/utils/unit-convert'
import { get } from '@/utils/http'
import { replaceUrlPlaceholder } from '@/utils/tools'
-import { unitTypes } from '@/utils/constants'
+import { unitTypes, riskLevelMapping } from '@/utils/constants'
export default {
name: 'PieTable',
@@ -119,6 +119,16 @@ export default {
}
}
},
+ computed: {
+ appRisk () {
+ return function (level) {
+ const m = riskLevelMapping.find(mapping => {
+ return mapping.value == level
+ })
+ return (m && m.name) || level
+ }
+ }
+ },
data () {
return {
nameColumn: '',
@@ -133,7 +143,7 @@ export default {
width: '20%'
},
{
- label: this.$t('entities.category'),
+ label: this.$t(this.chartInfo.params.tableTypeColumnLabel),
prop: 'nameColumn',
width: '22%'
},
diff --git a/src/components/entities/EntityTop.vue b/src/components/entities/EntityTop.vue
index 1fb758e3..39ab0d64 100644
--- a/src/components/entities/EntityTop.vue
+++ b/src/components/entities/EntityTop.vue
@@ -81,9 +81,12 @@ export default {
this.entityTopTenData = data.map(d => {
return {
...d,
+ name: d.name || 'unknown',
percent: (parseFloat(d.count / totalCount) * 100).toFixed(2)
}
})
+ } else {
+ this.entityTopTenData = []
}
},
indexMethod (index) {
diff --git a/src/utils/api.js b/src/utils/api.js
index b7787f8a..1650dc65 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -42,6 +42,9 @@ export const api = {
// app detail
entityAppDetailTraffic: '/interface/entity/detail/overview/app/traffic',
entityAppDetailRelation: '/interface/entity/detail/overview/app/relation',
+ entityAppDetailNetworkQuantity: '/interface/entity/detail/overview/app/networkQuantity',
+ entityAppDetailLinkIn: '/interface/entity/detail/overview/app/linkIn',
+ entityAppDetailLinkOut: '/interface/entity/detail/overview/app/linkOut',
entityAppDetailAlert: '/interface/entity/detail/overview/app/alert',
entityAppDetailSecurity: '/interface/entity/detail/overview/app/security',
// domain detail
@@ -59,6 +62,9 @@ export const api = {
entityDomainDetailTrafficMap: '/interface/entity/detail/domain/trafficMap',
entityAppDetailTrafficMap: '/interface/entity/detail/app/trafficMap',
entityIpDetailRelation: '/interface/entity/detail/overview/ip/relation',
+ entityIpDetailNetworkQuantity: '/interface/entity/detail/overview/ip/networkQuantity',
+ entityIpDetailLinkIn: '/interface/entity/detail/overview/ip/linkIn',
+ entityIpDetailLinkOut: '/interface/entity/detail/overview/ip/linkOut',
entityIpDetailAlert: '/interface/entity/detail/overview/ip/alert',
entityIpDetailSecurity: '/interface/entity/detail/overview/ip/security'
}
diff --git a/src/utils/constants.js b/src/utils/constants.js
index 2176233a..54c69028 100644
--- a/src/utils/constants.js
+++ b/src/utils/constants.js
@@ -136,7 +136,13 @@ export const chartPieTableTopOptions = [
{ name: 'Packets', value: 'packets' },
{ name: 'Bytes', value: 'bytes' }
]
-
+export const riskLevelMapping = [
+ { name: 'Trustworthy', value: 1 },
+ { name: 'Low Risk', value: 2 },
+ { name: 'Moderate Risk', value: 3 },
+ { name: 'Suspicious', value: 4 },
+ { name: 'High Risk', value: 5 }
+]
export const iso36112 = {
[storageKey.iso36112Capital]: 'data/countriesWithCapital',
[storageKey.iso36112WorldLow]: 'worldChinaLow',
diff --git a/src/views/charts/charts/ChartEchartWithTable.vue b/src/views/charts/charts/ChartEchartWithTable.vue
index 8b33e07f..f0e61654 100644
--- a/src/views/charts/charts/ChartEchartWithTable.vue
+++ b/src/views/charts/charts/ChartEchartWithTable.vue
@@ -19,6 +19,7 @@ import { getUnitType } from '@/utils/unit-convert'
import { replaceUrlPlaceholder } from '@/utils/tools'
import { get } from '@/utils/http'
import chartEchartMixin from './chart-echart-mixin'
+import { riskLevelMapping } from '@/utils/constants'
export default {
name: 'ChartEchartWithTable',
@@ -38,7 +39,15 @@ export default {
components: {
PieTable
},
- mounted () {
+ computed: {
+ appRisk () {
+ return function (level) {
+ const m = riskLevelMapping.find(mapping => {
+ return mapping.value == level
+ })
+ return (m && m.name) || level
+ }
+ }
},
methods: {
handleQueryParams (queryParams) {
@@ -61,7 +70,7 @@ export default {
}
return {
data: d,
- name: d[chartParams.nameColumn],
+ name: this.appRisk(d[chartParams.nameColumn]),
value: parseInt(d[chartParams.valueColumn]),
unitType: unitType
}
diff --git a/src/views/entityExplorer/entityList/Card.vue b/src/views/entityExplorer/entityList/Card.vue
index e0e5b75c..656737d1 100644
--- a/src/views/entityExplorer/entityList/Card.vue
+++ b/src/views/entityExplorer/entityList/Card.vue
@@ -23,7 +23,7 @@
{{$t('entities.risk')}}:
- {{entityData.appRisk || '-'}}
+ {{appRisk(entityData.appRisk) || '-'}}
diff --git a/src/views/entityExplorer/entityList/Row.vue b/src/views/entityExplorer/entityList/Row.vue
index 809ffbd0..0a654915 100644
--- a/src/views/entityExplorer/entityList/Row.vue
+++ b/src/views/entityExplorer/entityList/Row.vue
@@ -49,17 +49,17 @@
{{$t('entities.category')}} :
- {{entityData.appId || '-'}}
+ {{entityData.appCategory || '-'}}
{{$t('entities.subcategory')}} :
- {{entityData.appCategory || '-'}}
+ {{entityData.appSubategory || '-'}}
{{$t('entities.risk')}} :
- {{entityData.appSubategory || '-'}}
+ {{appRisk(entityData.appRisk) || '-'}}
diff --git a/src/views/entityExplorer/entityList/detailOverview/App.vue b/src/views/entityExplorer/entityList/detailOverview/App.vue
index c7ec6673..fc6c91cd 100644
--- a/src/views/entityExplorer/entityList/detailOverview/App.vue
+++ b/src/views/entityExplorer/entityList/detailOverview/App.vue
@@ -63,6 +63,35 @@
+
+
{ setTimeout(() => { this.chartGetMap()}, 250)})
+ watch: {
+ entityData: {
+ immediate: true,
+ deep: true,
+ handler (n) {
+ this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency'))
+ this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency'))
+ this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency'))
+ this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent'))
+ this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent'))
+ }
+ }
+ },
+ mounted () {
+ this.$nextTick(() => { setTimeout(() => { this.chartGetMap() }, 250) })
},
setup (props) {
return {
diff --git a/src/views/entityExplorer/entityList/detailOverview/Domain.vue b/src/views/entityExplorer/entityList/detailOverview/Domain.vue
index 8487a5d2..4af40f47 100644
--- a/src/views/entityExplorer/entityList/detailOverview/Domain.vue
+++ b/src/views/entityExplorer/entityList/detailOverview/Domain.vue
@@ -160,7 +160,7 @@ import { unitTypes } from '@/utils/constants'
import unitConvert from '@/utils/unit-convert'
import Chart2 from '@/views/charts/Chart2'
import _ from 'lodash'
-import {get} from "@/utils/http";
+import { get } from '@/utils/http'
export default {
name: 'Domain',
components: {
@@ -170,7 +170,7 @@ export default {
mixins: [entityDetailMixin],
data () {
return {
- entityData: {},
+ // entityData: {},
entityType: 'domain',
trafficUrl: api.entityDomainDetailTraffic,
relationUrl: api.entityDomainDetailRelation,
@@ -211,7 +211,7 @@ export default {
{
params: {
icon: 'cn-icon cn-icon-package-loss',
- unitType: unitTypes.time
+ unitType: unitTypes.percent
},
type: 51,
i18n: 'entities.sequenceGapLossPercent'
@@ -219,10 +219,10 @@ export default {
{
params: {
icon: 'cn-icon cn-icon-upload',
- unitType: unitTypes.time
+ unitType: unitTypes.percent
},
type: 51,
- i18n: 'entities.avgRoundTripTime'
+ i18n: 'entities.pktRetransPercent'
}
],
chartDatas: [null, null, null, null, null]
@@ -255,17 +255,15 @@ export default {
immediate: true,
deep: true,
handler (n) {
- if ((n.pktRetransPercent && n.sequenceGapLossPercent && n.sslConLatency && n.establishLatency && n.httpResponseLatency) !== undefined) {
- this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency') || null)
- this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency') || null)
- this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency') || null)
- this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent') || null)
- this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent') || null)
- }
+ this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency'))
+ this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency'))
+ this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency'))
+ this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent'))
+ this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent'))
}
}
},
- mounted() {
+ mounted () {
this.$nextTick(() => { setTimeout(() => { this.chartGetMap()}, 250)})
},
setup (props) {
diff --git a/src/views/entityExplorer/entityList/detailOverview/Ip.vue b/src/views/entityExplorer/entityList/detailOverview/Ip.vue
index cb3875ac..29ee1a8f 100644
--- a/src/views/entityExplorer/entityList/detailOverview/Ip.vue
+++ b/src/views/entityExplorer/entityList/detailOverview/Ip.vue
@@ -55,6 +55,35 @@
+
+
import entityDetailMixin from './entityDetailMixin'
+import ChartSingleValue from '@/views/charts/charts/ChartSingleValue'
import { api } from '@/utils/api'
import { unitTypes } from '@/utils/constants'
import unitConvert from '@/utils/unit-convert'
import Chart2 from '@/views/charts/Chart2'
import _ from 'lodash'
-import {get} from "@/utils/http";
+import { get } from '@/utils/http'
export default {
name: 'Ip',
mixins: [entityDetailMixin],
components: {
- Chart2
+ Chart2,
+ ChartSingleValue
},
data () {
return {
@@ -129,10 +160,58 @@ export default {
trafficUrl: api.entityIpDetailTraffic,
trafficUrlMap: api.entityIpDetailTrafficMap,
relationUrl: api.entityIpDetailRelation,
+ networkQuantityUrl: api.entityIpDetailNetworkQuantity,
+ linkInUrl: api.entityIpDetailLinkIn,
+ linkOutUrl: api.entityIpDetailLinkOut,
alertUrl: api.entityIpDetailAlert,
securityUrl: api.entityIpDetailSecurity,
listMode: 'list',
- chartData: null
+ chartData: null,
+ singleValues: {
+ chartInfos: [
+ {
+ params: {
+ icon: 'cn-icon cn-icon-time',
+ unitType: unitTypes.time
+ },
+ type: 51,
+ i18n: 'entities.avgRoundTripTime'
+ },
+ {
+ params: {
+ icon: 'cn-icon cn-icon-http',
+ unitType: unitTypes.time
+ },
+ type: 51,
+ i18n: 'entities.httpResponseLatency'
+ },
+ {
+ params: {
+ icon: 'cn-icon cn-icon-ssl',
+ unitType: unitTypes.time
+ },
+ type: 51,
+ i18n: 'entities.sslConLatency'
+ },
+ {
+ params: {
+ icon: 'cn-icon cn-icon-package-loss',
+ unitType: unitTypes.percent
+ },
+ type: 51,
+ i18n: 'entities.sequenceGapLossPercent'
+ },
+ {
+ params: {
+ icon: 'cn-icon cn-icon-upload',
+ unitType: unitTypes.percent
+ },
+ type: 51,
+ i18n: 'entities.pktRetransPercent'
+ }
+ ],
+ chartDatas: [null, null, null, null, null]
+ }
}
},
methods: {
@@ -155,10 +234,23 @@ export default {
this.chartData = response.data.result
}
})
- },
+ }
},
- mounted() {
- this.$nextTick(() => { setTimeout(() => { this.chartGetMap()}, 250)})
+ watch: {
+ entityData: {
+ immediate: true,
+ deep: true,
+ handler (n) {
+ this.singleValues.chartDatas.splice(0, 1, this.$_.get(n, 'establishLatency'))
+ this.singleValues.chartDatas.splice(1, 1, this.$_.get(n, 'httpResponseLatency'))
+ this.singleValues.chartDatas.splice(2, 1, this.$_.get(n, 'sslConLatency'))
+ this.singleValues.chartDatas.splice(3, 1, this.$_.get(n, 'sequenceGapLossPercent'))
+ this.singleValues.chartDatas.splice(4, 1, this.$_.get(n, 'pktRetransPercent'))
+ }
+ }
+ },
+ mounted () {
+ this.$nextTick(() => { setTimeout(() => { this.chartGetMap() }, 250) })
},
setup (props) {
const entityCopy = {
diff --git a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js
index 14f673ce..64b53a07 100644
--- a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js
+++ b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js
@@ -160,10 +160,18 @@ export default {
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)
+ if (response.code === 200) {
+ if (!this.$_.isEmpty(response.data.result)) {
+ let sum = 0
+ response.data.result.forEach(r => {
+ sum += parseFloat(r.bytes)
+ })
+ const sorted = response.data.result.sort((r1, r2) => {
+ return parseFloat(r2.bytes) - parseFloat(r1.bytes)
+ })
+ const max = parseFloat(sorted[0].bytes)
+ this.entityData.linkOutPercent = (parseFloat(max / sum) * 100).toFixed(2)
+ }
}
})
}
@@ -192,11 +200,9 @@ export default {
this.queryEntityDetailRelation()
this.queryEntityDetailAlert()
this.queryEntityDetailSecurity()
- if (this.entityData.entityType === 'domain') {
- this.queryEntityDetailNetworkQuantity()
- this.queryEntityDetailLinkOutUrl()
- this.queryEntityDetailLinkInUrl()
- }
+ this.queryEntityDetailNetworkQuantity()
+ this.queryEntityDetailLinkOutUrl()
+ this.queryEntityDetailLinkInUrl()
}
},
setup () {
diff --git a/src/views/entityExplorer/entityList/entityListMixin.js b/src/views/entityExplorer/entityList/entityListMixin.js
index 237210d0..9da3a6ca 100644
--- a/src/views/entityExplorer/entityList/entityListMixin.js
+++ b/src/views/entityExplorer/entityList/entityListMixin.js
@@ -3,7 +3,7 @@ import { get } from '@/utils/http'
import { api } from '@/utils/api'
import * as echarts from 'echarts'
import { entityListLineOption } from '@/components/charts/chart-options'
-import { unitTypes } from '@/utils/constants'
+import {riskLevelMapping, unitTypes} from '@/utils/constants'
export default {
props: {
@@ -75,6 +75,14 @@ export default {
}
return url
},
+ appRisk () {
+ return function (level) {
+ const m = riskLevelMapping.find(mapping => {
+ return mapping.value == level
+ })
+ return (m && m.name) || level
+ }
+ },
queryParams () {
let params
const now = window.$dayJs.tz().valueOf()
diff --git a/src/views/entityExplorer/search/ExplorerSearch.vue b/src/views/entityExplorer/search/ExplorerSearch.vue
index d477ebc0..1233b2a4 100644
--- a/src/views/entityExplorer/search/ExplorerSearch.vue
+++ b/src/views/entityExplorer/search/ExplorerSearch.vue
@@ -187,12 +187,12 @@ export default {
},
{
name: 'app_risk',
- type: 'long',
+ type: 'string',
// label: this.$t('trafficSummary.appRisk')
label: 'APP risk'
}
],
- operatorList: ['=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE'],
+ operatorList: ['=', '!=', '>', '<', '>=', '<='/*, 'IN', 'NOT IN', 'LIKE', 'NOT LIKE'*/],
connectionList: [
{
value: 'AND',