2022-02-14 17:40:29 +08:00
|
|
|
|
<template>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="entity-explorer entity-explorer--show-list"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!-- 顶部工具栏,在列表页显示 -->
|
|
|
|
|
|
<div class="explorer-top-tools">
|
|
|
|
|
|
<DateTimeRange class="date-time-range" :start-time="timeFilter.startTime" :end-time="timeFilter.endTime" ref="dateTimeRange" @change="reload"/>
|
|
|
|
|
|
<TimeRefresh class="date-time-range" @change="timeRefreshChange" :end-time="timeFilter.endTime"/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 搜索组件 -->
|
|
|
|
|
|
<detection-search
|
|
|
|
|
|
ref="search"
|
|
|
|
|
|
@search="search"
|
|
|
|
|
|
></detection-search>
|
|
|
|
|
|
<!-- 内容区 -->
|
|
|
|
|
|
<div class="explorer-container" style="height: calc(100% - 20px); flex-direction: column">
|
2022-02-25 15:16:07 +08:00
|
|
|
|
<div class="detection__event-severity-bar" :id="`eventSeverityTrendBar${pageType}`"></div>
|
2022-02-28 15:24:47 +08:00
|
|
|
|
<div style="display: flex; flex-grow: 1">
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<detection-filter
|
2022-02-25 13:33:54 +08:00
|
|
|
|
:filter-data="filterData[pageType]"
|
2022-02-14 22:22:31 +08:00
|
|
|
|
:q="q"
|
|
|
|
|
|
:time-filter="timeFilter"
|
|
|
|
|
|
@filter="filter"
|
|
|
|
|
|
></detection-filter>
|
2022-02-15 23:27:55 +08:00
|
|
|
|
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<div class="detection__list">
|
2022-02-17 19:28:48 +08:00
|
|
|
|
<div class="detection__list-statistics">
|
2022-02-21 10:52:14 +08:00
|
|
|
|
<div class="statistics__severity">
|
|
|
|
|
|
<div class="chart-header">
|
2022-02-17 19:28:48 +08:00
|
|
|
|
<div class="chart-header__title">{{$t('detection.severity')}}</div>
|
|
|
|
|
|
</div>
|
2022-02-25 15:16:07 +08:00
|
|
|
|
<div class="chart-content" :id="`eventSeverityPie${pageType}`">
|
2022-02-17 19:28:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-02-21 10:52:14 +08:00
|
|
|
|
<div class="statistics__category">
|
|
|
|
|
|
<div class="chart-header">
|
2022-02-17 19:28:48 +08:00
|
|
|
|
<div class="chart-header__title">{{$t('detection.categoryProportion')}}</div>
|
|
|
|
|
|
</div>
|
2022-02-25 15:16:07 +08:00
|
|
|
|
<div class="chart-content" :id="`detectionCategoryPer${pageType}`">
|
2022-02-17 19:28:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-02-21 10:52:14 +08:00
|
|
|
|
<div class="statistics__active-attack">
|
|
|
|
|
|
<div class="chart-header">
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="chart-header__title">{{pageType === detectionPageType.securityEvent ? $t('detection.activeAttacker') : $t('detections.activeEntity')}}</div>
|
2022-02-17 19:28:48 +08:00
|
|
|
|
</div>
|
2022-02-25 15:16:07 +08:00
|
|
|
|
<div class="chart-content" style="" :id="`detectionActiveAttacker${pageType}`">
|
2022-02-17 19:28:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<detection-list
|
|
|
|
|
|
:list-data="listData"
|
|
|
|
|
|
:pageObj="pageObj"
|
|
|
|
|
|
:time-filter="timeFilter"
|
2022-02-25 13:33:54 +08:00
|
|
|
|
:page-type="pageType"
|
2022-02-14 22:22:31 +08:00
|
|
|
|
@pageSize="pageSize"
|
|
|
|
|
|
@pageNo="pageNo"
|
|
|
|
|
|
:loading="listLoading"
|
|
|
|
|
|
></detection-list>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-02-21 10:52:14 +08:00
|
|
|
|
<div class="entity__pagination">
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<Pagination
|
|
|
|
|
|
ref="pagination"
|
|
|
|
|
|
:page-obj="pageObj"
|
|
|
|
|
|
@pageNo='pageNo'
|
|
|
|
|
|
@pageSize='pageSize'
|
|
|
|
|
|
@size-change="pageSize"
|
|
|
|
|
|
@prev-click="prev"
|
|
|
|
|
|
@next-click="next"
|
|
|
|
|
|
>
|
|
|
|
|
|
</Pagination>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-02-14 17:40:29 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
import DetectionSearch from '@/views/detections/DetectionSearch'
|
|
|
|
|
|
import DateTimeRange from '@/components/common/TimeRange/DateTimeRange'
|
|
|
|
|
|
import TimeRefresh from '@/components/common/TimeRange/TimeRefresh'
|
|
|
|
|
|
import DetectionFilter from '@/views/detections/DetectionFilter'
|
|
|
|
|
|
import DetectionList from '@/views/detections/DetectionList'
|
|
|
|
|
|
import Pagination from '@/components/common/Pagination'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
import { defaultPageSize, detectionPageType } from '@/utils/constants'
|
2022-02-21 10:52:14 +08:00
|
|
|
|
import { getNowTime, getSecond } from '@/utils/date-util'
|
2022-02-14 22:22:31 +08:00
|
|
|
|
import { ref } from 'vue'
|
2022-02-17 19:28:48 +08:00
|
|
|
|
import * as echarts from 'echarts'
|
2022-02-26 23:45:38 +08:00
|
|
|
|
import { multipleBarOption, pieForSeverity, activeAttackBar, getAttackColor, getSeverityColor, getSeriesIndex } from '@/views/detections/options/detectionOptions'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
import { api, getData } from '@/utils/api'
|
|
|
|
|
|
import { useRoute } from 'vue-router'
|
2022-02-17 19:28:48 +08:00
|
|
|
|
|
2022-02-14 17:40:29 +08:00
|
|
|
|
export default {
|
2022-02-14 22:22:31 +08:00
|
|
|
|
name: 'Index',
|
|
|
|
|
|
components: {
|
|
|
|
|
|
DetectionSearch,
|
|
|
|
|
|
DateTimeRange,
|
|
|
|
|
|
TimeRefresh,
|
|
|
|
|
|
DetectionFilter,
|
|
|
|
|
|
DetectionList,
|
2022-02-25 13:33:54 +08:00
|
|
|
|
Pagination
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
pageObj: {
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: defaultPageSize,
|
|
|
|
|
|
total: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
q: '',
|
2022-02-25 13:33:54 +08:00
|
|
|
|
detectionPageType,
|
|
|
|
|
|
filterData: {
|
|
|
|
|
|
securityEvent: [
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.eventSeverity'),
|
|
|
|
|
|
column: 'eventSeverity',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [], // value之间是or的关系
|
|
|
|
|
|
data: [] // 从接口动态获取,本项在获得数据后需要特殊处理左边框颜色
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.securityType'),
|
|
|
|
|
|
column: 'securityType',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [],
|
|
|
|
|
|
data: [] // 从接口动态获取
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.victimIp'),
|
|
|
|
|
|
column: 'victimIp',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [],
|
|
|
|
|
|
showMore: true,
|
|
|
|
|
|
showIndex: 9,
|
|
|
|
|
|
data: [] // 从接口动态获取
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.victimLocation'),
|
|
|
|
|
|
column: 'victimLocationCountry',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [],
|
|
|
|
|
|
showMore: false,
|
|
|
|
|
|
showIndex: 9,
|
|
|
|
|
|
data: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: 'China',
|
|
|
|
|
|
value: 'china',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
}
|
|
|
|
|
|
] // 从接口动态获取
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.offenderIp'),
|
|
|
|
|
|
column: 'offenderIp',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [],
|
|
|
|
|
|
showMore: false,
|
|
|
|
|
|
showIndex: 9,
|
|
|
|
|
|
data: [] // 从接口动态获取
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.offenderLocation'),
|
|
|
|
|
|
column: 'offenderLocationCountry',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [],
|
|
|
|
|
|
showMore: false,
|
|
|
|
|
|
showIndex: 9,
|
|
|
|
|
|
data: [] // 从接口动态获取
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
performanceEvent: [
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.eventSeverity'),
|
|
|
|
|
|
column: 'eventSeverity',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [], // value之间是or的关系
|
|
|
|
|
|
data: [] // 从接口动态获取,本项在获得数据后需要特殊处理左边框颜色
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: this.$t('detections.securityType'),
|
|
|
|
|
|
column: 'securityType',
|
|
|
|
|
|
collapse: false,
|
|
|
|
|
|
value: [],
|
|
|
|
|
|
data: [] // 从接口动态获取
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
2022-02-14 22:22:31 +08:00
|
|
|
|
listData: [],
|
2022-02-17 19:28:48 +08:00
|
|
|
|
listLoading: false,
|
2022-02-21 10:52:14 +08:00
|
|
|
|
eventSeverityData: [],
|
2022-02-17 19:28:48 +08:00
|
|
|
|
severityPerOption: null,
|
2022-02-21 10:52:14 +08:00
|
|
|
|
severityPerData: [],
|
2022-02-17 19:28:48 +08:00
|
|
|
|
categoryPerOption: null,
|
2022-02-21 10:52:14 +08:00
|
|
|
|
categoryPerData: [],
|
2022-02-17 19:28:48 +08:00
|
|
|
|
activeAttackOption: null,
|
2022-02-21 10:52:14 +08:00
|
|
|
|
activeAttackData: []
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
// 初始化顶部大柱状图
|
|
|
|
|
|
initEventSeverityTrendData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].eventSeverityTrend, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
2022-02-26 23:45:38 +08:00
|
|
|
|
legend: 'critical',
|
|
|
|
|
|
values: [[1435781430781, '5'], [1435781431781, '3'], [1435781432781, '5'], [1435781433781, '3']]
|
2022-02-25 13:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2022-02-26 23:45:38 +08:00
|
|
|
|
legend: 'high',
|
|
|
|
|
|
values: [[1435781430781, '2'], [1435781431781, '3'], [1435781432781, '6'], [1435781433781, '4']]
|
2022-02-25 13:33:54 +08:00
|
|
|
|
}, {
|
2022-02-26 23:45:38 +08:00
|
|
|
|
legend: 'medium',
|
|
|
|
|
|
values: [[1435781430781, '4'], [1435781431781, '1'], [1435781432781, '5'], [1435781433781, '3']]
|
2022-02-25 13:33:54 +08:00
|
|
|
|
}, {
|
2022-02-26 23:45:38 +08:00
|
|
|
|
legend: 'low',
|
|
|
|
|
|
values: [[1435781430781, '1'], [1435781431781, '4'], [1435781432781, '1'], [1435781433781, '3']]
|
2022-02-25 13:33:54 +08:00
|
|
|
|
}, {
|
2022-02-26 23:45:38 +08:00
|
|
|
|
legend: 'info',
|
|
|
|
|
|
values: [[1435781430781, '5'], [1435781431781, '7'], [1435781432781, '5'], [1435781433781, '8']]
|
2022-02-17 19:28:48 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 15:16:07 +08:00
|
|
|
|
const chartDom = document.getElementById(`eventSeverityTrendBar${this.pageType}`)
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const detectionChart = echarts.init(chartDom)
|
|
|
|
|
|
const eventSeverityTrendOption = this.$_.cloneDeep(multipleBarOption)
|
|
|
|
|
|
data.forEach(item => {
|
|
|
|
|
|
eventSeverityTrendOption.series[Number(getSeriesIndex(item.legend))].data = item.values.map(v => Number(v[1]))
|
|
|
|
|
|
})
|
|
|
|
|
|
eventSeverityTrendOption.xAxis.data = data[0].values.map(v => [window.$dayJs.tz(Number(v[0])).format('YYYY-MM-DD HH:mm:ss')])
|
2022-02-17 19:28:48 +08:00
|
|
|
|
this.$nextTick(() => {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
detectionChart.setOption(eventSeverityTrendOption)
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
2022-02-25 13:33:54 +08:00
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
// 初始化左侧事件严重等级和小饼图
|
|
|
|
|
|
initEventSeverityData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].eventSeverity, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
eventSeverity: 'critical',
|
|
|
|
|
|
count: 1048
|
|
|
|
|
|
}, {
|
|
|
|
|
|
eventSeverity: 'high',
|
|
|
|
|
|
count: 735
|
|
|
|
|
|
}, {
|
|
|
|
|
|
eventSeverity: 'medium',
|
|
|
|
|
|
count: 580
|
|
|
|
|
|
}, {
|
|
|
|
|
|
eventSeverity: 'low',
|
|
|
|
|
|
count: 484
|
|
|
|
|
|
}, {
|
|
|
|
|
|
eventSeverity: 'info',
|
|
|
|
|
|
count: 300
|
2022-02-17 19:28:48 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.filterData[this.pageType][0].data = data.map(r => ({ label: r.eventSeverity, value: r.eventSeverity, count: r.count }))
|
|
|
|
|
|
const eventSeverityOption = this.$_.cloneDeep(pieForSeverity)
|
|
|
|
|
|
eventSeverityOption.series[0].data = data.map(d => {
|
|
|
|
|
|
return { value: d.count, name: d.eventSeverity, itemStyle: { color: getSeverityColor(d.eventSeverity) } }
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
2022-02-25 15:16:07 +08:00
|
|
|
|
const chartDom = document.getElementById(`eventSeverityPie${this.pageType}`)
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const detectionChart = echarts.init(chartDom)
|
|
|
|
|
|
detectionChart.setOption(eventSeverityOption)
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
initSecurityTypeData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].securityType, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
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
|
2022-02-17 19:28:48 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.filterData[this.pageType][1].data = data.map(r => ({ label: r.attackType, value: r.attackType, count: r.count }))
|
2022-02-25 15:16:07 +08:00
|
|
|
|
const chartDom = document.getElementById(`detectionCategoryPer${this.pageType}`)
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const detectionChart = echarts.init(chartDom)
|
|
|
|
|
|
const securityTypeOption = this.$_.cloneDeep(pieForSeverity)
|
|
|
|
|
|
securityTypeOption.series[0].data = data.map(d => {
|
|
|
|
|
|
return { value: d.count, name: d.attackType, itemStyle: { color: getAttackColor(d.attackType) } }
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
2022-02-25 13:33:54 +08:00
|
|
|
|
detectionChart.setOption(securityTypeOption)
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
initOffenderIpData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].offenderIp, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
offenderIp: '192.168.12.21',
|
|
|
|
|
|
count: 99999
|
|
|
|
|
|
}, {
|
|
|
|
|
|
offenderIp: '192.168.22.21',
|
|
|
|
|
|
count: 88888
|
|
|
|
|
|
}, {
|
|
|
|
|
|
offenderIp: '192.168.32.21',
|
|
|
|
|
|
count: 77777
|
|
|
|
|
|
}, {
|
|
|
|
|
|
offenderIp: '192.168.42.21',
|
|
|
|
|
|
count: 66666
|
|
|
|
|
|
}, {
|
|
|
|
|
|
offenderIp: '192.168.52.21',
|
|
|
|
|
|
count: 55555
|
|
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.filterData[this.pageType][4].data = data.map(r => ({ label: r.offenderIp, value: r.offenderIp, count: r.count }))
|
|
|
|
|
|
const { showMore, showIndex } = this.computeFilterPage(this.filterData[this.pageType][4].data)
|
|
|
|
|
|
this.filterData[this.pageType][4].showMore = showMore
|
|
|
|
|
|
this.filterData[this.pageType][4].showIndex = showIndex
|
2022-02-17 19:28:48 +08:00
|
|
|
|
|
2022-02-25 15:16:07 +08:00
|
|
|
|
const chartDom = document.getElementById(`detectionActiveAttacker${this.pageType}`)
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const detectionChart = echarts.init(chartDom)
|
|
|
|
|
|
const offenderIpOption = this.$_.cloneDeep(activeAttackBar)
|
|
|
|
|
|
offenderIpOption.series[0].data = data.map(d => {
|
|
|
|
|
|
return [d.count, d.offenderIp]
|
|
|
|
|
|
}).reverse()
|
|
|
|
|
|
detectionChart.setOption(offenderIpOption)
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
initVictimIpData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].victimIp, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.8',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.9',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.0',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.1',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.2',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.3',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.4',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.5',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.6',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.7',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.7.8',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.8.8',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.9.8',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.18',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.28',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.38',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.48',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.58',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.68',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.78',
|
|
|
|
|
|
count: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
victimIp: '1.2.6.88',
|
|
|
|
|
|
count: 50
|
2022-02-17 19:28:48 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.filterData[this.pageType][2].data = data.map(r => ({ label: r.victimIp, value: r.victimIp, count: r.count }))
|
|
|
|
|
|
const { showMore, showIndex } = this.computeFilterPage(this.filterData[this.pageType][2].data)
|
|
|
|
|
|
this.filterData[this.pageType][2].showMore = showMore
|
|
|
|
|
|
this.filterData[this.pageType][2].showIndex = showIndex
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-17 19:28:48 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
initVictimLocationData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].victimLocation, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
victimLocationCountry: 'china',
|
|
|
|
|
|
count: 50
|
2022-02-21 10:52:14 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.filterData[this.pageType][3].data = data.map(r => ({ label: r.victimLocationCountry, value: r.victimLocationCountry, count: r.count }))
|
|
|
|
|
|
const { showMore, showIndex } = this.computeFilterPage(this.filterData[this.pageType][3].data)
|
|
|
|
|
|
this.filterData[this.pageType][3].showMore = showMore
|
|
|
|
|
|
this.filterData[this.pageType][3].showIndex = showIndex
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-18 18:09:44 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
initOffenderLocationData (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].offenderLocation, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
offenderLocationCountry: 'china',
|
|
|
|
|
|
count: 50
|
2022-02-21 10:52:14 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.filterData[this.pageType][5].data = data.map(r => ({ label: r.offenderLocationCountry, value: r.offenderLocationCountry, count: r.count }))
|
|
|
|
|
|
const { showMore, showIndex } = this.computeFilterPage(this.filterData[this.pageType][5].data)
|
|
|
|
|
|
this.filterData[this.pageType][5].showMore = showMore
|
|
|
|
|
|
this.filterData[this.pageType][5].showIndex = showIndex
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-18 18:09:44 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
initActiveEntity (params) {
|
|
|
|
|
|
getData(api.detection[this.pageType].activeEntity, params).then(data => {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: 'csdn.net',
|
|
|
|
|
|
count: 250
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'duokan',
|
|
|
|
|
|
count: 150
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '2.3.2.2',
|
|
|
|
|
|
count: 50
|
2022-02-21 10:52:14 +08:00
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 15:16:07 +08:00
|
|
|
|
const chartDom = document.getElementById(`detectionActiveAttacker${this.pageType}`)
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const detectionChart = echarts.init(chartDom)
|
|
|
|
|
|
const option = this.$_.cloneDeep(activeAttackBar)
|
|
|
|
|
|
option.series[0].data = data.map(d => {
|
|
|
|
|
|
return [d.count, d.name]
|
|
|
|
|
|
}).reverse()
|
|
|
|
|
|
detectionChart.setOption(option)
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-18 18:09:44 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-21 10:52:14 +08:00
|
|
|
|
computeFilterPage (data) {
|
|
|
|
|
|
return {
|
|
|
|
|
|
showMore: data.length > 10,
|
|
|
|
|
|
showIndex: 9
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-28 11:53:37 +08:00
|
|
|
|
queryList () {
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
startTime: getSecond(this.timeFilter.startTime),
|
|
|
|
|
|
endTime: getSecond(this.timeFilter.endTime),
|
|
|
|
|
|
q: this.q
|
|
|
|
|
|
}
|
2022-02-25 13:33:54 +08:00
|
|
|
|
getData(api.detection[this.pageType].listBasic, params).then(data => {
|
|
|
|
|
|
if (this.pageType === detectionPageType.securityEvent) {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'critical',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 978456923589
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'high',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'low',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'medium',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 600000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
malwareName: 'the great wall',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
eventId: 1212,
|
|
|
|
|
|
securityType: 'ddos',
|
|
|
|
|
|
offenderIp: '1.1.1.1',
|
|
|
|
|
|
victimIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
cryptominingPool: 'a',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-25 13:33:54 +08:00
|
|
|
|
} else if (this.pageType === detectionPageType.performanceEvent) {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
/*data = [
|
2022-02-25 13:33:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
entityType: 'ip',
|
|
|
|
|
|
eventType: 'Dns error',
|
|
|
|
|
|
serverIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'critical',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 978456923589
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'ip',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
serverIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'high',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'ip',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
serverIp: '2.2.2.2',
|
|
|
|
|
|
eventSecurity: 'low',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'domain',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
domain: 'csdn.net',
|
|
|
|
|
|
eventSecurity: 'medium',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'domain',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
domain: 'amazon.com',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'domain',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
domain: 'qiniu.com',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 600000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
entityType: 'app',
|
|
|
|
|
|
eventType: 'ddos',
|
|
|
|
|
|
appName: 'Samsung',
|
|
|
|
|
|
eventSecurity: 'info',
|
|
|
|
|
|
durationMs: 60000,
|
|
|
|
|
|
startTime: 1111111111
|
|
|
|
|
|
}
|
2022-02-28 11:53:37 +08:00
|
|
|
|
]*/
|
2022-02-18 17:54:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.listData = data
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
2022-02-18 17:54:22 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-02-14 22:22:31 +08:00
|
|
|
|
timeRefreshChange () {
|
|
|
|
|
|
if (!this.$refs.dateTimeRange.isCustom) {
|
|
|
|
|
|
const value = this.timeFilter.dateRangeValue
|
|
|
|
|
|
this.$refs.dateTimeRange.quickChange(value)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
reload (s, e, v) {
|
|
|
|
|
|
this.dateTimeRangeChange(s, e, v)
|
|
|
|
|
|
},
|
|
|
|
|
|
// methods
|
|
|
|
|
|
dateTimeRangeChange (s, e, v) {
|
|
|
|
|
|
this.timeFilter = { startTime: s, endTime: e, dateRangeValue: v }
|
|
|
|
|
|
},
|
2022-02-18 18:09:44 +08:00
|
|
|
|
search (metaList, formatSql) {
|
|
|
|
|
|
if (formatSql) {
|
|
|
|
|
|
this.q = formatSql
|
|
|
|
|
|
this.metaList = metaList
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.q = ''
|
|
|
|
|
|
this.metaList = []
|
|
|
|
|
|
}
|
|
|
|
|
|
this.queryFilter()
|
|
|
|
|
|
this.queryList()
|
|
|
|
|
|
this.queryListTotal()
|
|
|
|
|
|
},
|
|
|
|
|
|
queryFilter () {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const params = {
|
|
|
|
|
|
startTime: getSecond(this.timeFilter.startTime),
|
|
|
|
|
|
endTime: getSecond(this.timeFilter.endTime),
|
|
|
|
|
|
q: this.q
|
|
|
|
|
|
}
|
|
|
|
|
|
this.initEventSeverityTrendData(params)
|
|
|
|
|
|
this.initEventSeverityData(params)
|
|
|
|
|
|
this.initSecurityTypeData(params)
|
|
|
|
|
|
if (this.pageType === detectionPageType.securityEvent) {
|
|
|
|
|
|
this.initOffenderIpData(params)
|
|
|
|
|
|
this.initOffenderLocationData(params)
|
|
|
|
|
|
this.initVictimIpData(params)
|
|
|
|
|
|
this.initVictimLocationData(params)
|
|
|
|
|
|
} else if (this.pageType === detectionPageType.performanceEvent) {
|
|
|
|
|
|
this.initActiveEntity(params)
|
|
|
|
|
|
}
|
2022-02-18 18:09:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
queryListTotal () {
|
2022-02-14 17:40:29 +08:00
|
|
|
|
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
2022-02-18 10:07:43 +08:00
|
|
|
|
filter (filterColumn) {
|
|
|
|
|
|
const params = {}
|
2022-02-25 13:33:54 +08:00
|
|
|
|
params[filterColumn] = this.filterData[this.pageType].find(f => {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
return f.column === filterColumn
|
|
|
|
|
|
}).value
|
|
|
|
|
|
this.$refs.search.changeParams(params)
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
pageSize (val) {
|
|
|
|
|
|
this.pageObj.pageSize = val
|
|
|
|
|
|
this.search(this.metaList, this.q)
|
|
|
|
|
|
},
|
|
|
|
|
|
pageNo (val) {
|
|
|
|
|
|
this.pageObj.pageNo = val
|
|
|
|
|
|
this.search(this.metaList, this.q)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击上一页箭头
|
|
|
|
|
|
prev () {
|
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击下一页箭头
|
|
|
|
|
|
next () {
|
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
|
},
|
|
|
|
|
|
// currentPage 改变时会触发
|
|
|
|
|
|
current (val) {
|
|
|
|
|
|
this.$emit('pageNo', val)
|
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
|
},
|
|
|
|
|
|
scrollbarToTop () {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
const wraps = document.querySelector('#detectionList')
|
|
|
|
|
|
wraps.scrollTop = 0
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-17 19:28:48 +08:00
|
|
|
|
mounted () {
|
2022-02-21 10:52:14 +08:00
|
|
|
|
this.queryFilter()
|
|
|
|
|
|
this.queryList()
|
2022-02-17 19:28:48 +08:00
|
|
|
|
},
|
2022-02-14 22:22:31 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
timeFilter (n) {
|
|
|
|
|
|
this.search(this.metaList, this.q)
|
2022-02-18 10:07:43 +08:00
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
'filterData.securityEvent.0.value': {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.securityEvent[0].column, oldValue: o, newValue: n })
|
2022-02-18 10:07:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
'filterData.securityEvent.1.value': {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.securityEvent[1].column, oldValue: o, newValue: n })
|
2022-02-18 10:07:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
'filterData.securityEvent.2.value': {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.securityEvent[2].column, oldValue: o, newValue: n })
|
2022-02-18 10:07:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
'filterData.securityEvent.3.value': {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.securityEvent[3].column, oldValue: o, newValue: n })
|
2022-02-18 10:07:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
'filterData.securityEvent.4.value': {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.securityEvent[4].column, oldValue: o, newValue: n })
|
2022-02-18 10:07:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
'filterData.securityEvent.5.value': {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.securityEvent[5].column, oldValue: o, newValue: n })
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
'filterData.performanceEvent.0.value': {
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
|
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.performanceEvent[0].column, oldValue: o, newValue: n })
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
'filterData.performanceEvent.1.value': {
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n, o) {
|
|
|
|
|
|
this.$refs.search.changeParams({ column: this.filterData.performanceEvent[1].column, oldValue: o, newValue: n })
|
2022-02-18 10:07:43 +08:00
|
|
|
|
}
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
setup () {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
const { params } = useRoute()
|
|
|
|
|
|
const pageType = params.typeName
|
|
|
|
|
|
|
2022-02-14 22:22:31 +08:00
|
|
|
|
const dateRangeValue = 60
|
|
|
|
|
|
const { startTime, endTime } = getNowTime(dateRangeValue)
|
|
|
|
|
|
const timeFilter = ref({ startTime, endTime, dateRangeValue })
|
2022-02-25 13:33:54 +08:00
|
|
|
|
|
2022-02-14 22:22:31 +08:00
|
|
|
|
return {
|
2022-02-17 19:28:48 +08:00
|
|
|
|
timeFilter,
|
2022-02-25 13:33:54 +08:00
|
|
|
|
pageType
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|