From 328868f497242493ebb5d82c05be379fde286427 Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Fri, 18 Mar 2022 18:25:50 +0800 Subject: [PATCH] =?UTF-8?q?CN-399=20Detection--=E6=9C=8D=E5=8A=A1=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E4=BA=8B=E4=BB=B6=20=E6=8C=87=E6=A0=87=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E6=9B=B2=E7=BA=BF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/detections/detection-overview.scss | 25 ++++ src/utils/api.js | 3 +- .../detections/options/detectionOptions.js | 76 +++++++++++- ...etectionPerformanceEventDomainOverview.vue | 113 +++++++++++++++++- .../DetectionPerformanceEventIpOverview.vue | 110 ++++++++++++++++- 5 files changed, 319 insertions(+), 8 deletions(-) diff --git a/src/assets/css/components/views/detections/detection-overview.scss b/src/assets/css/components/views/detections/detection-overview.scss index 0a7b2c51..1cb56c55 100644 --- a/src/assets/css/components/views/detections/detection-overview.scss +++ b/src/assets/css/components/views/detections/detection-overview.scss @@ -8,6 +8,18 @@ display: flex; flex-direction: column; + .overview__metric { + display:flex; + flex-direction: row; + padding-top: 10px; + + .metric__column { + display:flex; + flex-direction: column; + margin-right: 15px; + } + } + .overview__title { padding: 10px 0; color: #333; @@ -33,6 +45,19 @@ color: #6B717B; } + .row__charts { + height: 20px; + width: 80px; + } + + .row__content--metric { + display: flex; + flex-wrap: nowrap; + color: #666666; + font-size:14px; + font-weight: 400; + } + .row__content { display: flex; color: #3976CB; diff --git a/src/utils/api.js b/src/utils/api.js index de3fa60a..d365a70b 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -93,7 +93,8 @@ export const api = { activeEntity: '/interface/detection/performance/filter/activeEntity', listBasic: '/interface/detection/performance/list/basic', listCount: '/interface/detection/performance/list/count', - overviewBasic: '/interface/detection/performance/detail/overview/basic' + overviewBasic: '/interface/detection/performance/detail/overview/basic', + metric:'/interface/detection/performance/detail/overview/metric' } } } diff --git a/src/views/detections/options/detectionOptions.js b/src/views/detections/options/detectionOptions.js index 4455a2e8..35d09d0e 100644 --- a/src/views/detections/options/detectionOptions.js +++ b/src/views/detections/options/detectionOptions.js @@ -1,6 +1,7 @@ import { chartColor, - tooLongFormatter + tooLongFormatter, + axisFormatter } from '@/views/charts/charts/tools' import unitConvert from '@/utils/unit-convert' import _ from 'lodash' @@ -286,3 +287,76 @@ export const activeAttackBar = { barCategoryGap: '10%' }] } +export const metricOption = { + tooltip: { + appendToBody: true, + trigger: 'axis', + textStyle: { + width: '20px', + overflow: 'truncate' + }, + //formatter: axisFormatter, + show: true, + className: 'nz-chart-tooltip', + extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' + }, + xAxis: { + type: 'time', + show: false + }, + yAxis: { + type: 'value', + show: false + }, + animation: false, + grid: { + left: 0, + bottom: 2, + top: 5, + right: 0 + }, + legend: { + show: false + }, + series: [ + { + name:'metric', + type: 'line', + legendHoverLink: false, + lineStyle: { + width: 1, + type:'dashed' + }, + color: '#ec836c', + data: [], + showSymbol: false + }, + { + name:'metric', + type: 'line', + legendHoverLink: false, + lineStyle: { + width: 1, + type:'solid' + }, + areaStyle: { + color: 'rgba(244, 187, 174, 0.59)' + }, + color: '#ec836c', + data: [], + showSymbol: false + }, + { + name:'metric', + type: 'line', + legendHoverLink: false, + lineStyle: { + width: 1, + type:'dashed' + }, + color: '#ec836c', + data: [], + showSymbol: false + } + ] +} diff --git a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue index 4a499d6b..1e3506dd 100644 --- a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue @@ -59,13 +59,45 @@
+
+
+
{{$t('detections.metric')}}
+
+
{{detection.domain || '-'}}
+
+
+
+
{{$t('detections.value')}}
+
+
+
+
+
+
{{$t('detections.startTime')}}
+
+
{{dayJs.tz(detection.startTime*1000).format('YYYY-MM-DD HH:mm:ss') || '-'}}
+
+
+
+
{{$t('detections.endTime')}}
+
+
{{dayJs.tz(detection.endTime*1000).format('YYYY-MM-DD HH:mm:ss') || '-'}}
+
+
+
+ diff --git a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue index 1704228f..a2d49981 100644 --- a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue @@ -50,12 +50,45 @@
+
+
+
{{$t('detections.metric')}}
+
+
{{detection.serverIp || '-'}}
+
+
+
+
{{$t('detections.value')}}
+
+
+
+
+
+
{{$t('detections.startTime')}}
+
+
{{dayJs.tz(detection.startTime*1000).format('YYYY-MM-DD HH:mm:ss') || '-'}}
+
+
+
+
{{$t('detections.endTime')}}
+
+
{{dayJs.tz(detection.endTime*1000).format('YYYY-MM-DD HH:mm:ss') || '-'}}
+
+
+
+