diff --git a/src/views/detections/Index.vue b/src/views/detections/Index.vue index 4aefbdbe..95812ee6 100644 --- a/src/views/detections/Index.vue +++ b/src/views/detections/Index.vue @@ -421,27 +421,6 @@ export default { }, initEventTypeData (params) { getData(api.detection[this.pageType].eventType, params).then(data => { - /* data = [ - { - attackType: 'command and control', - count: 1048 - }, { - attackType: 'payload delivery', - count: 735 - }, { - attackType: 'cryptomining', - count: 580 - }, { - attackType: 'phishing', - count: 484 - }, { - attackType: 'dga', - count: 300 - }, { - attackType: 'ddos', - count: 50 - } - ] */ this.statisticsCategoryData = data if (!this.$_.isEmpty(data)) { this.filterData[this.pageType][1].data = data.map(r => ({ @@ -453,7 +432,7 @@ export default { const detectionChart = echarts.init(chartDom) const securityTypeOption = this.$_.cloneDeep(pieForSeverity) securityTypeOption.series[0].data = data.map(d => { - return { value: d.count, name: d.eventType, itemStyle: { color: getAttackColor(d.eventType) } } + return { value: d.count, name: d.eventType } }) detectionChart.setOption(securityTypeOption) } diff --git a/src/views/detections/options/detectionOptions.js b/src/views/detections/options/detectionOptions.js index 115c98da..42b2ab7d 100644 --- a/src/views/detections/options/detectionOptions.js +++ b/src/views/detections/options/detectionOptions.js @@ -18,6 +18,9 @@ export function getSeriesIndex (type) { return mapping && mapping.index ? _.cloneDeep(mapping.index) : null } +export const activeAttackColor = ['#51a9ee', '#49bcf2', '#4ad7eb', '#4cd4c8', + '#7acc7e', '#a7db69'] + const activeAttackColorMappings = [ { value: 'command and control', color: '#51a9ee' }, { value: 'payload delivery', color: '#49bcf2' }, @@ -149,7 +152,7 @@ export const pieForSeverity = { tooltip: { appendToBody: true }, - color: chartColor, + color: activeAttackColor, animation: false, legend: { orient: 'vertical', diff --git a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue index 09d87aa2..520b85e8 100644 --- a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue @@ -80,7 +80,7 @@ export default { queryBasic () { return new Promise((resolve, reject) => { try { - getData(api.detection.performanceEvent.overviewBasic, { serverIp: this.detection.appName }).then(data => { + getData(api.detection.performanceEvent.overviewBasic, { domain: this.detection.appName,startTime: this.detection.startTime }).then(data => { resolve(data[0]) }).catch(error => { reject(error) diff --git a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue index 7745936f..95f98b1a 100644 --- a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue @@ -84,7 +84,7 @@ export default { queryBasic () { return new Promise((resolve, reject) => { try { - getData(api.detection.performanceEvent.overviewBasic, { serverIp: this.detection.appName }).then(data => { + getData(api.detection.performanceEvent.overviewBasic, { appName: this.detection.appName,startTime: this.detection.startTime }).then(data => { resolve(data[0]) }).catch(error => { reject(error) diff --git a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue index 21120325..6f725e32 100644 --- a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue @@ -72,7 +72,7 @@ export default { queryBasic () { return new Promise((resolve, reject) => { try { - getData(api.detection.performanceEvent.overviewBasic, { serverIp: this.detection.serverIp }).then(data => { + getData(api.detection.performanceEvent.overviewBasic, { serverIp: this.detection.serverIp,startTime: this.detection.startTime }).then(data => { resolve(data[0]) }).catch(error => { reject(error) diff --git a/src/views/detections/overview/DetectionSecurityEventOverview.vue b/src/views/detections/overview/DetectionSecurityEventOverview.vue index 9aa6571b..123133c8 100644 --- a/src/views/detections/overview/DetectionSecurityEventOverview.vue +++ b/src/views/detections/overview/DetectionSecurityEventOverview.vue @@ -203,7 +203,7 @@ export default { queryBasic () { return new Promise((resolve, reject) => { try { - get(api.detection.securityEvent.overviewBasic, { eventId: this.detection.eventId }).then(response => { + get(api.detection.securityEvent.overviewBasic, { eventId: this.detection.eventId,startTime: this.detection.startTime }).then(response => { if (response.code === 200) { resolve(response.data.result[0]) } else {