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);
|
box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
}
|
}
|
||||||
.unknow {
|
.unknow-list {
|
||||||
background-color:rgba(119,131,145,0.1) !important;
|
background-color:rgba(119,131,145,0.1) !important;
|
||||||
color:rgb(119,131,145)
|
color:rgb(119,131,145)
|
||||||
}
|
}
|
||||||
.benign {
|
.benign-list {
|
||||||
background-color:rgba(116,159,77,0.1) !important;
|
background-color:rgba(116,159,77,0.1) !important;
|
||||||
color:rgb(116,159,77)
|
color:rgb(116,159,77)
|
||||||
}
|
}
|
||||||
.malicious {
|
.malicious-list {
|
||||||
background-color:rgba(226,97,84,0.1) !important;
|
background-color:rgba(226,97,84,0.1) !important;
|
||||||
color:rgb(226,97,84)
|
color:rgb(226,97,84)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ export default {
|
|||||||
const vm = this
|
const vm = this
|
||||||
return function (intent) {
|
return function (intent) {
|
||||||
const t = vm.tagIntentColor.find(t => t.intent === 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) {
|
Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'v1/tag/list.*'), 'get', function (requestObj) {
|
||||||
return {
|
return {
|
||||||
msg: 'success',
|
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')
|
return () => import('@/views/report/Report')
|
||||||
case 'tag':
|
case 'tag':
|
||||||
return () => import('@/views/tag/Tag')
|
return () => import('@/views/tag/Tag')
|
||||||
|
case 'createUserDefinedLibrary':
|
||||||
|
case 'editUserDefinedLibrary':
|
||||||
|
return () => import('@/views/tag/TagForm')
|
||||||
case 'knowledgeBase':
|
case 'knowledgeBase':
|
||||||
return () => import('@/views/setting/KnowledgeBase')
|
return () => import('@/views/setting/KnowledgeBase')
|
||||||
case 'userDefinedLibrary':
|
case 'userDefinedLibrary':
|
||||||
return () => import('@/views/setting/KnowledgeBaseUserDefinedList')
|
return () => import('@/views/tag/Tag')
|
||||||
case 'createUserDefinedLibrary':
|
//case 'userDefinedLibrary':
|
||||||
case 'editUserDefinedLibrary':
|
//return () => import('@/views/setting/KnowledgeBaseUserDefinedList')
|
||||||
return () => import('@/views/setting/KnowledgeBaseForm')
|
//case 'createUserDefinedLibrary':
|
||||||
|
//case 'editUserDefinedLibrary':
|
||||||
|
//return () => import('@/views/setting/KnowledgeBaseForm')
|
||||||
case 'administration':
|
case 'administration':
|
||||||
return () => import('@/views/administration/Index')
|
return () => import('@/views/administration/Index')
|
||||||
case 'user':
|
case 'user':
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const api = {
|
|||||||
reportView: '/report/job/view',
|
reportView: '/report/job/view',
|
||||||
// tag 相关
|
// tag 相关
|
||||||
tagList: '/v1/tag/list',
|
tagList: '/v1/tag/list',
|
||||||
tagDelete: '/v1/tag/',
|
tag: '/v1/tag',
|
||||||
tagIndicatorStatistics: '/v1/tag/{{name}}/indicator/statistics',
|
tagIndicatorStatistics: '/v1/tag/{{name}}/indicator/statistics',
|
||||||
tagIndicatorTrend: '/v1/tag/{{name}}/indicator/trend',
|
tagIndicatorTrend: '/v1/tag/{{name}}/indicator/trend',
|
||||||
tagTrafficEntityStatistics: '/v1/tag/{{name}}/trafficEntity/statistics',
|
tagTrafficEntityStatistics: '/v1/tag/{{name}}/trafficEntity/statistics',
|
||||||
|
|||||||
@@ -432,6 +432,19 @@ export const itemListHeight = {
|
|||||||
noData: 250
|
noData: 250
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const tagType = [
|
||||||
|
{
|
||||||
|
label: 'IP',
|
||||||
|
value: 'IP',
|
||||||
|
name: 'ip'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Domain',
|
||||||
|
value: 'Domain',
|
||||||
|
name: 'domain'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
export const knowledgeBaseType = [
|
export const knowledgeBaseType = [
|
||||||
{
|
{
|
||||||
label: 'IP',
|
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 = [
|
export const knowledgeBaseColor = [
|
||||||
{
|
{
|
||||||
label: 'knowledge.info',
|
label: 'knowledge.info',
|
||||||
@@ -505,6 +536,9 @@ export const knowledgeCategoryValue = {
|
|||||||
aiTagging: 'ai_tagging',
|
aiTagging: 'ai_tagging',
|
||||||
userDefined: 'user_defined'
|
userDefined: 'user_defined'
|
||||||
}
|
}
|
||||||
|
export const tagCategoryValue = {
|
||||||
|
userDefined: 'user_defined'
|
||||||
|
}
|
||||||
export const knowledgeSourceValue = {
|
export const knowledgeSourceValue = {
|
||||||
fqdnCategory: 'cn_fqdn_category_built_in',
|
fqdnCategory: 'cn_fqdn_category_built_in',
|
||||||
iocMalware: 'cn_ioc_malware',
|
iocMalware: 'cn_ioc_malware',
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.toggleLoading(true)
|
this.toggleLoading(true)
|
||||||
axios.delete(api.tagDelete + ids).then(response => {
|
axios.delete(api.tag + ids).then(response => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
this.delFlag = true
|
this.delFlag = true
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||||
@@ -260,6 +260,14 @@ export default {
|
|||||||
}
|
}
|
||||||
this.isInit = false
|
this.isInit = false
|
||||||
},
|
},
|
||||||
|
add () {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/tag/userDefined/create',
|
||||||
|
query: {
|
||||||
|
t: +new Date()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
edit (u) {
|
edit (u) {
|
||||||
this.initConfig(u)
|
this.initConfig(u)
|
||||||
this.object = u
|
this.object = u
|
||||||
@@ -272,12 +280,20 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
} else {
|
} else {
|
||||||
const curRecord = this.batchDeleteObjs[0]
|
this.jumpToEditPage(this.batchDeleteObjs[0].id)
|
||||||
this.initConfig(curRecord)
|
|
||||||
this.object = curRecord
|
|
||||||
this.rightBox.show = true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
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) {
|
initConfig (u) {
|
||||||
if (!u.config) {
|
if (!u.config) {
|
||||||
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