CN-301 Detection-饼图、柱状图开发问题修改:
1.接口增加参数 2.饼图显示异常
This commit is contained in:
@@ -421,27 +421,6 @@ export default {
|
|||||||
},
|
},
|
||||||
initEventTypeData (params) {
|
initEventTypeData (params) {
|
||||||
getData(api.detection[this.pageType].eventType, params).then(data => {
|
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
|
this.statisticsCategoryData = data
|
||||||
if (!this.$_.isEmpty(data)) {
|
if (!this.$_.isEmpty(data)) {
|
||||||
this.filterData[this.pageType][1].data = data.map(r => ({
|
this.filterData[this.pageType][1].data = data.map(r => ({
|
||||||
@@ -453,7 +432,7 @@ export default {
|
|||||||
const detectionChart = echarts.init(chartDom)
|
const detectionChart = echarts.init(chartDom)
|
||||||
const securityTypeOption = this.$_.cloneDeep(pieForSeverity)
|
const securityTypeOption = this.$_.cloneDeep(pieForSeverity)
|
||||||
securityTypeOption.series[0].data = data.map(d => {
|
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)
|
detectionChart.setOption(securityTypeOption)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ export function getSeriesIndex (type) {
|
|||||||
return mapping && mapping.index ? _.cloneDeep(mapping.index) : null
|
return mapping && mapping.index ? _.cloneDeep(mapping.index) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const activeAttackColor = ['#51a9ee', '#49bcf2', '#4ad7eb', '#4cd4c8',
|
||||||
|
'#7acc7e', '#a7db69']
|
||||||
|
|
||||||
const activeAttackColorMappings = [
|
const activeAttackColorMappings = [
|
||||||
{ value: 'command and control', color: '#51a9ee' },
|
{ value: 'command and control', color: '#51a9ee' },
|
||||||
{ value: 'payload delivery', color: '#49bcf2' },
|
{ value: 'payload delivery', color: '#49bcf2' },
|
||||||
@@ -149,7 +152,7 @@ export const pieForSeverity = {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
appendToBody: true
|
appendToBody: true
|
||||||
},
|
},
|
||||||
color: chartColor,
|
color: activeAttackColor,
|
||||||
animation: false,
|
animation: false,
|
||||||
legend: {
|
legend: {
|
||||||
orient: 'vertical',
|
orient: 'vertical',
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export default {
|
|||||||
queryBasic () {
|
queryBasic () {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
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])
|
resolve(data[0])
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
queryBasic () {
|
queryBasic () {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
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])
|
resolve(data[0])
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
queryBasic () {
|
queryBasic () {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
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])
|
resolve(data[0])
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export default {
|
|||||||
queryBasic () {
|
queryBasic () {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
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) {
|
if (response.code === 200) {
|
||||||
resolve(response.data.result[0])
|
resolve(response.data.result[0])
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user