diff --git a/public/config.js b/public/config.js
index 3d59b49f..88758d4d 100644
--- a/public/config.js
+++ b/public/config.js
@@ -1,4 +1,5 @@
var BASE_CONFIG = {
- baseUrl: 'http://192.168.44.54:8090/',
- version: '2.0.2021.05.11.19.43'
-}
+ baseUrl: 'http://192.168.44.54:8091/',
+ version: '23.06',
+ apiVersion:'v1'
+}
\ No newline at end of file
diff --git a/src/assets/css/components/views/setting/knowledgeBase.scss b/src/assets/css/components/views/setting/knowledgeBase.scss
index d5f3d62f..8d607570 100644
--- a/src/assets/css/components/views/setting/knowledgeBase.scss
+++ b/src/assets/css/components/views/setting/knowledgeBase.scss
@@ -95,8 +95,29 @@
}
}
.filter__body {
- padding: 0 0 0 20px;
-
+ padding: 3px 0 0 20px;
+ .el-tree {
+ font-size:14px;
+ color: #353636;
+ font-weight: 400;
+ .el-tree-node {
+ .el-tree-node__content {
+ margin-bottom: 2px;
+ .custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding-right: 20px;
+ font-size: 14px;
+ font-weight: 400;
+ .count-tree-node {
+ color: #717171;
+ }
+ }
+ }
+ }
+ }
.el-checkbox-group {
display: flex;
flex-direction: column;
@@ -113,6 +134,15 @@
border-radius: 2px;
}
}
+ .el-checkbox__input.is-indeterminate .el-checkbox__inner {
+ border-color: #38ACD2;
+ background: #38ACD2;
+ border-radius: 2px;
+ }
+ .el-checkbox__input.is-indeterminate .el-checkbox__inner:before {
+ background: #FFFFFF;
+ border-radius: 1px;
+ }
.el-checkbox__input.is-checked {
.el-checkbox__inner {
border-color: #38ACD2;
@@ -526,16 +556,34 @@
padding-right:16px;
padding-bottom:20px;
.card-type {
- height:20px;
- width: fit-content;
- padding-left:11px;
- padding-right:11px;
- background: rgba(56,172,210,0.10);
- box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
- border-radius: 10px;
- font-size: 12px;
- color: #046ECA;
- font-weight: 400;
+ display:flex;
+ flex-direction:row;
+ .card-category {
+ font-size: 12px;
+ line-height: 16px;
+ color: #38ACD2;
+ font-weight: 400;
+ border: 1px solid rgba(56,172,210,1);
+ height:20px;
+ width: fit-content;
+ padding-left:11px;
+ padding-right:11px;
+ box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
+ border-radius: 10px;
+ margin-right:4px;
+ }
+ .card-source {
+ height:20px;
+ width: fit-content;
+ padding-left:11px;
+ padding-right:11px;
+ background: rgba(56,172,210,0.10);
+ box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
+ border-radius: 10px;
+ font-size: 12px;
+ color: #046ECA;
+ font-weight: 400;
+ }
}
.card-enable {
}
@@ -576,6 +624,12 @@
padding-left: 20px;
overflow: auto;
+ .enable-form__mt {
+ .el-form {
+ margin-top:6px;
+ }
+ }
+
.el-steps {
margin-left: 10px;
diff --git a/src/components/table/setting/KnowledgeBaseTableForRow.vue b/src/components/table/setting/KnowledgeBaseTableForRow.vue
index 1c544124..569131dd 100644
--- a/src/components/table/setting/KnowledgeBaseTableForRow.vue
+++ b/src/components/table/setting/KnowledgeBaseTableForRow.vue
@@ -33,21 +33,24 @@
-
+
- {{$t(scope.row.i18n)}}
+ {{$t(scope.row.i18n)}}
- {{scope.row.name}}
+ {{scope.row.name}}
-
-
- {{tagTypeText(scope.row[item.prop])}}
+
+ {{tagCategoryText(scope.row[item.prop])}}
-
+
+ {{tagSourceText(scope.row[item.prop])}}
+
+
{{dateFormatByAppearance(scope.row[item.prop])}}
@@ -63,9 +66,18 @@
-
-
+
{{scope.row[item.prop]}}
+
+
+
+
{{scope.row[item.prop] || '-'}}
@@ -74,7 +86,7 @@
diff --git a/src/mixins/data-list.js b/src/mixins/data-list.js
index ac873661..0c6ff30e 100644
--- a/src/mixins/data-list.js
+++ b/src/mixins/data-list.js
@@ -74,29 +74,6 @@ export default {
break
}
},
- checkboxStatusChange (isCheck, data) {
- if (isCheck) {
- const delObj = this.batchDeleteObjs.find(item => item.id === data.id)
- if (delObj === undefined) {
- this.batchDeleteObjs.push(data)
- }
- } else {
- const cancleObjIndex = this.batchDeleteObjs.findIndex(item => item.id === data.id)
- if (cancleObjIndex > -1) {
- this.batchDeleteObjs.splice(cancleObjIndex, 1)
- }
- }
- if (this.batchDeleteObjs.length > 1) {
- this.disableEdit = true
- } else {
- this.disableEdit = false
- }
- if (this.batchDeleteObjs.length >= 1) {
- this.disableDelete = false
- } else {
- this.disableDelete = true
- }
- },
selectionChange (objs) {
this.batchDeleteObjs = []
objs.forEach(obj => {
@@ -120,7 +97,8 @@ export default {
if (isAll) {
this.searchLabel = null
} else if (isClearType) {
- this.searchLabel.tagType = ''
+ // this.searchLabel.tagType = ''
+ this.searchLabel.type = ''// 换新接口需要修改的属性名称
}
if (params) {
this.searchLabel = { ...this.searchLabel, ...params }
@@ -136,7 +114,7 @@ export default {
this.tools.loading = false
if (response.code === 200) {
for (let i = 0; i < response.data.list.length; i++) {
- response.data.list[i].status = response.data.list[i].status + ''
+ response.data.list[i].status = response.data.list[i].status === 1
}
this.tableData = response.data.list
this.pageObj.total = response.data.total
@@ -364,7 +342,7 @@ export default {
},
dragend () {
this.$nextTick(() => {
- if (this.$refs.dataTable.$refs.dataTable) {
+ if (this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
this.$refs.dataTable.$refs.dataTable.doLayout()
}
})
diff --git a/src/mixins/table.js b/src/mixins/table.js
index 34823de0..7f818d0d 100644
--- a/src/mixins/table.js
+++ b/src/mixins/table.js
@@ -1,5 +1,7 @@
import { chartTableOrderOptionsMapping, storageKey } from '@/utils/constants'
import { getWidthByLanguage } from '@/utils/tools'
+import { put, patch } from '@/utils/http'
+import { api } from '@/utils/api'
export default {
props: {
tableData: {
@@ -99,6 +101,21 @@ export default {
})
}
},
+ changeStatus (status, id) {
+ const statusNum = status ? 1 : 0
+ patch(api.knowledgeBaseEnable, { list: [{ knowledgeId: id, status: 0 }] }).then(response => {
+ if (response.code === 200) {
+
+ } else {
+ console.error(response)
+ if (response.message) {
+ this.$message.error(response.message)
+ } else {
+ this.$message.error('Something went wrong...')
+ }
+ }
+ })
+ },
tableOperation ([command, row]) {
switch (command) {
default:
diff --git a/src/utils/api.js b/src/utils/api.js
index 0cf53039..f1bf2236 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -35,7 +35,9 @@ export const api = {
// galaxyProxy
galaxyProxy: '/galaxy/setting',
// 知识库
- knowledgeBase: '/knowledgeBase',
+ knowledgeBase: BASE_CONFIG.apiVersion + '/knowledgeBase',
+ knowledgeBaseList: BASE_CONFIG.apiVersion + '/knowledgeBase/list',
+ knowledgeBaseEnable: BASE_CONFIG.apiVersion + '/knowledgeBase/status',
// 报告相关
reportJob: '/report/job',
diff --git a/src/utils/constants.js b/src/utils/constants.js
index 4192c0e3..c3696ebe 100644
--- a/src/utils/constants.js
+++ b/src/utils/constants.js
@@ -299,18 +299,97 @@ export const cycle = {
pre: 1
}
+export const itemListHeight = {
+ hasData: 478,
+ noData: 250
+}
+
export const knowledgeBaseType = [
{
- name: 'IP',
- value: 'ip'
+ label: 'IP',
+ value: 'cn_ip_tag_user_defined',
+ name: 'ip'
},
{
- name: 'Domain',
- value: 'domain'
+ label: 'Domain',
+ value: 'cn_domain_tag_user_defined',
+ name: 'domain'
},
{
- name: 'APP',
- value: 'app'
+ label: 'APP',
+ value: 'cn_app_tag_user_defined',
+ name: 'app'
+ }
+]
+
+export const knowledgeBaseCategory = [
+ {
+ name: 'WebSketch',
+ value: 'websketch'
+ },
+ {
+ name: 'AI Tagging',
+ value: 'ai_tagging'
+ },
+ {
+ name: 'User-defined',
+ value: 'user_defined'
+ }
+]
+
+export const knowledgeCategoryValue = {
+ webSketch: 'websketch',
+ aiTagging: 'ai_tagging',
+ userDefined: 'user_defined'
+}
+export const knowledgeSourceValue = {
+ fqdnCategory: 'cn_fqdn_category_built_in',
+ iocMalware: 'cn_ioc_malware',
+ iocDarkweb: 'cn_ioc_darkweb',
+ ipLocation: 'cn_ip_location_built_in',
+ asn: 'cn_ip_asn_built_in',
+ psiphon3: 'cn_psiphon3_ip',
+ ipTag: 'cn_ip_tag_user_defined',
+ domainTag: 'cn_domain_tag_user_defined',
+ appTag: 'cn_app_tag_user_defined'
+}
+
+export const knowledgeBaseSource = [
+ {
+ name: 'FQDN Category',
+ value: 'cn_fqdn_category_built_in'
+ },
+ {
+ name: 'Ioc Malware',
+ value: 'cn_ioc_malware'
+ },
+ {
+ name: 'Ioc Darkweb',
+ value: 'cn_ioc_darkweb'
+ },
+ {
+ name: 'IP Location',
+ value: 'cn_ip_location_built_in'
+ },
+ {
+ name: 'ASN',
+ value: 'cn_ip_asn_built_in'
+ },
+ {
+ name: 'Psiphon3',
+ value: 'cn_psiphon3_ip'
+ },
+ {
+ name: 'IP Tag',
+ value: 'cn_ip_tag_user_defined'
+ },
+ {
+ name: 'Domain Tag',
+ value: 'cn_domain_tag_user_defined'
+ },
+ {
+ name: 'APP Tag',
+ value: 'cn_app_tag_user_defined'
}
]
diff --git a/src/utils/http.js b/src/utils/http.js
index f11ba264..02b4988a 100644
--- a/src/utils/http.js
+++ b/src/utils/http.js
@@ -142,6 +142,21 @@ export function put (url, params, headers) {
})
}
+export function patch (url, params, headers) {
+ return new Promise((resolve) => {
+ axios.patch(url, params, { headers: headers }).then(response => {
+ resolve(response.data, response)
+ }).catch(err => {
+ if (err.response) {
+ resolve(err.response.data)
+ console.error(err)
+ } else if (err.message) {
+ resolve(err.message)
+ }
+ })
+ })
+}
+
export function del (url, params) {
return new Promise((resolve) => {
axios.delete(url, params).then(response => {
diff --git a/src/views/setting/KnowledgeBase.vue b/src/views/setting/KnowledgeBase.vue
index 916a509b..39bb41c9 100644
--- a/src/views/setting/KnowledgeBase.vue
+++ b/src/views/setting/KnowledgeBase.vue
@@ -18,12 +18,18 @@
{{$t('overall.create')}}
-
+