diff --git a/src/mock/entity.js b/src/mock/entity.js index 3fa37c1b..254fcda2 100644 --- a/src/mock/entity.js +++ b/src/mock/entity.js @@ -76,7 +76,7 @@ if (openMock) { victimIp: '116.178.217.92', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Critical', + eventSeverity: 'critical', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -91,7 +91,7 @@ if (openMock) { victimIp: '116.178.217.93', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Low', + eventSeverity: 'low', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -106,7 +106,7 @@ if (openMock) { victimIp: '116.178.217.93', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Low', + eventSeverity: 'low', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -121,7 +121,7 @@ if (openMock) { victimIp: '116.178.217.93', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Low', + eventSeverity: 'low', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -136,7 +136,7 @@ if (openMock) { victimIp: '116.178.217.93', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Low', + eventSeverity: 'low', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -151,7 +151,7 @@ if (openMock) { victimIp: '116.178.217.93', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Low', + eventSeverity: 'low', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -166,7 +166,7 @@ if (openMock) { victimIp: '116.178.217.93', offenderDomain: 'baidu.com', victimDomain: 'mi.com', - eventSeverity: 'Low', + eventSeverity: 'low', malwareName: 'NetWire RC', cryptominingPool: null, startTime: 1683186600, @@ -191,7 +191,7 @@ if (openMock) { serverIp: '116.178.78.180', domain: null, appName: null, - eventSeverity: 'Critical', + eventSeverity: 'critical', eventType: 'Http error', startTime: 1683250500, durationMs: 900000, @@ -203,7 +203,7 @@ if (openMock) { serverIp: '116.178.78.180', domain: null, appName: null, - eventSeverity: 'Info', + eventSeverity: 'info', eventType: 'Http error', startTime: 1683250500, durationMs: 900000, @@ -289,7 +289,7 @@ if (openMock) { data: result } }) - Mock.mock(new RegExp(`${BASE_CONFIG.baseUrl}${BASE_CONFIG.apiVersion}/entity/kb/intelligence/list.*`), 'get', function (requestObj) { + Mock.mock(new RegExp(`${BASE_CONFIG.baseUrl}${BASE_CONFIG.apiVersion}/entity/detail/kb/intelligence/list.*`), 'get', function (requestObj) { const result = [ { location: { diff --git a/src/utils/api.js b/src/utils/api.js index b23f72c4..53dea2f8 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -241,7 +241,7 @@ export const api = { openPort: '', basicInfo: BASE_CONFIG.apiVersion + '/entity/detail/basic', tags: BASE_CONFIG.apiVersion + '/entity/detail/kb/intelligence/tag', - informationAggregation: BASE_CONFIG.apiVersion + '/entity/kb/intelligence/list' + informationAggregation: BASE_CONFIG.apiVersion + '/entity/detail/kb/intelligence/list' } } diff --git a/src/utils/tools.js b/src/utils/tools.js index 0606d2e3..384f6b2c 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -1271,3 +1271,15 @@ export function copySelectionText () { } return copySuccess } + +/** + * 字符串首字母转大写 + * @param str + * @returns {*} + */ +export function toUpperCaseByString (str) { + if (str) { + str = str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase() + } + return str +} diff --git a/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue b/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue index bf88b995..43d6490f 100644 --- a/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue +++ b/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue @@ -76,10 +76,10 @@ > @@ -94,6 +94,7 @@ import axios from 'axios' import { api } from '@/utils/api' import { entityDetailTags } from '@/utils/constants' import { dateFormatByAppearance } from '@/utils/date-util' +import chartNoData from '@/views/charts/charts/ChartNoData' export default { name: 'InformationAggregation', @@ -103,6 +104,7 @@ export default { } }, mixins: [chartMixin], + components: { chartNoData }, methods: { dateFormatByAppearance, intelligenceContentClass ({ row, column, rowIndex, columnIndex }) { @@ -116,6 +118,8 @@ export default { axios.get(`${api.entity.informationAggregation}/${this.entity.entityType}?resource=${this.entity.entityName}&pageSize=100&pageNo=1`).then(response => { const res = response.data if (res.code === 200) { + this.isNoData = res.data.result.length === 0 + this.showError = false res.data.result.forEach(r => { Object.keys(r).forEach(k => { const aggregation = { @@ -141,11 +145,13 @@ export default { }) } else { this.showError = true + this.isNoData = false this.errorMsg = this.errorMsgHandler(res) } }).catch(e => { console.error(e) this.showError = true + this.isNoData = false this.errorMsg = this.errorMsgHandler(e) }).finally(() => { this.toggleLoading(false) diff --git a/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue b/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue index ba278a1c..79e12f7a 100644 --- a/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue +++ b/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue @@ -9,15 +9,15 @@ :key="item.eventId">
-
+
+ :style="`background-color: ${eventSeverityColor[item.eventSeverity]}`"> - {{ item.eventType || '-' }} + {{ toUpperCaseByString(item.eventType) || '-' }}
@@ -25,7 +25,7 @@
{{ $t('network.severity') }} :   - {{ item.eventSeverity || '-' }} + {{ toUpperCaseByString(item.eventSeverity) || '-' }}
@@ -49,24 +49,26 @@