diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue
index 8ee6ade8..9a99b2ec 100644
--- a/src/views/charts/Chart.vue
+++ b/src/views/charts/Chart.vue
@@ -16,7 +16,7 @@
:chart-data="chartData"
:query-params="queryParams"
:entity="entity"
- @query="query"
+ @getChartData="getChartData"
@showLoading="showLoading"
>
@@ -366,6 +366,9 @@ export default {
getAlarmInfo (url, extraParams, isRefresh, timeFilter) {
this.$emit('getChartData', url, extraParams, isRefresh, timeFilter)
},
+ getChartData (url, extraParams) {
+ this.$emit('getChartData', url, extraParams)
+ },
initEchartsWithTable () {
this.$refs['chart' + this.chartInfo.id] &&
this.$refs['chart' + this.chartInfo.id].initEchartsWithTable(
diff --git a/src/views/charts/PanelChart.vue b/src/views/charts/PanelChart.vue
index f6e74821..5eec4338 100644
--- a/src/views/charts/PanelChart.vue
+++ b/src/views/charts/PanelChart.vue
@@ -53,6 +53,7 @@ import {
isEcharts,
isSingleValue,
isTable,
+ isBasicTable,
isActiveIpTable,
isTitle,
isMap,
@@ -149,14 +150,6 @@ export default {
}
] // table的所有数据
},
- table: {
- pageSize: chartTableDefaultPageSize,
- limit: chartTableTopOptions[0], // top-n
- orderBy: 'sessions',
- tableColumns: [], // table字段
- tableData: [], // table的所有数据
- currentPageData: [] // table当前页的数据
- },
tabHandleClickType: ''
}
},
@@ -255,7 +248,7 @@ export default {
}
if (this.isTable) {
this.table.tableData = response.data.result
- // this.table.tableColumns = chartParams.columns
+ this.table.tableColumns = chartParams.columns
// this.table.tableColumns = this.getTableTitle(response.data.result)
this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
} else if (this.isSingleValue) {
@@ -405,7 +398,7 @@ export default {
const { startTime, endTime } = getNowTime(dateRangeValue)
const chartTimeFilter = ref({ startTime, endTime, dateRangeValue })
let table = {}
- if (isTable(props.chartInfo.type)) {
+ if (isBasicTable(props.chartInfo.type)) {
table = {
pageSize: chartTableDefaultPageSize,
limit: chartTableTopOptions[0], // top-n
diff --git a/src/views/charts/charts/ChartMap.vue b/src/views/charts/charts/ChartMap.vue
index f02c61f0..d4f576cc 100644
--- a/src/views/charts/charts/ChartMap.vue
+++ b/src/views/charts/charts/ChartMap.vue
@@ -14,7 +14,7 @@
class="legend__circle-marker"
:style="`background-color:${markerColors[index].background};border: 1px solid ${markerColors[index].border};`"
>
-
{{legend.value}}
+ {{unitConvert(legend.value, unitTypes.number).join(' ')}}
{{legend.name}}
@@ -25,17 +25,19 @@
import * as am4Core from '@amcharts/amcharts4/core'
import * as am4Maps from '@amcharts/amcharts4/maps'
import { getGeoData, replaceUrlPlaceholder } from '@/utils/tools'
-import { storageKey, dnsServerRole } from '@/utils/constants'
+import { storageKey, dnsServerRole, unitTypes } from '@/utils/constants'
import { isMapBlock, isMapPoint } from './tools'
import unitConvert, { valueToRangeValue } from '@/utils/unit-convert'
import { HeatLegend } from '@/components/amcharts/heatLegend'
import { getData } from '@/utils/api'
import chartMixin from './chart-mixin'
+import _ from 'lodash'
export default {
name: 'ChartMap',
data () {
return {
+ unitTypes,
myChart: null,
mapPictureUrl: '/Tiles/{z}/{x}/{y}.png',
showMapBackButton: false,
@@ -62,15 +64,12 @@ export default {
name: this.$t('dns.publicRecursiveDomainServers'),
type: dnsServerRole.OPRDNS,
value: 0
- }/*,
- {
- name: this.$t('dns.rootDomainServers'),
- value: 0
},
{
- name: this.$t('dns.rootDomainServers'),
+ name: this.$t('dns.selfBuiltDomainServers'),
+ type: dnsServerRole.SBDNS,
value: 0
- } */
+ }
],
markerColors: [
{
@@ -102,6 +101,7 @@ export default {
},
mixins: [chartMixin],
methods: {
+ unitConvert,
initMap (id) {
const chart = am4Core.create(id, am4Maps.MapChart)
chart.geodata = getGeoData(storageKey.iso36112WorldLow)
@@ -144,6 +144,16 @@ export default {
}
}
})
+ // dns地图legend上的数据
+ if (!_.isEmpty(this.chartInfo.params.legendUrl)) {
+ setTimeout(() => {
+ this.chartInfo.params.legendUrl.forEach((url, i) => {
+ getData(url).then(data => {
+ this.legends[i].value = data
+ })
+ })
+ })
+ }
},
loadAm4ChartMap (polygonSeries, country, chartData) {
// chartData不为空是下钻
@@ -288,7 +298,7 @@ export default {
},
changeLegend (index) {
this.currentLegendIndex = index
- this.$emit('query', { dnsServerRole: this.legends[index].type })
+ this.$emit('getChartData', null, { dnsServerRole: this.legends[index].type })
},
dnsTypeI18n (role) {
let i18n = ''
diff --git a/src/views/charts/charts/ChartTable.vue b/src/views/charts/charts/ChartTable.vue
index 3bed0d48..7980a893 100644
--- a/src/views/charts/charts/ChartTable.vue
+++ b/src/views/charts/charts/ChartTable.vue
@@ -31,6 +31,9 @@
{{unitConvert(row[c], unitTypes.number).join(' ')}}
+
+ {{unitConvert(row[c] * 100, unitTypes.percent).join(' ')}}%
+
{{row[c]}}
diff --git a/src/views/detections/DetectionSearch.vue b/src/views/detections/DetectionSearch.vue
index bdbfc14d..993f629c 100644
--- a/src/views/detections/DetectionSearch.vue
+++ b/src/views/detections/DetectionSearch.vue
@@ -40,6 +40,11 @@ export default {
type: 'string',
label: 'Security type'
},
+ {
+ name: 'event_type',
+ type: 'string',
+ label: 'Event type'
+ },
{
name: 'victim_ip',
type: 'string',