2021-12-14 16:42:45 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="entity-explorer"
|
|
|
|
|
|
:class="{'entity-explorer--show-list': showList}">
|
|
|
|
|
|
<!-- 顶部工具栏,在列表页显示 -->
|
|
|
|
|
|
<div class="explorer-top-tools" v-show="showList">
|
2022-05-14 21:53:52 +08:00
|
|
|
|
<DateTimeRange class="date-time-range" :start-time="timeFilter.startTime" :end-time="timeFilter.endTime" :date-range="timeFilter.dateRangeValue" ref="dateTimeRange" @change="reload"/>
|
|
|
|
|
|
<TimeRefresh class="date-time-range" @change="timeRefreshChange" :end-time="timeFilter.endTime"/>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
<el-button-group size="mini">
|
|
|
|
|
|
<el-button size="mini" @click="listMode = 'list'" :class="{'active': listMode === 'list'}"><i class="cn-icon cn-icon-list"></i></el-button>
|
|
|
|
|
|
<el-button size="mini" @click="listMode = 'block'" :class="{'active': listMode === 'block'}"><i class="cn-icon cn-icon-blocks"></i></el-button>
|
|
|
|
|
|
</el-button-group>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 搜索组件 -->
|
|
|
|
|
|
<explorer-search
|
2021-12-31 10:55:49 +08:00
|
|
|
|
ref="search"
|
2021-12-14 16:42:45 +08:00
|
|
|
|
:class="{'explorer-search--show-list': showList}"
|
|
|
|
|
|
:show-list="showList"
|
|
|
|
|
|
@search="search"
|
|
|
|
|
|
></explorer-search>
|
|
|
|
|
|
<!-- 内容区 -->
|
2022-01-06 15:32:24 +08:00
|
|
|
|
<div class="explorer-container" v-if="showList" style="height: calc(100% - 20px); flex-direction: column">
|
2022-06-09 21:55:28 +08:00
|
|
|
|
<div style="display: flex; height: auto;">
|
2022-01-06 15:32:24 +08:00
|
|
|
|
<entity-filter
|
|
|
|
|
|
:filter-data="filterData"
|
2022-04-27 14:52:25 +08:00
|
|
|
|
:loading-left="loadingLeft"
|
2022-01-25 19:47:08 +08:00
|
|
|
|
:q="q"
|
2022-05-14 21:53:52 +08:00
|
|
|
|
:time-filter="timeFilter"
|
2022-01-06 15:32:24 +08:00
|
|
|
|
@filter="filter"
|
|
|
|
|
|
></entity-filter>
|
|
|
|
|
|
<entity-list
|
|
|
|
|
|
:list-data="listData"
|
|
|
|
|
|
:list-mode="listMode"
|
|
|
|
|
|
:pageObj="pageObj"
|
2022-05-14 21:53:52 +08:00
|
|
|
|
:time-filter="timeFilter"
|
2022-01-06 15:32:24 +08:00
|
|
|
|
@pageSize="pageSize"
|
|
|
|
|
|
@pageNo="pageNo"
|
|
|
|
|
|
:loading="listLoading"
|
|
|
|
|
|
></entity-list>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="explorer-foot" v-else>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
|
|
|
<div class="entity-overview">
|
|
|
|
|
|
<div class="overview-left">
|
2022-04-27 14:52:25 +08:00
|
|
|
|
<span class="overview-left-loading">
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<loading :loading="loadingApp"></loading>
|
2022-04-27 14:52:25 +08:00
|
|
|
|
<span class="overview-left-loading-span">{{entityAppTotal}}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="overview-left-span">APP</span>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="overview-right">
|
|
|
|
|
|
<div class="right-row">
|
|
|
|
|
|
<i class="cn-icon cn-icon-increase"></i>
|
|
|
|
|
|
<div class="right-label">New</div>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-label-loading">
|
2022-09-02 09:40:47 +08:00
|
|
|
|
<loading :loading="loadingAppNew" size="small"></loading>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-value">{{entityAppNew}}</div>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-row">
|
|
|
|
|
|
<i class="cn-icon cn-icon-active"></i>
|
|
|
|
|
|
<div class="right-label">Active</div>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-label-loading">
|
2022-09-02 09:40:47 +08:00
|
|
|
|
<loading :loading="loadingAppActive" size="small"></loading>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-value">{{entityAppActive}}</div>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
|
|
|
<div class="entity-overview">
|
|
|
|
|
|
<div class="overview-left">
|
2022-04-27 14:52:25 +08:00
|
|
|
|
<span class="overview-left-loading">
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<loading :loading="loadingDomain"></loading>
|
2022-04-27 14:52:25 +08:00
|
|
|
|
<span class="overview-left-loading-span">{{entityDomainTotal}}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="overview-left-span">DOMAIN</span>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="overview-right">
|
|
|
|
|
|
<div class="right-row">
|
|
|
|
|
|
<i class="cn-icon cn-icon-increase"></i>
|
|
|
|
|
|
<div class="right-label">New</div>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-label-loading">
|
2022-09-02 09:40:47 +08:00
|
|
|
|
<loading :loading="loadingDomainNew" size="small"></loading>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-value">{{entityDomainNew}}</div>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-row">
|
|
|
|
|
|
<i class="cn-icon cn-icon-active"></i>
|
|
|
|
|
|
<div class="right-label">Active</div>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-label-loading">
|
2022-09-02 09:40:47 +08:00
|
|
|
|
<loading :loading="loadingDomainActive" size="small"></loading>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-value">{{entityDomainActive}}</div>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
|
|
|
<div class="entity-overview">
|
|
|
|
|
|
<div class="overview-left">
|
2022-04-27 14:52:25 +08:00
|
|
|
|
<span class="overview-left-loading">
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<loading :loading="loadingIp"></loading>
|
2022-04-27 14:52:25 +08:00
|
|
|
|
<span class="overview-left-loading-span">{{entityIpTotal}}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span class="overview-left-span">IP</span>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="overview-right">
|
|
|
|
|
|
<div class="right-row">
|
|
|
|
|
|
<i class="cn-icon cn-icon-increase"></i>
|
|
|
|
|
|
<div class="right-label">New</div>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-label-loading">
|
2022-09-02 09:40:47 +08:00
|
|
|
|
<loading :loading="loadingIpNew" size="small"></loading>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-value">{{entityIpNew}}</div>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-row">
|
|
|
|
|
|
<i class="cn-icon cn-icon-active"></i>
|
|
|
|
|
|
<div class="right-label">Active</div>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-label-loading">
|
2022-09-02 09:40:47 +08:00
|
|
|
|
<loading :loading="loadingIpActive" size="small"></loading>
|
2022-05-06 11:16:25 +08:00
|
|
|
|
<div class="right-value">{{entityIpActive}}</div>
|
|
|
|
|
|
</div>
|
2021-12-14 16:42:45 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import ExplorerSearch from '@/views/entityExplorer/search/ExplorerSearch'
|
|
|
|
|
|
import DateTimeRange from '@/components/common/TimeRange/DateTimeRange'
|
|
|
|
|
|
import TimeRefresh from '@/components/common/TimeRange/TimeRefresh'
|
|
|
|
|
|
import EntityFilter from '@/views/entityExplorer/EntityFilter'
|
|
|
|
|
|
import EntityList from '@/views/entityExplorer/entityList/EntityList'
|
2022-05-11 17:50:40 +08:00
|
|
|
|
import { entityType, defaultPageSize, riskLevelMapping } from '@/utils/constants'
|
2021-12-31 10:40:37 +08:00
|
|
|
|
import { get } from '@/utils/http'
|
|
|
|
|
|
import { api } from '@/utils/api'
|
2022-01-25 19:47:08 +08:00
|
|
|
|
import { getNowTime, getSecond } from '@/utils/date-util'
|
2022-01-05 20:24:02 +08:00
|
|
|
|
import { ref } from 'vue'
|
2022-06-06 17:34:55 +08:00
|
|
|
|
import _ from 'lodash'
|
2022-02-14 22:22:31 +08:00
|
|
|
|
import Pagination from '@/components/common/Pagination'
|
2022-04-27 14:52:25 +08:00
|
|
|
|
import Loading from '@/components/common/Loading'
|
2021-12-14 16:42:45 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'entity-explorer',
|
|
|
|
|
|
components: {
|
2022-04-27 14:52:25 +08:00
|
|
|
|
Loading,
|
2021-12-14 16:42:45 +08:00
|
|
|
|
ExplorerSearch,
|
|
|
|
|
|
DateTimeRange,
|
|
|
|
|
|
TimeRefresh,
|
|
|
|
|
|
EntityFilter,
|
2022-01-06 15:32:24 +08:00
|
|
|
|
EntityList,
|
2022-02-14 22:22:31 +08:00
|
|
|
|
Pagination
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
showList: false,
|
2021-12-17 20:56:25 +08:00
|
|
|
|
listMode: 'list', // entity列表的模式,list|block
|
2021-12-14 16:42:45 +08:00
|
|
|
|
|
2021-12-31 10:40:37 +08:00
|
|
|
|
entityAppTotal: '-',
|
|
|
|
|
|
entityAppNew: '-',
|
|
|
|
|
|
entityAppActive: '-',
|
|
|
|
|
|
|
|
|
|
|
|
entityDomainTotal: '-',
|
|
|
|
|
|
entityDomainNew: '-',
|
|
|
|
|
|
entityDomainActive: '-',
|
|
|
|
|
|
|
|
|
|
|
|
entityIpTotal: '-',
|
|
|
|
|
|
entityIpNew: '-',
|
|
|
|
|
|
entityIpActive: '-',
|
|
|
|
|
|
|
2021-12-31 10:55:49 +08:00
|
|
|
|
pageObj: {
|
|
|
|
|
|
pageNo: 1,
|
2022-03-12 16:56:46 +08:00
|
|
|
|
// 是否重置pageNo,在执行新搜索时是true
|
|
|
|
|
|
resetPageNo: true,
|
2022-01-05 20:24:02 +08:00
|
|
|
|
pageSize: defaultPageSize,
|
|
|
|
|
|
total: 0
|
2021-12-31 10:55:49 +08:00
|
|
|
|
},
|
2021-12-14 16:42:45 +08:00
|
|
|
|
filterData: [
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'ip',
|
|
|
|
|
|
title: entityType.ip,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
totalCount: 0,
|
2021-12-14 16:42:45 +08:00
|
|
|
|
data: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('overall.country'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'countryDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'ip_location_country', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-country',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('overall.province'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'provinceDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'ip_location_province', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-position',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('overall.city'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'cityDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'ip_location_city', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-city',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.asn'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'asnDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'ip_asn', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-cloud',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'app',
|
|
|
|
|
|
title: entityType.app,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
totalCount: 0,
|
2021-12-14 16:42:45 +08:00
|
|
|
|
data: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.category'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'categoryDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'app_category', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-category',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.subcategory'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'subcategoryDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'app_subcategory', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-sub-category',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.risk'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'riskDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'app_risk', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-risk',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'domain',
|
|
|
|
|
|
title: entityType.domain,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
totalCount: 0,
|
2021-12-14 16:42:45 +08:00
|
|
|
|
data: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.domainDetail.categoryGroup'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'categoryGroupDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'domain_category_group', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-category',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.category'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'categoryDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'domain_category', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-sub-category',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('entities.reputationLevel'),
|
2022-01-03 22:46:22 +08:00
|
|
|
|
column: 'reputationLevelDistinctCount',
|
2022-01-05 23:56:27 +08:00
|
|
|
|
topColumn: 'domain_reputation_level', // top弹框查询字段
|
2022-05-11 17:50:40 +08:00
|
|
|
|
icon: 'cn-icon cn-icon-credit',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2022-05-11 17:50:40 +08:00
|
|
|
|
value: 0
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
type: 'dns',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
title: this.$t('dns.dnsServer'),
|
2022-05-11 17:50:40 +08:00
|
|
|
|
totalCount: 0,
|
2022-05-17 19:18:26 +08:00
|
|
|
|
osTotalCount: 0,
|
|
|
|
|
|
orgTotalCount: 0,
|
|
|
|
|
|
softwareTotalCount: 0,
|
2022-05-11 17:50:40 +08:00
|
|
|
|
data: [
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('overall.dnsServerInfo.role'),
|
|
|
|
|
|
column: 'dnsServerRoleCount',
|
|
|
|
|
|
topColumn: 'dns_server_role',
|
|
|
|
|
|
icon: 'cn-icon cn-icon-role',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2022-05-11 17:50:40 +08:00
|
|
|
|
value: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('dns.managementOrganization'),
|
|
|
|
|
|
column: 'dnsServerOrgCount',
|
|
|
|
|
|
topColumn: 'dns_server_org',
|
|
|
|
|
|
icon: 'cn-icon cn-icon-org',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2022-05-11 17:50:40 +08:00
|
|
|
|
value: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('overall.dnsServerInfo.software'),
|
|
|
|
|
|
column: 'dnsServerSoftwareCount',
|
|
|
|
|
|
topColumn: 'dns_server_software',
|
|
|
|
|
|
icon: 'cn-icon cn-icon-software',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2022-05-11 17:50:40 +08:00
|
|
|
|
value: 0
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('overall.dnsServerInfo.system'),
|
|
|
|
|
|
column: 'dnsServerOsCount',
|
|
|
|
|
|
topColumn: 'dns_server_os',
|
|
|
|
|
|
icon: 'cn-icon cn-icon-os',
|
2022-05-14 21:41:54 +08:00
|
|
|
|
showTopTen: false,
|
2021-12-31 10:55:49 +08:00
|
|
|
|
value: 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
2022-01-05 23:56:27 +08:00
|
|
|
|
listData: [],
|
2022-01-25 19:47:08 +08:00
|
|
|
|
q: '',
|
2022-02-07 16:11:49 +08:00
|
|
|
|
metaList: [],
|
2022-01-25 19:47:08 +08:00
|
|
|
|
limitFilterType: true, // 是否限定了filter的类型
|
2022-04-27 14:52:25 +08:00
|
|
|
|
listLoading: false,
|
2022-05-06 11:16:25 +08:00
|
|
|
|
// 实体详情搜索页面 底部列表
|
|
|
|
|
|
loadingApp: false,
|
|
|
|
|
|
loadingDomain: false,
|
|
|
|
|
|
loadingIp: false,
|
|
|
|
|
|
// New
|
|
|
|
|
|
loadingAppNew: false,
|
|
|
|
|
|
loadingDomainNew: false,
|
|
|
|
|
|
loadingIpNew: false,
|
|
|
|
|
|
// Active
|
|
|
|
|
|
loadingAppActive: false,
|
|
|
|
|
|
loadingDomainActive: false,
|
|
|
|
|
|
loadingIpActive: false,
|
|
|
|
|
|
|
|
|
|
|
|
// 实体详情列表页面 左侧筛选条件
|
2022-04-27 14:52:25 +08:00
|
|
|
|
loadingLeft: false
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
timeRefreshChange () {
|
2022-01-04 17:04:05 +08:00
|
|
|
|
if (!this.$refs.dateTimeRange.isCustom) {
|
|
|
|
|
|
const value = this.timeFilter.dateRangeValue
|
|
|
|
|
|
this.$refs.dateTimeRange.quickChange(value)
|
|
|
|
|
|
}
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
2022-01-04 17:04:05 +08:00
|
|
|
|
reload (s, e, v) {
|
|
|
|
|
|
this.dateTimeRangeChange(s, e, v)
|
|
|
|
|
|
},
|
|
|
|
|
|
// methods
|
|
|
|
|
|
dateTimeRangeChange (s, e, v) {
|
|
|
|
|
|
this.timeFilter = { startTime: s, endTime: e, dateRangeValue: v }
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
2022-02-14 16:04:08 +08:00
|
|
|
|
// sql特殊字段转换
|
|
|
|
|
|
specialColumnHandle (sql) {
|
|
|
|
|
|
const columns = [
|
|
|
|
|
|
{
|
|
|
|
|
|
target: "app_risk='1'",
|
|
|
|
|
|
original: `app_risk='${riskLevelMapping[0].name.toLowerCase()}'`
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
target: "app_risk='2'",
|
|
|
|
|
|
original: `app_risk='${riskLevelMapping[1].name.toLowerCase()}'`
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
target: "app_risk='3'",
|
|
|
|
|
|
original: `app_risk='${riskLevelMapping[2].name.toLowerCase()}'`
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
target: "app_risk='4'",
|
|
|
|
|
|
original: `app_risk='${riskLevelMapping[3].name.toLowerCase()}'`
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
target: "app_risk='5'",
|
|
|
|
|
|
original: `app_risk='${riskLevelMapping[4].name.toLowerCase()}'`
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
target: "=''",
|
|
|
|
|
|
original: "='unknown'"
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
let result = sql
|
|
|
|
|
|
columns.forEach(c => {
|
2022-06-06 17:34:55 +08:00
|
|
|
|
result = _.replace(result, c.original, c.target)
|
2022-02-14 16:04:08 +08:00
|
|
|
|
})
|
|
|
|
|
|
return result
|
|
|
|
|
|
},
|
2022-06-09 18:20:28 +08:00
|
|
|
|
search (param) {
|
|
|
|
|
|
let q
|
|
|
|
|
|
let metaList
|
|
|
|
|
|
if (param) {
|
|
|
|
|
|
q = param.q
|
|
|
|
|
|
metaList = param.metaList
|
|
|
|
|
|
}
|
2022-06-06 17:34:55 +08:00
|
|
|
|
if (q) {
|
|
|
|
|
|
this.q = this.specialColumnHandle(q)
|
2022-02-07 16:11:49 +08:00
|
|
|
|
this.metaList = metaList
|
2022-01-25 19:47:08 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.q = ''
|
2022-02-07 16:11:49 +08:00
|
|
|
|
this.metaList = []
|
2022-01-04 17:04:05 +08:00
|
|
|
|
}
|
2022-01-25 19:47:08 +08:00
|
|
|
|
|
2021-12-14 16:42:45 +08:00
|
|
|
|
if (!this.showList) {
|
|
|
|
|
|
this.showList = true
|
|
|
|
|
|
}
|
2022-03-12 16:56:46 +08:00
|
|
|
|
if (this.pageObj.resetPageNo) {
|
|
|
|
|
|
this.pageObj.pageNo = 1
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.pageObj.resetPageNo = true
|
|
|
|
|
|
}
|
2021-12-14 16:42:45 +08:00
|
|
|
|
// 带参数时,只查询对应类型的entity;不带参数时,3种entity都查
|
2022-06-06 17:34:55 +08:00
|
|
|
|
if (q) {
|
2022-01-25 22:58:23 +08:00
|
|
|
|
// entity_type处理,不查其他两种entity_type对应的左侧筛选
|
2022-01-25 19:47:08 +08:00
|
|
|
|
const entityTypeMeta = metaList.find(meta => {
|
2022-01-25 22:58:23 +08:00
|
|
|
|
return meta.column && meta.column.name === 'entity_type'
|
2022-01-25 19:47:08 +08:00
|
|
|
|
})
|
2022-01-26 18:27:12 +08:00
|
|
|
|
if (entityTypeMeta && entityTypeMeta.operator.value === '=') {
|
2022-01-25 19:47:08 +08:00
|
|
|
|
let entityType = ''
|
|
|
|
|
|
this.limitFilterType = false
|
2022-06-15 20:41:21 +08:00
|
|
|
|
if (entityTypeMeta.value.value.toLowerCase() === 'ip') {
|
2022-01-25 19:47:08 +08:00
|
|
|
|
this.limitFilterType = true
|
|
|
|
|
|
entityType = 'ip'
|
2022-06-15 20:41:21 +08:00
|
|
|
|
} else if (entityTypeMeta.value.value.toLowerCase() === 'domain') {
|
2022-01-25 19:47:08 +08:00
|
|
|
|
this.limitFilterType = true
|
|
|
|
|
|
entityType = 'domain'
|
2022-06-15 20:41:21 +08:00
|
|
|
|
} else if (entityTypeMeta.value.value.toLowerCase() === 'app') {
|
2022-01-25 19:47:08 +08:00
|
|
|
|
this.limitFilterType = true
|
|
|
|
|
|
entityType = 'app'
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.limitFilterType = false
|
|
|
|
|
|
}
|
2022-05-14 21:53:52 +08:00
|
|
|
|
this.queryFilter({ entityType: entityType, q: this.q, ...this.timeFilter })
|
2022-06-16 17:42:44 +08:00
|
|
|
|
if (entityType === 'ip') {
|
|
|
|
|
|
this.queryFilter({ entityType: 'dns', q: this.q, ...this.timeFilter })
|
|
|
|
|
|
}
|
2022-05-14 21:53:52 +08:00
|
|
|
|
this.queryList({ q: this.q, ...this.pageObj, ...this.timeFilter })
|
|
|
|
|
|
this.queryListTotal({ q: this.q, ...this.timeFilter })
|
2022-01-25 19:47:08 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.limitFilterType = false
|
2022-05-14 21:53:52 +08:00
|
|
|
|
this.queryFilter({ entityType: 'ip', q: this.q, ...this.timeFilter })
|
|
|
|
|
|
this.queryFilter({ entityType: 'domain', q: this.q, ...this.timeFilter })
|
|
|
|
|
|
this.queryFilter({ entityType: 'app', q: this.q, ...this.timeFilter })
|
|
|
|
|
|
this.queryFilter({ entityType: 'dns', q: this.q, ...this.timeFilter })
|
|
|
|
|
|
this.queryList({ q: this.q, ...this.pageObj, ...this.timeFilter })
|
|
|
|
|
|
this.queryListTotal({ q: this.q, ...this.timeFilter })
|
2022-01-25 19:47:08 +08:00
|
|
|
|
}
|
2021-12-14 16:42:45 +08:00
|
|
|
|
} else {
|
2022-01-25 19:47:08 +08:00
|
|
|
|
this.limitFilterType = false
|
2022-05-14 21:53:52 +08:00
|
|
|
|
this.queryFilter({ entityType: 'ip', ...this.timeFilter })
|
|
|
|
|
|
this.queryFilter({ entityType: 'app', ...this.timeFilter })
|
|
|
|
|
|
this.queryFilter({ entityType: 'domain', ...this.timeFilter })
|
|
|
|
|
|
this.queryFilter({ entityType: 'dns', ...this.timeFilter })
|
|
|
|
|
|
this.queryList({ ...this.pageObj, ...this.timeFilter })
|
2022-05-16 11:09:04 +08:00
|
|
|
|
this.queryListTotal({ ...this.timeFilter })
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-01-05 20:24:02 +08:00
|
|
|
|
pageSize (val) {
|
|
|
|
|
|
this.pageObj.pageSize = val
|
2022-06-06 17:34:55 +08:00
|
|
|
|
this.search({ metaList: this.metaList, q: this.q })
|
2022-01-05 20:24:02 +08:00
|
|
|
|
},
|
|
|
|
|
|
pageNo (val) {
|
|
|
|
|
|
this.pageObj.pageNo = val
|
2022-03-12 16:56:46 +08:00
|
|
|
|
this.pageObj.resetPageNo = false
|
2022-06-06 17:34:55 +08:00
|
|
|
|
this.search({ metaList: this.metaList, q: this.q })
|
2022-01-05 20:24:02 +08:00
|
|
|
|
},
|
2022-01-06 15:32:24 +08:00
|
|
|
|
// 点击上一页箭头
|
|
|
|
|
|
prev () {
|
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击下一页箭头
|
|
|
|
|
|
next () {
|
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
|
},
|
|
|
|
|
|
// currentPage 改变时会触发
|
|
|
|
|
|
current (val) {
|
|
|
|
|
|
this.$emit('pageNo', val)
|
|
|
|
|
|
this.scrollbarToTop()
|
|
|
|
|
|
},
|
|
|
|
|
|
scrollbarToTop () {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
const wraps = document.querySelector('#entityList')
|
|
|
|
|
|
wraps.scrollTop = 0
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-12-31 10:55:49 +08:00
|
|
|
|
/* filter组件内点击后查询 */
|
|
|
|
|
|
filter (name, topData) {
|
2022-02-18 10:07:43 +08:00
|
|
|
|
const params = {
|
|
|
|
|
|
column: topData.topColumn,
|
|
|
|
|
|
operator: '=',
|
|
|
|
|
|
value: name
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$refs.search.addParams([params])
|
2022-03-12 16:56:46 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.emitter.emit('advanced-search')
|
|
|
|
|
|
})
|
2021-12-14 16:42:45 +08:00
|
|
|
|
},
|
2021-12-31 10:55:49 +08:00
|
|
|
|
/* 查询filter数据 */
|
|
|
|
|
|
queryFilter (params) {
|
2022-01-04 17:04:05 +08:00
|
|
|
|
const queryParams = {
|
2022-05-14 21:53:52 +08:00
|
|
|
|
...params,
|
2022-01-25 19:47:08 +08:00
|
|
|
|
startTime: getSecond(params.startTime),
|
2022-05-14 21:53:52 +08:00
|
|
|
|
endTime: getSecond(params.endTime)
|
2022-01-04 17:04:05 +08:00
|
|
|
|
}
|
2022-04-27 14:52:25 +08:00
|
|
|
|
this.loadingLeft = true
|
2022-01-04 17:04:05 +08:00
|
|
|
|
get(api.entityFilter, queryParams).then(response => {
|
2022-02-14 16:04:08 +08:00
|
|
|
|
if (response.data && response.data.result) {
|
2021-12-31 10:55:49 +08:00
|
|
|
|
switch (params.entityType) {
|
|
|
|
|
|
case 'ip': {
|
|
|
|
|
|
this.filterData[0].data.forEach(d => {
|
2022-06-16 18:12:17 +08:00
|
|
|
|
d.value = response.data.result[d.column] || 0
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.filterData[0].totalCount = response.data.result.count
|
2022-01-25 19:47:08 +08:00
|
|
|
|
if (this.limitFilterType) {
|
|
|
|
|
|
this.cleanFilterData(1)
|
|
|
|
|
|
this.cleanFilterData(2)
|
|
|
|
|
|
}
|
2021-12-31 10:55:49 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
case 'app': {
|
|
|
|
|
|
this.filterData[1].data.forEach(d => {
|
2022-06-16 18:12:17 +08:00
|
|
|
|
d.value = response.data.result[d.column] || 0
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.filterData[1].totalCount = response.data.result.count
|
2022-01-25 19:47:08 +08:00
|
|
|
|
if (this.limitFilterType) {
|
|
|
|
|
|
this.cleanFilterData(0)
|
|
|
|
|
|
this.cleanFilterData(2)
|
2022-06-16 17:42:44 +08:00
|
|
|
|
this.cleanFilterData(3)
|
2022-01-25 19:47:08 +08:00
|
|
|
|
}
|
2021-12-31 10:55:49 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
case 'domain': {
|
|
|
|
|
|
this.filterData[2].data.forEach(d => {
|
2022-06-16 18:12:17 +08:00
|
|
|
|
d.value = response.data.result[d.column] || 0
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.filterData[2].totalCount = response.data.result.count
|
2022-01-25 19:47:08 +08:00
|
|
|
|
if (this.limitFilterType) {
|
|
|
|
|
|
this.cleanFilterData(0)
|
|
|
|
|
|
this.cleanFilterData(1)
|
2022-06-16 17:42:44 +08:00
|
|
|
|
this.cleanFilterData(3)
|
2022-01-25 19:47:08 +08:00
|
|
|
|
}
|
2021-12-31 10:55:49 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
2022-05-14 21:41:54 +08:00
|
|
|
|
case 'dns': {
|
|
|
|
|
|
this.filterData[3].data.forEach(d => {
|
2022-06-16 18:12:17 +08:00
|
|
|
|
d.value = response.data.result[d.column] || 0
|
2022-05-14 21:41:54 +08:00
|
|
|
|
})
|
2022-06-17 14:23:02 +08:00
|
|
|
|
this.filterData[3].totalCount = response.data.result.count
|
2022-05-17 19:18:26 +08:00
|
|
|
|
this.filterData[3].osTotalCount = response.data.result.osTotalCount
|
|
|
|
|
|
this.filterData[3].orgTotalCount = response.data.result.orgTotalCount
|
2022-06-17 14:23:02 +08:00
|
|
|
|
this.filterData[3].softwareTotalCount = response.data.result.softwareTotalCount
|
2022-05-14 21:41:54 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
2021-12-31 10:55:49 +08:00
|
|
|
|
}
|
2022-04-27 14:52:25 +08:00
|
|
|
|
this.loadingLeft = false
|
2022-04-28 11:24:04 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.loadingLeft = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
queryList (params) {
|
2022-01-06 16:28:16 +08:00
|
|
|
|
this.listLoading = true
|
2022-01-04 17:04:05 +08:00
|
|
|
|
const queryParams = {
|
2022-05-14 21:53:52 +08:00
|
|
|
|
...params,
|
2022-06-23 16:37:58 +08:00
|
|
|
|
startTime: getSecond(params.startTime),
|
|
|
|
|
|
endTime: getSecond(params.endTime)
|
2022-01-04 17:04:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
get(api.entityList, queryParams).then(response => {
|
2022-01-05 20:24:02 +08:00
|
|
|
|
if (response.code === 200) {
|
2022-01-06 16:28:16 +08:00
|
|
|
|
this.listData = []
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.listData = response.data.result
|
|
|
|
|
|
})
|
2022-01-05 20:24:02 +08:00
|
|
|
|
}
|
2022-01-05 23:56:27 +08:00
|
|
|
|
}).finally(() => {
|
|
|
|
|
|
this.listLoading = false
|
2022-01-05 20:24:02 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
queryListTotal (params) {
|
|
|
|
|
|
const queryParams = {
|
2022-05-14 21:53:52 +08:00
|
|
|
|
...params,
|
2022-06-23 16:37:58 +08:00
|
|
|
|
startTime: getSecond(params.startTime),
|
|
|
|
|
|
endTime: getSecond(params.endTime)
|
2022-01-05 20:24:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
get(api.entityListTotal, queryParams).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.pageObj.total = response.data.result
|
|
|
|
|
|
}
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
handleQ (params) {
|
|
|
|
|
|
return Object.keys(params).map(param => {
|
2022-01-05 23:56:27 +08:00
|
|
|
|
return `${param}='${params[param]}'`
|
2021-12-31 10:55:49 +08:00
|
|
|
|
}).join(' AND ')
|
2021-12-31 10:40:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
getEntityIndexData () {
|
2022-01-05 23:56:27 +08:00
|
|
|
|
const now = window.$dayJs.tz().valueOf()
|
|
|
|
|
|
const timeFilter = {
|
|
|
|
|
|
startTime: parseInt(now / 1000 - 3600),
|
|
|
|
|
|
endTime: parseInt(now / 1000)
|
|
|
|
|
|
}
|
2021-12-31 10:40:37 +08:00
|
|
|
|
// Total
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingApp = true
|
|
|
|
|
|
this.loadingDomain = true
|
|
|
|
|
|
this.loadingIp = true
|
|
|
|
|
|
// New
|
|
|
|
|
|
this.loadingAppNew = true
|
|
|
|
|
|
this.loadingDomainNew = true
|
|
|
|
|
|
this.loadingIpNew = true
|
|
|
|
|
|
// Active
|
|
|
|
|
|
this.loadingAppActive = true
|
|
|
|
|
|
this.loadingDomainActive = true
|
|
|
|
|
|
this.loadingIpActive = true
|
|
|
|
|
|
|
2021-12-31 10:40:37 +08:00
|
|
|
|
get(api.entityTotal, { entityType: 'app' }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityAppTotal = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingApp = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2021-12-31 10:40:37 +08:00
|
|
|
|
get(api.entityTotal, { entityType: 'domain' }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityDomainTotal = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingDomain = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2021-12-31 10:40:37 +08:00
|
|
|
|
get(api.entityTotal, { entityType: 'ip' }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityIpTotal = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingIp = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2021-12-31 10:40:37 +08:00
|
|
|
|
// New
|
2022-01-05 23:56:27 +08:00
|
|
|
|
get(api.entityNew, { entityType: 'app', ...timeFilter }).then(response => {
|
2021-12-31 10:40:37 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityAppNew = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingAppNew = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2022-01-05 23:56:27 +08:00
|
|
|
|
get(api.entityNew, { entityType: 'domain', ...timeFilter }).then(response => {
|
2021-12-31 10:40:37 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityDomainNew = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingDomainNew = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2022-01-05 23:56:27 +08:00
|
|
|
|
get(api.entityNew, { entityType: 'ip', ...timeFilter }).then(response => {
|
2021-12-31 10:40:37 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityIpNew = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingIpNew = false
|
2021-12-31 10:40:37 +08:00
|
|
|
|
})
|
|
|
|
|
|
// Active
|
2022-01-05 23:56:27 +08:00
|
|
|
|
get(api.entityActive, { entityType: 'app', ...timeFilter }).then(response => {
|
2021-12-31 10:40:37 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityAppActive = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingAppActive = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2022-01-05 23:56:27 +08:00
|
|
|
|
get(api.entityActive, { entityType: 'domain', ...timeFilter }).then(response => {
|
2021-12-31 10:40:37 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityDomainActive = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingDomainActive = false
|
2021-12-31 10:55:49 +08:00
|
|
|
|
})
|
2022-01-05 23:56:27 +08:00
|
|
|
|
get(api.entityActive, { entityType: 'ip', ...timeFilter }).then(response => {
|
2021-12-31 10:40:37 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.entityIpActive = response.data.result
|
|
|
|
|
|
}
|
2022-05-06 11:16:25 +08:00
|
|
|
|
this.loadingIpActive = false
|
2021-12-31 10:40:37 +08:00
|
|
|
|
})
|
2022-01-25 19:47:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
cleanFilterData (index) {
|
|
|
|
|
|
this.filterData[index].data.forEach(d => {
|
|
|
|
|
|
d.value = 0
|
|
|
|
|
|
})
|
|
|
|
|
|
this.filterData[index].totalCount = 0
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
2021-12-31 10:40:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
this.getEntityIndexData()
|
2022-01-04 17:04:05 +08:00
|
|
|
|
},
|
2022-05-14 21:53:52 +08:00
|
|
|
|
watch: {
|
2022-01-04 17:04:05 +08:00
|
|
|
|
timeFilter (n) {
|
2022-06-06 17:34:55 +08:00
|
|
|
|
this.search({ metaList: this.metaList, q: this.q })
|
2022-01-04 17:04:05 +08:00
|
|
|
|
}
|
2022-05-14 21:53:52 +08:00
|
|
|
|
},
|
2022-01-04 17:04:05 +08:00
|
|
|
|
setup () {
|
2022-05-14 21:53:52 +08:00
|
|
|
|
const dateRangeValue = 60 * 24
|
2022-01-04 17:04:05 +08:00
|
|
|
|
const { startTime, endTime } = getNowTime(dateRangeValue)
|
|
|
|
|
|
const timeFilter = ref({ startTime, endTime, dateRangeValue })
|
|
|
|
|
|
return {
|
|
|
|
|
|
timeFilter
|
|
|
|
|
|
}
|
2021-12-14 16:42:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|