fix: 完善detection下拉详情的地址信息,修复相关事件的时间显示异常问题,修复搜索初始化一直为text模式问题
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
ref="search"
|
ref="search"
|
||||||
:column-list="columnList[pageType]"
|
:column-list="columnList[pageType]"
|
||||||
:connection-list="connectionList"
|
:connection-list="connectionList"
|
||||||
|
:default-mode="defaultMode"
|
||||||
class="advanced-search--show-list"
|
class="advanced-search--show-list"
|
||||||
:full-text="true"
|
:full-text="true"
|
||||||
:show-list="showList"
|
:show-list="showList"
|
||||||
@@ -22,6 +23,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import AdvancedSearch from '@/components/advancedSearch/Index'
|
import AdvancedSearch from '@/components/advancedSearch/Index'
|
||||||
import { schemaDetectionSecurity } from '@/utils/static-data'
|
import { schemaDetectionSecurity } from '@/utils/static-data'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { ref } from 'vue'
|
||||||
export default {
|
export default {
|
||||||
name: 'DetectionSearch',
|
name: 'DetectionSearch',
|
||||||
props: {
|
props: {
|
||||||
@@ -96,6 +99,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['search'],
|
emits: ['search'],
|
||||||
|
setup () {
|
||||||
|
// 根据地址栏添加mode,即text和tag模式,默认text
|
||||||
|
const { query } = useRoute()
|
||||||
|
const defaultMode = ref(query.mode || 'text')
|
||||||
|
return {
|
||||||
|
defaultMode
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/* search (metaList, formatSql) {
|
/* search (metaList, formatSql) {
|
||||||
let sql = formatSql
|
let sql = formatSql
|
||||||
|
|||||||
@@ -29,7 +29,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="overview__row">
|
<div class="overview__row">
|
||||||
<div class="row__label">{{ $t('detections.victimLocation') }}</div>
|
<div class="row__label">{{ $t('detections.victimLocation') }}</div>
|
||||||
<div class="row__content">{{ $_.get(basicInfo, 'victimInfo.location.country', '-') || '-' }}</div>
|
<div class="row__content">
|
||||||
|
<div v-if="$_.get(basicInfo, 'victimInfo.location.country')">
|
||||||
|
<img v-if="basicInfo.victimInfo.location.country===countryNameIdMapping.Unknown || !countryNameIdMapping[basicInfo.victimInfo.location.country]" src="../../../../public/images/flag/Unknown.svg" class="filter-country-flag">
|
||||||
|
<img v-else :src="require(`../../../../public/images/flag/${countryNameIdMapping[basicInfo.victimInfo.location.country]}.png`)" class="filter-country-flag" >
|
||||||
|
</div>
|
||||||
|
{{ locationRegion(basicInfo.victimInfo) }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="overview__row">
|
<div class="overview__row">
|
||||||
<div class="row__label">{{ $t('detections.victimAsn') }}</div>
|
<div class="row__label">{{ $t('detections.victimAsn') }}</div>
|
||||||
@@ -41,7 +47,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="overview__row">
|
<div class="overview__row">
|
||||||
<div class="row__label">{{ $t('detections.offenderLocation') }}</div>
|
<div class="row__label">{{ $t('detections.offenderLocation') }}</div>
|
||||||
<div class="row__content">{{ $_.get(basicInfo, 'offenderInfo.location.country', '-') || '-' }}</div>
|
<div class="row__content">
|
||||||
|
<div v-if="$_.get(basicInfo, 'offenderInfo.location.country')">
|
||||||
|
<img v-if="basicInfo.offenderInfo.location.country===countryNameIdMapping.Unknown || !countryNameIdMapping[basicInfo.offenderInfo.location.country]" src="../../../../public/images/flag/Unknown.svg" class="filter-country-flag">
|
||||||
|
<img v-else :src="require(`../../../../public/images/flag/${countryNameIdMapping[basicInfo.offenderInfo.location.country]}.png`)" class="filter-country-flag" >
|
||||||
|
</div>
|
||||||
|
{{ locationRegion(basicInfo.offenderInfo) }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="overview__row">
|
<div class="overview__row">
|
||||||
<div class="row__label">{{ $t('detections.offenderAsn') }}</div>
|
<div class="row__label">{{ $t('detections.offenderAsn') }}</div>
|
||||||
@@ -336,7 +348,7 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { api } from '@/utils/api'
|
import { api } from '@/utils/api'
|
||||||
import { getMillisecond, dateFormatByAppearance } from '@/utils/date-util'
|
import { getMillisecond, dateFormatByAppearance } from '@/utils/date-util'
|
||||||
import { eventSeverityColor, unitTypes, riskLevelMapping, riskLevelColor } from '@/utils/constants'
|
import { eventSeverityColor, unitTypes, countryNameIdMapping, riskLevelMapping, riskLevelColor } from '@/utils/constants'
|
||||||
import unitConvert from '@/utils/unit-convert'
|
import unitConvert from '@/utils/unit-convert'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
export default {
|
export default {
|
||||||
@@ -350,18 +362,19 @@ export default {
|
|||||||
riskLevelColor,
|
riskLevelColor,
|
||||||
basicInfo: {},
|
basicInfo: {},
|
||||||
events: [],
|
events: [],
|
||||||
reference: 'https://attack.mitre.org'
|
reference: 'https://attack.mitre.org',
|
||||||
|
countryNameIdMapping
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
formatT0 () {
|
formatT0 () {
|
||||||
const vm = this
|
const vm = this
|
||||||
return function (event) {
|
return function (event) {
|
||||||
const diffSeconds = vm.detection.startTime - event.startTime
|
const diffSeconds = parseInt(event.diffSeconds)
|
||||||
if (diffSeconds === 0) {
|
if (diffSeconds === 0) {
|
||||||
return 'T0'
|
return 'T0'
|
||||||
}
|
}
|
||||||
const eventStartTime = event.startTime
|
const eventStartTime = parseInt(event.startTime)
|
||||||
const entityStartTime = vm.detection.startTime
|
const entityStartTime = vm.detection.startTime
|
||||||
|
|
||||||
if (_.isNumber(diffSeconds) && _.isNumber(eventStartTime) && _.isNumber(entityStartTime)) {
|
if (_.isNumber(diffSeconds) && _.isNumber(eventStartTime) && _.isNumber(entityStartTime)) {
|
||||||
@@ -382,6 +395,28 @@ export default {
|
|||||||
})
|
})
|
||||||
return (m && m.name) || level
|
return (m && m.name) || level
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
locationRegion (info) {
|
||||||
|
return function (info) {
|
||||||
|
if (!info) {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
let result = ''
|
||||||
|
if (info.location.country) {
|
||||||
|
result += `${info.location.country},`
|
||||||
|
}
|
||||||
|
if (info.location.province) {
|
||||||
|
result += `${info.location.province},`
|
||||||
|
}
|
||||||
|
if (info.location.city) {
|
||||||
|
result += `${info.location.city},`
|
||||||
|
}
|
||||||
|
result = result.substr(0, result.length - 1)
|
||||||
|
if (!result) {
|
||||||
|
result = '-'
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user