2021-07-09 10:10:06 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="entity-list">
|
|
|
|
|
<div class="entity-list__content">
|
|
|
|
|
<div class="cn-entity" v-for="d in listData" :key="d.id">
|
|
|
|
|
<div class="cn-entity__header">
|
2021-08-03 16:04:28 +08:00
|
|
|
<div class="header__icon"><i :class="iconClass"></i></div>
|
2021-08-09 18:56:48 +08:00
|
|
|
<div class="header__content" :title="d.ip||d.domainName||d.appName">
|
2021-08-13 09:39:02 +08:00
|
|
|
<template v-if="from === 'ip'">{{d.ip || 'Unknown'}}</template>
|
|
|
|
|
<template v-else-if="from === 'domain'">{{d.domainName || 'Unknown'}}</template>
|
|
|
|
|
<template v-else-if="from === 'app'">{{d.appName || 'Unknown'}}</template>
|
2021-07-09 10:10:06 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-08-04 11:04:31 +08:00
|
|
|
<div class="cn-entity__body" style="position: relative;">
|
2021-08-13 09:39:02 +08:00
|
|
|
<div class="content__desc" v-if="from !== 'ip'" style="color: #999999; width: 200px; position: absolute; top: 33px;right: -9px ;font-size: 12px;">
|
|
|
|
|
<template v-if="from === 'domain'">
|
2021-08-04 11:04:31 +08:00
|
|
|
<span class="desc__label">{{$t('entities.reputationLevel')}}:</span>
|
|
|
|
|
<span>{{d.reputationLevel || '-'}}</span>
|
|
|
|
|
</template>
|
2021-08-13 09:39:02 +08:00
|
|
|
<template v-else-if="from === 'app'">
|
2021-08-04 11:04:31 +08:00
|
|
|
<span class="desc__label">{{$t('entities.risk')}}:</span>
|
|
|
|
|
<span>{{d.appRisk || '-'}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
2021-08-13 09:39:02 +08:00
|
|
|
<template v-if="from === 'ip'">
|
2021-07-09 11:28:19 +08:00
|
|
|
<div class="body__row">
|
2021-08-09 13:38:32 +08:00
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-category"></i> {{$t('overall.country')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.country">{{d.country || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="body__row">
|
2021-08-09 13:38:32 +08:00
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-position"></i> {{$t('overall.region')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.region">{{d.region || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
2021-08-09 13:38:32 +08:00
|
|
|
<div class="body__row">
|
|
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-cloud"></i> {{$t('entities.asn')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.asn">{{d.asn || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
2021-08-09 13:38:32 +08:00
|
|
|
<div class="body__detail"
|
2021-08-26 18:33:49 +08:00
|
|
|
@click="entityDetail({ip: d.ip}, [{key: 'clientIP', label: $t('overall.clientIp')}, {key: 'serverIP', label: $t('overall.serverIp')}])">{{$t('overall.detail')}}></div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</template>
|
2021-08-13 09:39:02 +08:00
|
|
|
<template v-else-if="from === 'domain'">
|
2021-07-09 11:28:19 +08:00
|
|
|
<div class="body__row">
|
2021-08-09 13:38:32 +08:00
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-category"></i> {{$t('entities.Group')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.categoryGroup">{{d.categoryGroup || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="body__row">
|
2021-08-09 13:38:32 +08:00
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-sub-category"></i> {{$t('entities.categoryName')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.categoryName">{{d.categoryName || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
2021-08-09 13:38:32 +08:00
|
|
|
<div class="body__row">
|
|
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-risk"></i> {{$t('entities.credit')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.reputationScore">{{d.reputationScore || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
2021-08-03 16:04:28 +08:00
|
|
|
<div class="body__detail" @click="entityDetail({domain: d.domainName})">{{$t('overall.detail')}}></div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</template>
|
2021-08-13 09:39:02 +08:00
|
|
|
<template v-else-if="from === 'app'">
|
2021-07-09 11:28:19 +08:00
|
|
|
<div class="body__row">
|
2021-08-09 13:38:32 +08:00
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-risk"></i> APP ID:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.appId">{{d.appId || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="body__row">
|
2021-08-09 13:38:32 +08:00
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-risk"></i> {{$t('entities.category')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.appCategory">{{d.appCategory || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
2021-08-09 13:38:32 +08:00
|
|
|
<div class="body__row">
|
|
|
|
|
<span class="body__row-label"><i class="cn-icon cn-icon-risk"></i> {{$t('entities.subcategory')}}:</span>
|
2021-07-13 18:38:32 +08:00
|
|
|
<div class="body__row-value" :title="d.appSubategory">{{d.appSubategory || '-'}}</div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</div>
|
2021-08-03 16:04:28 +08:00
|
|
|
<div class="body__detail" @click="entityDetail({appId: d.appId})">{{$t('overall.detail')}}></div>
|
2021-07-09 11:28:19 +08:00
|
|
|
</template>
|
|
|
|
|
</div>
|
2021-07-09 10:10:06 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-07-09 17:24:22 +08:00
|
|
|
<div class="entity-list__pagination">
|
|
|
|
|
<el-pagination
|
|
|
|
|
@size-change="size"
|
|
|
|
|
@prev-click="prev"
|
|
|
|
|
@next-click="next"
|
|
|
|
|
@current-change="current"
|
|
|
|
|
:currentPage="pageObj.pageNo"
|
|
|
|
|
:page-size="pageObj.pageSize"
|
|
|
|
|
:total="pageObj.total"
|
2021-08-09 13:38:32 +08:00
|
|
|
layout="total, prev, pager, next"
|
2021-07-09 17:24:22 +08:00
|
|
|
></el-pagination>
|
|
|
|
|
</div>
|
2021-07-09 10:10:06 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name: 'EntityList',
|
|
|
|
|
props: {
|
|
|
|
|
listData: Array,
|
2021-08-13 09:39:02 +08:00
|
|
|
from: String,
|
2021-07-09 17:24:22 +08:00
|
|
|
pageObj: Object
|
2021-07-09 10:10:06 +08:00
|
|
|
},
|
2021-08-02 13:22:15 +08:00
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
showDetail: false,
|
|
|
|
|
typeName: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-07-09 10:10:06 +08:00
|
|
|
computed: {
|
|
|
|
|
circleColor () {
|
|
|
|
|
let color
|
2021-08-13 09:39:02 +08:00
|
|
|
switch (this.from) {
|
2021-07-09 10:10:06 +08:00
|
|
|
case ('ip'): {
|
|
|
|
|
color = '#E8FBF9'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case ('domain'): {
|
|
|
|
|
color = '#EEF6FE'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case ('app'): {
|
|
|
|
|
color = '#FEF7E7'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
default: break
|
|
|
|
|
}
|
|
|
|
|
return color
|
|
|
|
|
},
|
|
|
|
|
iconClass () {
|
|
|
|
|
let className
|
2021-08-13 09:39:02 +08:00
|
|
|
switch (this.from) {
|
2021-07-09 10:10:06 +08:00
|
|
|
case ('ip'): {
|
|
|
|
|
className = 'cn-icon cn-icon-ip ip-green'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case ('domain'): {
|
|
|
|
|
className = 'cn-icon cn-icon-domain domain-blue'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case ('app'): {
|
|
|
|
|
className = 'cn-icon cn-icon-app app-orange'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
default: break
|
|
|
|
|
}
|
|
|
|
|
return className
|
|
|
|
|
}
|
2021-07-09 17:24:22 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
size (val) {
|
|
|
|
|
this.$emit('pageSize', val)
|
|
|
|
|
},
|
|
|
|
|
// 点击上一页箭头
|
|
|
|
|
prev () {
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
},
|
|
|
|
|
// 点击下一页箭头
|
|
|
|
|
next () {
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
},
|
|
|
|
|
// currentPage 改变时会触发
|
|
|
|
|
current (val) {
|
|
|
|
|
this.$emit('pageNo', val)
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
},
|
|
|
|
|
scrollbarToTop () {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
const wraps = document.querySelectorAll('.el-table__body-wrapper')
|
2021-08-13 09:39:02 +08:00
|
|
|
wraps.scrollTop = 0
|
2021-07-09 17:24:22 +08:00
|
|
|
})
|
2021-08-02 13:22:15 +08:00
|
|
|
},
|
2021-08-09 13:38:32 +08:00
|
|
|
entityDetail (params, tabs = []) {
|
|
|
|
|
this.$emit('showDetail', params, tabs)
|
2021-07-09 17:24:22 +08:00
|
|
|
}
|
2021-07-09 10:10:06 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|