diff --git a/src/assets/css/components/views/charts2/informationAggregation.scss b/src/assets/css/components/views/charts2/informationAggregation.scss index 89e794dd..3e694026 100644 --- a/src/assets/css/components/views/charts2/informationAggregation.scss +++ b/src/assets/css/components/views/charts2/informationAggregation.scss @@ -1,19 +1,13 @@ .information-aggregation__table { - .intelligence-content { - padding-top:10px !important; - padding-bottom:4px !important; - display: flex; - flex-direction: column; - justify-content: center; - align-items: flex-start; .information-aggregation-tags { display: flex; flex-direction: row; - justify-content: center; + justify-content: left; align-items: flex-start; margin-bottom:6px; + padding-top:10px !important; + padding-bottom:4px !important; } - } .information-aggregation__valid { background: #eff3e9; border-radius: 10px; diff --git a/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue b/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue index 9a55a1ec..dbdd78d7 100644 --- a/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue +++ b/src/views/charts2/charts/entityDetail/tabs/InformationAggregation.vue @@ -3,7 +3,6 @@ -
{ const res = response.data if (res.code === 200) { - this.isNoData = res.data.result.length === 0 + //this.isNoData = res.data.result.length === 0 this.showError = false - if (!this.isNoData) { + if (res.data.result.length > 0) { res.data.result.forEach(r => { Object.keys(r).forEach(k => { const aggregation = { @@ -161,15 +141,18 @@ export default { } } else { this.showError = true - this.isNoData = false this.errorMsg = this.errorMsgHandler(res) } }).catch(e => { console.error(e) this.showError = true - this.isNoData = false this.errorMsg = this.errorMsgHandler(e) }).finally(() => { + if(this.informationAggregationList.length > 0){ + this.isNoData = false + }else { + this.isNoData = true + } this.loading = false this.toggleLoading(false) }) diff --git a/src/views/setting/KnowledgeBaseForm.vue b/src/views/setting/KnowledgeBaseForm.vue index 845de6d8..bd0479c9 100644 --- a/src/views/setting/KnowledgeBaseForm.vue +++ b/src/views/setting/KnowledgeBaseForm.vue @@ -314,6 +314,35 @@ export default { this.showImportedData[index].isValid = 0 callback(new Error()) } + } else if(formal.indexOf('-') !== -1) { + let split2 = formal.split('-') + let startIp = split2[0].replace(/\s+/g, ''); + let endIp = split2[1].replace(/\s+/g, ''); + if (regular.ipv4Range.test(startIp) && regular.ipv4Range.test(endIp)) { + //ipv4对比大小 + if (!(regular.compareIP4(startIp) <= regular.compareIP4(endIp))) { + validate = false + this.editTagErrorTip = rule.message + this.showImportedData[index].msg = rule.message + this.showImportedData[index].isValid = 0 + callback(new Error()) + } + } else if (regular.ipv6Range.test(startIp) && regular.ipv6Range.test(endIp)) { + //ipv6对比大小 + if (!regular.ipv6Reg(startIp, endIp)) { + validate = false + this.editTagErrorTip = rule.message + this.showImportedData[index].msg = rule.message + this.showImportedData[index].isValid = 0 + callback(new Error()) + } + } else { + validate = false + this.editTagErrorTip = rule.message + this.showImportedData[index].msg = rule.message + this.showImportedData[index].isValid = 0 + callback(new Error()) + } } else { if (!regular.ip.test(formal)) { validate = false @@ -481,7 +510,7 @@ export default { } else if (format === 'CIDR') { item.tagName = item.ip1 + '/' + item.ip2 } else if (format === 'Range') { - item.tagName = item.ip1 + '~' + item.ip2 + item.tagName = item.ip1 + '-' + item.ip2 } } else if (this.editObject.source === knowledgeSourceValue.domainTag) { item.tagName = item.domain @@ -915,13 +944,21 @@ export default { isValid: 1 } if (this.editObject.source === knowledgeSourceValue.ipTag) { - const sepIndex = data.tagName.indexOf('/') - if (sepIndex > -1) { // CIDR + const sepCidrIndex = data.tagName.indexOf('/') + const sepRangeIndex = data.tagName.indexOf('-') + if (sepCidrIndex > -1) { // CIDR updateItemData = { ...updateItemData, addrFormat: 'CIDR', - ip1: data.tagName.substring(0, sepIndex), - ip2: data.tagName.substring(sepIndex + 1) + ip1: data.tagName.substring(0, sepCidrIndex), + ip2: data.tagName.substring(sepCidrIndex + 1) + } + } else if(sepRangeIndex > -1){ + updateItemData = { + ...updateItemData, + addrFormat: 'Range', + ip1: data.tagName.substring(0, sepRangeIndex), + ip2: data.tagName.substring(sepRangeIndex + 1) } } else { // Single updateItemData = { @@ -956,13 +993,21 @@ export default { } let addItem = data if (this.editObject.source === knowledgeSourceValue.ipTag) { - const sepIndex = data.tagName.indexOf('/') - if (sepIndex > -1) { // CIDR + const sepCidrIndex = data.tagName.indexOf('/') + const sepRangeIndex = data.tagName.indexOf('-') + if (sepCidrIndex > -1) { // CIDR addItem = { ...addItem, addrFormat: 'CIDR', - ip1: data.tagName.substring(0, sepIndex), - ip2: data.tagName.substring(sepIndex + 1) + ip1: data.tagName.substring(0, sepCidrIndex), + ip2: data.tagName.substring(sepCidrIndex + 1) + } + } else if(sepRangeIndex > -1){ + addItem = { + ...addItem, + addrFormat: 'Range', + ip1: data.tagName.substring(0, sepRangeIndex), + ip2: data.tagName.substring(sepRangeIndex + 1) } } else { // Single addItem = {