From b0a7d44c42292c469b7566740b6b1a91b04e482c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com>
Date: Tue, 17 Oct 2023 10:01:32 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddetection=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=BC=BA=E5=B0=91=E6=97=B6=E6=98=BE=E7=A4=BA=E5=BC=82?=
=?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/config.js | 2 +-
src/views/detectionsNew/DetectionDrawer.vue | 12 ++++++------
src/views/detectionsNew/DetectionTable.vue | 3 ++-
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/public/config.js b/public/config.js
index 1bfecd2c..e8347076 100644
--- a/public/config.js
+++ b/public/config.js
@@ -1,5 +1,5 @@
const BASE_CONFIG = {
- baseUrl: 'http://192.168.44.54:8092/',
+ baseUrl: 'http://192.168.44.54:8090/',
version: '23.10',
apiVersion: 'v1'
}
diff --git a/src/views/detectionsNew/DetectionDrawer.vue b/src/views/detectionsNew/DetectionDrawer.vue
index 9223f1ba..45f1e161 100644
--- a/src/views/detectionsNew/DetectionDrawer.vue
+++ b/src/views/detectionsNew/DetectionDrawer.vue
@@ -10,17 +10,17 @@
{{ $t('overall.name') }}
-
{{ detailData.name }}
+
{{ $_.get(detailData, 'name', '-') || '-'}}
{{ $t('overall.type') }}
-
{{ detailData.eventType }}
+
{{ $_.get(detailData, 'eventType', '-') || '-'}}
{{ $t('config.dataSet.description') }}
-
{{ detailData.description }}
+
{{ $_.get(detailData, 'description', '-') || '-' }}
@@ -31,20 +31,20 @@
{{ $t('config.user.source') }}
-
{{ detailData.category }}
+
{{ $_.get(detailData, 'category', '-') || '-' }}
{{ $t('detection.library') }}
-
{{ detailData.ruleConfigObj.knowledgeBase.name }}
+
{{ $_.get(detailData, 'ruleConfigObj.knowledgeBase.name', '-') || '-' }}
{{ $t('detection.level') }}
-
{{ detailData.ruleConfigObj.level }}
+
{{ $_.get(detailData, 'ruleConfigObj.level', '-') || '-' }}
diff --git a/src/views/detectionsNew/DetectionTable.vue b/src/views/detectionsNew/DetectionTable.vue
index 1036b56d..c049835b 100644
--- a/src/views/detectionsNew/DetectionTable.vue
+++ b/src/views/detectionsNew/DetectionTable.vue
@@ -77,6 +77,7 @@
import table from '@/mixins/table'
import { dateFormatByAppearance } from '@/utils/date-util'
import { switchStatus } from '@/utils/tools'
+import _ from 'lodash'
export default {
name: 'DetectionTable',
@@ -151,7 +152,7 @@ export default {
if (n) {
n.forEach(t => {
if (t.ruleType === 'indicator_match') {
- t.library = t.ruleConfigObj.knowledgeBase.name
+ t.library = _.get(t, 'ruleConfigObj.knowledgeBase.name', '-')
} else if (t.ruleType === 'threshold') {
t.dimensions = t.ruleConfigObj.dimensions
}