feat: CN-1592 UI 新增Tag检索界面(新增修改部分,导入数据部分未完成)
This commit is contained in:
BIN
public/assets/tagTemplate.zip
Normal file
BIN
public/assets/tagTemplate.zip
Normal file
Binary file not shown.
@@ -286,15 +286,15 @@
|
||||
box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
|
||||
border-radius: 12px;
|
||||
}
|
||||
.unknow {
|
||||
.unknow-list {
|
||||
background-color:rgba(119,131,145,0.1) !important;
|
||||
color:rgb(119,131,145)
|
||||
}
|
||||
.benign {
|
||||
.benign-list {
|
||||
background-color:rgba(116,159,77,0.1) !important;
|
||||
color:rgb(116,159,77)
|
||||
}
|
||||
.malicious {
|
||||
.malicious-list {
|
||||
background-color:rgba(226,97,84,0.1) !important;
|
||||
color:rgb(226,97,84)
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ export default {
|
||||
const vm = this
|
||||
return function (intent) {
|
||||
const t = vm.tagIntentColor.find(t => t.intent === intent)
|
||||
return t ? t.name : vm.tagIntentColor[0].name
|
||||
return t ? t.name+'-list' : vm.tagIntentColor[0].name+'-list'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,6 +14,24 @@ if (openMock) {
|
||||
}
|
||||
}
|
||||
})
|
||||
Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'v1/tag/.*'), 'post', function (requestObj) {
|
||||
return {
|
||||
"msg": "success",
|
||||
"code": 200,
|
||||
"data": {
|
||||
"id": "标签UUID"
|
||||
}
|
||||
}
|
||||
})
|
||||
Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'v1/tag/.*'), 'put', function (requestObj) {
|
||||
return {
|
||||
"msg": "success",
|
||||
"code": 200,
|
||||
"data": {
|
||||
"id": "标签UUID"
|
||||
}
|
||||
}
|
||||
})
|
||||
Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'v1/tag/list.*'), 'get', function (requestObj) {
|
||||
return {
|
||||
msg: 'success',
|
||||
@@ -171,4 +189,46 @@ if (openMock) {
|
||||
}
|
||||
}
|
||||
})
|
||||
Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'v1/tag/.*'), 'get', function (requestObj) {
|
||||
return {
|
||||
"code": 200,
|
||||
"message": "success",
|
||||
"data": {
|
||||
"pageNo": 1,
|
||||
"pageSize": 10,
|
||||
"total": 5,
|
||||
"id": "08b2a4cd-1c38-4be1-b641-8e5b607e2075",
|
||||
"name": "tag???",
|
||||
"category": "categoty1",
|
||||
"indicatorType": "Domain",
|
||||
"intent": "Benign",
|
||||
"description": " tag1 description",
|
||||
"isBuiltIn": 1,
|
||||
"createdTime": 1685412014,
|
||||
"updatedTime": 1685412014,
|
||||
"itemList": [
|
||||
{
|
||||
"id": 1,
|
||||
"EntityType": "Domain",
|
||||
"EntityValue": "www.baidu.com"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"EntityType": "IP",
|
||||
"EntityValue": "172.0.0.0/8"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"EntityType": "IP",
|
||||
"EntityValue": "192.168.44.12"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"EntityType": "IP",
|
||||
"EntityValue": "192.168.44.13-192.168.44.14"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -164,13 +164,18 @@ export function handleComponent (code) {
|
||||
return () => import('@/views/report/Report')
|
||||
case 'tag':
|
||||
return () => import('@/views/tag/Tag')
|
||||
case 'createUserDefinedLibrary':
|
||||
case 'editUserDefinedLibrary':
|
||||
return () => import('@/views/tag/TagForm')
|
||||
case 'knowledgeBase':
|
||||
return () => import('@/views/setting/KnowledgeBase')
|
||||
case 'userDefinedLibrary':
|
||||
return () => import('@/views/setting/KnowledgeBaseUserDefinedList')
|
||||
case 'createUserDefinedLibrary':
|
||||
case 'editUserDefinedLibrary':
|
||||
return () => import('@/views/setting/KnowledgeBaseForm')
|
||||
return () => import('@/views/tag/Tag')
|
||||
//case 'userDefinedLibrary':
|
||||
//return () => import('@/views/setting/KnowledgeBaseUserDefinedList')
|
||||
//case 'createUserDefinedLibrary':
|
||||
//case 'editUserDefinedLibrary':
|
||||
//return () => import('@/views/setting/KnowledgeBaseForm')
|
||||
case 'administration':
|
||||
return () => import('@/views/administration/Index')
|
||||
case 'user':
|
||||
|
||||
@@ -62,7 +62,7 @@ export const api = {
|
||||
reportView: '/report/job/view',
|
||||
// tag 相关
|
||||
tagList: '/v1/tag/list',
|
||||
tagDelete: '/v1/tag/',
|
||||
tag: '/v1/tag',
|
||||
tagIndicatorStatistics: '/v1/tag/{{name}}/indicator/statistics',
|
||||
tagIndicatorTrend: '/v1/tag/{{name}}/indicator/trend',
|
||||
tagTrafficEntityStatistics: '/v1/tag/{{name}}/trafficEntity/statistics',
|
||||
|
||||
@@ -432,6 +432,19 @@ export const itemListHeight = {
|
||||
noData: 250
|
||||
}
|
||||
|
||||
export const tagType = [
|
||||
{
|
||||
label: 'IP',
|
||||
value: 'IP',
|
||||
name: 'ip'
|
||||
},
|
||||
{
|
||||
label: 'Domain',
|
||||
value: 'Domain',
|
||||
name: 'domain'
|
||||
}
|
||||
]
|
||||
|
||||
export const knowledgeBaseType = [
|
||||
{
|
||||
label: 'IP',
|
||||
@@ -483,6 +496,24 @@ export const tagIntentColor = [
|
||||
}
|
||||
]
|
||||
|
||||
export const tagIntent = [
|
||||
{
|
||||
label: 'tag.intent.unknown',
|
||||
value: 'Unknow',
|
||||
name: 'info'
|
||||
},
|
||||
{
|
||||
label: 'tag.intent.benign',
|
||||
value: 'Benign',
|
||||
name: 'benign'
|
||||
},
|
||||
{
|
||||
label: 'tag.intent.malicious',
|
||||
value: 'Malicious',
|
||||
name: 'malicious'
|
||||
}
|
||||
]
|
||||
|
||||
export const knowledgeBaseColor = [
|
||||
{
|
||||
label: 'knowledge.info',
|
||||
@@ -505,6 +536,9 @@ export const knowledgeCategoryValue = {
|
||||
aiTagging: 'ai_tagging',
|
||||
userDefined: 'user_defined'
|
||||
}
|
||||
export const tagCategoryValue = {
|
||||
userDefined: 'user_defined'
|
||||
}
|
||||
export const knowledgeSourceValue = {
|
||||
fqdnCategory: 'cn_fqdn_category_built_in',
|
||||
iocMalware: 'cn_ioc_malware',
|
||||
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.toggleLoading(true)
|
||||
axios.delete(api.tagDelete + ids).then(response => {
|
||||
axios.delete(api.tag + ids).then(response => {
|
||||
if (response.status === 200) {
|
||||
this.delFlag = true
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||
@@ -260,6 +260,14 @@ export default {
|
||||
}
|
||||
this.isInit = false
|
||||
},
|
||||
add () {
|
||||
this.$router.push({
|
||||
path: '/tag/userDefined/create',
|
||||
query: {
|
||||
t: +new Date()
|
||||
}
|
||||
})
|
||||
},
|
||||
edit (u) {
|
||||
this.initConfig(u)
|
||||
this.object = u
|
||||
@@ -272,12 +280,20 @@ export default {
|
||||
type: 'warning'
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
const curRecord = this.batchDeleteObjs[0]
|
||||
this.initConfig(curRecord)
|
||||
this.object = curRecord
|
||||
this.rightBox.show = true
|
||||
this.jumpToEditPage(this.batchDeleteObjs[0].id)
|
||||
}
|
||||
},
|
||||
jumpToEditPage (id) {
|
||||
const pageNo = this.$router.currentRoute.value.query.pageNo
|
||||
this.$router.push({
|
||||
path: '/tag/userDefined/edit',
|
||||
query: {
|
||||
t: +new Date(),
|
||||
pageNoForTable: pageNo || 1,
|
||||
id: id
|
||||
}
|
||||
})
|
||||
},
|
||||
initConfig (u) {
|
||||
if (!u.config) {
|
||||
u.config = {
|
||||
|
||||
1540
src/views/tag/TagForm.vue
Normal file
1540
src/views/tag/TagForm.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user