2022-02-14 22:22:31 +08:00
|
|
|
|
<template>
|
2022-11-09 15:42:36 +08:00
|
|
|
|
<div class="cn-detection--list" :style="{zIndex: !isCollapse ? 5 : 'unset'}">
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<!-- 左侧下拉按钮 -->
|
2022-11-15 18:33:07 +08:00
|
|
|
|
<div class="cn-detection__collapse">
|
|
|
|
|
|
<div class="cn-detection__collapse-block" @click="switchCollapse">
|
|
|
|
|
|
<span :class="{'reg-down': !isCollapse}">
|
2022-11-07 15:25:00 +08:00
|
|
|
|
<i class="cn-icon cn-icon-arrow-right"></i>
|
|
|
|
|
|
</span>
|
2022-11-15 18:33:07 +08:00
|
|
|
|
</div>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
</div>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<div class="cn-detection__case">
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="cn-detection__icon" :style="`background-color: ${eventSeverityColor[detection.eventSecurity]}`"></div>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<div class="cn-detection__row">
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="cn-detection__header" v-if="pageType === detectionPageType.securityEvent">
|
2022-11-07 15:25:00 +08:00
|
|
|
|
<span
|
|
|
|
|
|
class="detection-event-severity-color-block"
|
|
|
|
|
|
:style="`background-color: ${eventSeverityColor[detection.eventSeverity]}`">
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="detection-event-severity-block">{{ detection.securityType || '-' }}</span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<i class="cn-icon cn-icon-attacker" ></i>{{detection.offenderIp || '-'}}
|
2022-03-24 16:46:05 +08:00
|
|
|
|
<div v-if="detection.domain" class="domain">{{detection.domain}}</div>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<span class="line">-------</span>
|
|
|
|
|
|
<span class="circle"></span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<i class="cn-icon cn-icon-attacked" ></i>{{detection.victimIp || '-'}}
|
2022-02-18 17:54:22 +08:00
|
|
|
|
</div>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="cn-detection__header" v-else-if="pageType === detectionPageType.performanceEvent">
|
|
|
|
|
|
<div class="cn-entity__icon"><i :class="iconClass"></i></div>
|
|
|
|
|
|
<div style="padding-left: 3px;">{{detection.serverIp || detection.domain || detection.appName || 'Unknown'}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="cn-detection__body">
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<div class="body__basic-info">
|
|
|
|
|
|
<div class="basic-info">
|
2022-02-28 16:10:45 +08:00
|
|
|
|
<div class="basic-info__item" v-if="detection.eventSecurity">
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<i class="cn-icon cn-icon-severity-level"></i>
|
|
|
|
|
|
<span>{{$t('detection.list.eventSecurity')}} : </span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<span>{{detection.eventSecurity || '-'}}</span>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
</div>
|
2022-02-28 16:10:45 +08:00
|
|
|
|
<div class="basic-info__item" v-if="detection.eventSeverity">
|
|
|
|
|
|
<i class="cn-icon cn-icon-severity-level"></i>
|
|
|
|
|
|
<span>{{$t('detections.eventSeverity')}} : </span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<span>{{detection.eventSeverity || '-'}}</span>
|
2022-02-28 16:10:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="basic-info__item" v-if="detection.eventType">
|
|
|
|
|
|
<i class="cn-icon cn-icon-event-type"></i>
|
|
|
|
|
|
<span>{{$t('detections.eventType')}} : </span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<span>{{detection.eventType || '-'}}</span>
|
2022-02-28 16:10:45 +08:00
|
|
|
|
</div>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="basic-info__item" v-if="detection.malwareName">
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<i class="cn-icon cn-icon-trojan"></i>
|
|
|
|
|
|
<span>{{$t('detection.list.malwareName')}} : </span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<span>{{detection.malwareName || '-'}}</span>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
</div>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="basic-info__item" v-if="detection.cryptominingPool">
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<i class="cn-icon cn-icon-mining-pool"></i>
|
|
|
|
|
|
<span>{{$t('detection.list.cryptominingPool')}} : </span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<span>{{detection.cryptominingPool || '-'}}</span>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="basic-info__item">
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<i class="cn-icon cn-icon-time2"></i>
|
|
|
|
|
|
<span>{{$t('detection.list.startTime')}} : </span>
|
2022-04-28 18:11:49 +08:00
|
|
|
|
<span>{{dateFormatByAppearance(detection.startTime) || '-'}}</span>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
</div>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<div class="basic-info__item">
|
|
|
|
|
|
<i class="cn-icon cn-icon-time2"></i>
|
|
|
|
|
|
<span>{{$t('overall.duration')}} : </span>
|
|
|
|
|
|
<span style="display: inline-block;height: 6px;width: 6px;border-radius: 50%;margin-right: 8px;"
|
|
|
|
|
|
:style="pointColor(detection)"></span>
|
2022-03-08 22:38:43 +08:00
|
|
|
|
<span>{{unitConvert(detection.durationMs, 'time', null, null, 0).join(' ') || '-'}}</span>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
</div>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-collapse-transition>
|
2022-02-18 17:54:22 +08:00
|
|
|
|
<div class="cn-detection__detail-overview" v-if="!isCollapse">
|
2022-02-14 22:22:31 +08:00
|
|
|
|
<el-divider></el-divider>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
<detection-security-event-overview
|
|
|
|
|
|
v-if="pageType === detectionPageType.securityEvent"
|
2022-02-22 15:59:30 +08:00
|
|
|
|
:detection="detection"
|
2022-02-14 22:22:31 +08:00
|
|
|
|
:time-filter="timeFilter"
|
2022-02-25 13:33:54 +08:00
|
|
|
|
></detection-security-event-overview>
|
|
|
|
|
|
<template v-else>
|
|
|
|
|
|
<detection-performance-event-ip-overview
|
|
|
|
|
|
v-if="detection.entityType === entityType.ip.toLowerCase()"
|
|
|
|
|
|
:detection="detection"
|
|
|
|
|
|
:time-filter="timeFilter"
|
|
|
|
|
|
></detection-performance-event-ip-overview>
|
|
|
|
|
|
<detection-performance-event-domain-overview
|
|
|
|
|
|
v-else-if="detection.entityType === entityType.domain.toLowerCase()"
|
|
|
|
|
|
:detection="detection"
|
|
|
|
|
|
:time-filter="timeFilter"
|
|
|
|
|
|
></detection-performance-event-domain-overview>
|
|
|
|
|
|
<detection-performance-event-app-overview
|
|
|
|
|
|
v-else-if="detection.entityType === entityType.app.toLowerCase()"
|
|
|
|
|
|
:detection="detection"
|
|
|
|
|
|
:time-filter="timeFilter"
|
|
|
|
|
|
></detection-performance-event-app-overview>
|
|
|
|
|
|
</template>
|
2022-02-14 22:22:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse-transition>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-02-25 13:33:54 +08:00
|
|
|
|
import { eventSeverityColor, detectionPageType, entityType } from '@/utils/constants'
|
2022-02-22 22:22:15 +08:00
|
|
|
|
import { getMillisecond } from '@/utils/date-util'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
import unitConvert from '@/utils/unit-convert'
|
|
|
|
|
|
import DetectionSecurityEventOverview from '@/views/detections/overview/DetectionSecurityEventOverview'
|
|
|
|
|
|
import DetectionPerformanceEventIpOverview from '@/views/detections/overview/DetectionPerformanceEventIpOverview'
|
|
|
|
|
|
import DetectionPerformanceEventAppOverview from '@/views/detections/overview/DetectionPerformanceEventAppOverview'
|
|
|
|
|
|
import DetectionPerformanceEventDomainOverview from '@/views/detections/overview/DetectionPerformanceEventDomainOverview'
|
2023-01-06 18:03:45 +08:00
|
|
|
|
import { overwriteUrl, urlParamsHandler } from '@/utils/tools'
|
2022-02-14 22:22:31 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'DetectionRow',
|
|
|
|
|
|
components: {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
DetectionSecurityEventOverview,
|
|
|
|
|
|
DetectionPerformanceEventIpOverview,
|
|
|
|
|
|
DetectionPerformanceEventAppOverview,
|
|
|
|
|
|
DetectionPerformanceEventDomainOverview
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
|
|
|
index: Number,
|
2022-02-18 17:54:22 +08:00
|
|
|
|
timeFilter: Object,
|
2022-02-25 13:33:54 +08:00
|
|
|
|
detection: Object,
|
|
|
|
|
|
pageType: String // 安全事件、服务质量
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
entityType,
|
|
|
|
|
|
detectionPageType,
|
2023-01-06 18:03:45 +08:00
|
|
|
|
isCollapse: true, // 是否是折叠状态, true为折叠,false为展开
|
2022-11-15 18:33:07 +08:00
|
|
|
|
eventSeverityColor
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-01-06 18:03:45 +08:00
|
|
|
|
mounted () {
|
2023-01-18 14:42:12 +08:00
|
|
|
|
this.initExpendTab()
|
2023-01-06 18:03:45 +08:00
|
|
|
|
},
|
2022-02-25 13:33:54 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
iconClass () {
|
|
|
|
|
|
let className
|
|
|
|
|
|
switch (this.detection.entityType) {
|
|
|
|
|
|
case ('ip'): {
|
2022-03-18 17:42:02 +08:00
|
|
|
|
className = 'cn-icon cn-icon-ip2'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
case ('domain'): {
|
2022-03-18 17:42:02 +08:00
|
|
|
|
className = 'cn-icon cn-icon-domain2'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
case ('app'): {
|
2022-03-18 17:42:02 +08:00
|
|
|
|
className = 'cn-icon cn-icon-app2'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
default:
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
return className
|
|
|
|
|
|
},
|
|
|
|
|
|
pointColor () {
|
|
|
|
|
|
return function (detection) {
|
|
|
|
|
|
let color = '#8FA1BE'
|
|
|
|
|
|
if (detection.startTime && detection.endTime) {
|
|
|
|
|
|
if (getMillisecond(detection.endTime) - getMillisecond(detection.startTime) < 5 * 60 * 1000) {
|
|
|
|
|
|
color = '#D84C4C'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return { backgroundColor: color }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-02-14 22:22:31 +08:00
|
|
|
|
methods: {
|
2022-02-25 13:33:54 +08:00
|
|
|
|
unitConvert,
|
2022-02-22 22:22:15 +08:00
|
|
|
|
getMillisecond,
|
2022-02-14 22:22:31 +08:00
|
|
|
|
/* 切换折叠状态 */
|
|
|
|
|
|
switchCollapse () {
|
|
|
|
|
|
this.isCollapse = !this.isCollapse
|
|
|
|
|
|
this.$emit('switchCollapse', this.isCollapse, this.index)
|
2023-01-06 18:03:45 +08:00
|
|
|
|
|
|
|
|
|
|
if (this.isCollapse) {
|
2023-01-18 14:42:12 +08:00
|
|
|
|
const newQuery = this.$route.query
|
2023-01-06 18:03:45 +08:00
|
|
|
|
delete newQuery.eventId
|
|
|
|
|
|
this.reloadUrl(newQuery, 'cleanOldParams')
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.reloadUrl({ eventId: this.detection.eventId })
|
|
|
|
|
|
}
|
2022-02-14 22:22:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
/* 设为折叠状态 */
|
|
|
|
|
|
collapse () {
|
|
|
|
|
|
this.isCollapse = true
|
2023-01-06 18:03:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 向地址栏添加/删除参数
|
|
|
|
|
|
*/
|
|
|
|
|
|
reloadUrl (newParam, clean) {
|
|
|
|
|
|
const { query } = this.$route
|
|
|
|
|
|
let newUrl = urlParamsHandler(window.location.href, query, newParam)
|
|
|
|
|
|
if (clean) {
|
|
|
|
|
|
newUrl = urlParamsHandler(window.location.href, query, newParam, clean)
|
|
|
|
|
|
}
|
|
|
|
|
|
overwriteUrl(newUrl)
|
2023-01-18 14:42:12 +08:00
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 初始化从npm跳转过来的id,并展开tab
|
|
|
|
|
|
*/
|
|
|
|
|
|
initExpendTab () {
|
|
|
|
|
|
if (this.$route.query.eventId) {
|
2023-02-07 10:29:27 +08:00
|
|
|
|
if (this.$route.query.eventId === this.detection.eventId) {
|
2023-01-18 14:42:12 +08:00
|
|
|
|
const container = document.getElementById('cnContainer')
|
|
|
|
|
|
const dom = document.getElementsByClassName('cn-detection__case')
|
|
|
|
|
|
// 未展开的item折叠块,高度67+下边距10+底部线高度1,兼容不同分辨率下的tab高度
|
|
|
|
|
|
let itemHeight = 78
|
|
|
|
|
|
if (dom && this.index > 0) {
|
|
|
|
|
|
itemHeight = dom[0].clientHeight + 11
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let topHeight = 554 + this.index * itemHeight
|
|
|
|
|
|
// 经过测试对比,第7个以后的tab会往上移动,但是手动展开和自动展开tab的滚动条高度一致,为解决该问题,自动加上误差值
|
|
|
|
|
|
if (this.index > 6) {
|
|
|
|
|
|
topHeight = topHeight + 6
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
container.scrollTop = topHeight
|
|
|
|
|
|
|
|
|
|
|
|
this.isCollapse = false
|
|
|
|
|
|
this.$emit('switchCollapse', this.isCollapse, this.index)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-02-14 22:22:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|