# Conflicts:
#	src/assets/css/components/index.scss
This commit is contained in:
@changcode
2022-09-17 11:02:17 +08:00
4 changed files with 201 additions and 9 deletions

View File

@@ -68,4 +68,5 @@
@import 'views/charts2/linkTrafficLine';
@import 'views/charts2/dnsTrafficLine';
@import 'views/charts2/dnsRecentEvents';
@import 'views/charts2/dnsActiveMaliciousDomain';
//@import '../chart';

View File

@@ -0,0 +1,65 @@
.dns-mailcious-domain {
$blue: #046ECA;
$fontFamily: NotoSansHans-Medium;
position: absolute;
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
.dns-mailcious-domain-title {
font-family: NotoSansHans-Medium;
font-size: 14px;
color: #353636;
margin-bottom: 12px;
}
.dns-mailcious-domain-table {
height: 100% !important;
border: 1px solid #E2E5EC;
border-radius: 4px;
padding: 1px;
.el-table__header-wrapper {
tr th {
padding: 4px 0;
.dns-column__span {
font-family: $fontFamily;
font-size: 12px;
color: #353636;
}
}
}
}
.data-mailcious-domain-table {
display: flex !important;
height: auto;
line-height: 16.9px;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
.data-column-domain, .data-column-ips {
font-family: NotoSansSChineseRegular;
width: 210px;
font-size: 12px;
color: $blue;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.data-column-ips-hover-block {
height: 24px;
line-height: 24px;
color: #046ECA;
}
}
}
//.el-table--group::after, .el-table--border::after, .el-table::before {
// height: 0px;
//}
}

View File

@@ -29,9 +29,16 @@
margin: auto;
.block-list__block {
margin: 0 2px;
padding: 0 2px;
height: 51px;
cursor: pointer;
overflow: hidden;
&:hover {
.block-hex-in {
box-shadow: 0 1px 3px 0 #046ECA, 0 1px 3px 0 rgba(0,0,0,0.50);
}
}
.block-hex {
overflow: hidden;
display: block;
@@ -45,16 +52,11 @@
height: 51px;
text-align: center;
transform: skewY(-30deg) rotate(60deg);
cursor: pointer;
box-shadow: none;
transition: all linear .2s;
&:hover {
box-shadow: 0 1px 3px 0 #046ECA, 0 1px 3px 0 rgba(0,0,0,0.50);
}
}
&:nth-child(9n + 1) {
margin-left: 26px;
margin-left: 24px;
}
&:nth-child(n + 5) {
margin-top: -9px;

View File

@@ -1,9 +1,133 @@
<template>
呵呵
<div class="dns-mailcious-domain">
<div class="dns-mailcious-domain-title">
{{ $t('dns.activeMaliciousDomains') }}
</div>
<el-table :data="tableData" class="dns-mailcious-domain-table" height="100%">
<template v-for="(item, index) in customTableTitles" :key="index">
<el-table-column class="data-column">
<!--表头-->
<template #header>
<span class="dns-column__span">{{ $t(item.label) }}</span>
</template>
<!--表格内容-->
<template #default="scope" :column="item">
<div class="data-mailcious-domain-table">
<template v-if="item.prop === 'domain'">
<span class="data-column-domain">{{ $t(scope.row[item.prop]) }}</span>
</template>
<template v-else-if="item.prop === 'ips'">
<el-popover placement="right" :width="126" trigger="hover" v-if="scope.row['ips'].split(',').length >=3">
<template #reference>
<span class="data-column-ips">{{ $t(scope.row[item.prop]) }}</span>
</template>
<!--超过3个ip就省略号显示移动鼠标block块展示并换行-->
<pre style="max-height: 152px;margin: 0px -10px -15px 0;overflow: scroll;"><span style="height: 24px;line-height: 24px;color: #046ECA;">{{scope.row[item.prop].replace(/,/g, '\n')}}</span></pre>
</el-popover>
<span v-else class="data-column-ips">{{ $t(scope.row[item.prop]) }}</span>
</template>
<template v-else-if="item.prop === 'numberOfIPs'">
<span>{{ scope.row['ips'].split(',').length }}</span>
</template>
<template v-else-if="item.prop === 'queries'">
<span>{{ scope.row[item.prop] }}</span>
</template>
<template v-else-if="item.prop === 'firstSeenTime'">
<span>{{ dateFormatByAppearance(scope.row[item.prop]) }}</span>
</template>
<template v-else-if="item.prop === 'lastSeenTime'">
<span>{{ dateFormatByAppearance(scope.row[item.prop]) }}</span>
</template>
<span v-else>-</span>
</div>
</template>
</el-table-column>
</template>
<template v-slot:empty>
<div class="table-no-data" v-show="isNoData">
<div class="table-no-data__title">{{ $t('npm.noData') }}</div>
</div>
</template>
</el-table>
</div>
</template>
<script>
import { api } from '@/utils/api'
import { dateFormatByAppearance } from '@/utils/date-util'
import { get } from '@/utils/http'
import chartMixin from '@/views/charts2/chart-mixin'
export default {
name: 'DnsActiveMaliciousDomain'
name: 'DnsActiveMaliciousDomain',
data () {
return {
tableData: [],
customTableTitles: [
{
label: 'dns.domain',
prop: 'domain'
},
{
label: 'dns.IPs',
prop: 'ips'
},
{
label: 'dns.numberOfIPs',
prop: 'numberOfIPs'
},
{
label: 'dns.queries',
prop: 'queries'
},
{
label: 'dns.firstSeenTime',
prop: 'firstSeenTime'
},
{
label: 'dns.lastSeenTime',
prop: 'lastSeenTime'
}
],
isNoData: false
}
},
mixins: [chartMixin],
watch: {
timeFilter: {
deep: true,
handler (n) {
this.initData()
}
}
},
mounted () {
this.initData()
},
methods: {
initData () {
get(api.dnsInsight.activeMaliciousDomain).then(res => {
console.log('DnsActiveMaliciousDomain.vue--initData--初始化数据', res.data)
if (res.code === 200) {
const data = res.data.result
if (!data || data.length === 0) {
this.isNoData = true
}
this.tableData = data
} else {
this.isNoData = true
}
}).finally(() => {
this.toggleLoading(false)
})
}
},
computed: {}
}
</script>