diff --git a/src/assets/css/components/views/detections/detection-drawer.scss b/src/assets/css/components/views/detections/detection-drawer.scss
index 415e0086..3d9eb68c 100644
--- a/src/assets/css/components/views/detections/detection-drawer.scss
+++ b/src/assets/css/components/views/detections/detection-drawer.scss
@@ -34,6 +34,15 @@
.drawer-basic-id {
margin-bottom: 10px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ i {
+ font-size: 14px;
+ font-weight: 400;
+ cursor: pointer;
+ }
}
}
}
diff --git a/src/views/detections/detectionPolicies/Index.vue b/src/views/detections/detectionPolicies/Index.vue
index 5dd73e3f..351c1d1e 100644
--- a/src/views/detections/detectionPolicies/Index.vue
+++ b/src/views/detections/detectionPolicies/Index.vue
@@ -30,6 +30,7 @@
:isNoData="isNoData"
:custom-table-title="tools.customTableTitle"
:table-data="tableData"
+ :policy-detail="policyDetail"
:is-selected-status="isSelectedStatus"
:all-count="18"
@selectionChange="selectionChange"
@@ -75,7 +76,7 @@
-
+
@@ -89,6 +90,7 @@ import { api } from '@/utils/api'
import dataListMixin from '@/mixins/data-list'
import DetectionDrawer from '@/views/detections/detectionPolicies/PolicyDrawer'
import axios from 'axios'
+import { useRoute } from 'vue-router'
export default {
name: 'Index',
@@ -118,10 +120,36 @@ export default {
drawerInfo: {},
filterParams: {},
policyTotal: 0,
- policyEnabledNum: 0
+ policyEnabledNum: 0,
+ policyDetail: {}
+ }
+ },
+ mounted () {
+ const { query } = useRoute()
+ if (query.name && query.ruleId) {
+ this.getPolicyDetail(query.ruleId)
}
},
methods: {
+ getPolicyDetail (id) {
+ if (id) {
+ axios.get(`${api.detection.detail}/${id}`).then(res => {
+ if (res.status === 200) {
+ if (!res.data.data) {
+ throw new Error('No data found, id: ' + this.ruleId)
+ }
+ this.policyDetail = res.data.data
+ this.selectionChange([res.data.data])
+ this.onRowDoubleClick(res.data.data)
+ } else {
+ console.error(res.data)
+ }
+ }).catch(e => {
+ console.error(e)
+ this.$message.error(this.errorMsgHandler(e))
+ })
+ }
+ },
onSearch (keyWord) {
this.filterParams = {
...this.filterParams,
@@ -153,7 +181,8 @@ export default {
query: {
t: +new Date(),
pageNoForTable: pageNo || 1,
- id: this.batchDeleteObjs[0].ruleId
+ id: this.batchDeleteObjs[0].ruleId,
+ name: this.$route.query.name || ''
}
})
},
diff --git a/src/views/detections/detectionPolicies/PolicyDrawer.vue b/src/views/detections/detectionPolicies/PolicyDrawer.vue
index e13bc3e9..27516a27 100644
--- a/src/views/detections/detectionPolicies/PolicyDrawer.vue
+++ b/src/views/detections/detectionPolicies/PolicyDrawer.vue
@@ -2,7 +2,10 @@
-
-
-
{{ $t('detection.policyId') }}
-
{{ $_.get(basicInfo, 'ruleInfo.ruleId', '-') || '-' }}
-
-
-
{{ $t('detection.policyName') }}
-
- {{ $_.get(basicInfo, 'ruleInfo.name', '-') || '-' }}
-
-
-
+
+
{{ $t('detections.goToPolicy') }}
+
+
+ {{ $t('detections.viewDetailOf') }}
+
+ {{ $_.get(basicInfo, 'ruleInfo.name', '-') || '-' }} (ID: {{ $_.get(basicInfo, 'ruleInfo.ruleId', '-') || '-' }})
+
+
+
+
{{ $t('detections.goToVictim') }}
@@ -515,7 +514,8 @@ export default {
path: '/detection/policy',
query: {
t: +new Date(),
- name: this.basicInfo.ruleInfo.name
+ name: this.basicInfo.ruleInfo.name,
+ ruleId: this.basicInfo.ruleInfo.ruleId
}
})
window.open(href, '_blank')