diff --git a/src/assets/css/components/views/detections/detection-filter.scss b/src/assets/css/components/views/detections/detection-filter.scss index e28c5f99..4822a608 100644 --- a/src/assets/css/components/views/detections/detection-filter.scss +++ b/src/assets/css/components/views/detections/detection-filter.scss @@ -44,9 +44,14 @@ display: flex; align-items: center; padding: 5px 0; + margin-right: 5px; + .el-checkbox__label { + width: 100%; + } .filter__checkbox-label { display: flex; + justify-content: space-between; align-items: center; .severity-color-block { diff --git a/src/assets/css/components/views/detections/detection-overview.scss b/src/assets/css/components/views/detections/detection-overview.scss index 3a09a5d6..53c0e4e5 100644 --- a/src/assets/css/components/views/detections/detection-overview.scss +++ b/src/assets/css/components/views/detections/detection-overview.scss @@ -169,3 +169,10 @@ } } } +.row__tag { + display: flex; + justify-content: center; + align-items: center; + padding: 0 4px; + color: white; +} diff --git a/src/components/advancedSearch/TagMode.vue b/src/components/advancedSearch/TagMode.vue index cc0bb275..2f71e8bf 100644 --- a/src/components/advancedSearch/TagMode.vue +++ b/src/components/advancedSearch/TagMode.vue @@ -280,7 +280,7 @@ export default { const newColumn = this.columnList.find(column => { return column.name === param.newParam.column }) - const meta = this.metaList.find(m => m.column.name === oldColumn.name && m.operator.value === param.oldParam.operator && m.value.value === this.handleValue(param.oldParam.value, oldColumn, param.oldParam.operator)) + const meta = this.metaList.find(m => m.column && m.column.name === oldColumn.name && m.operator.value === param.oldParam.operator && m.value.value === this.handleValue(param.oldParam.value, oldColumn, param.oldParam.operator)) if (meta) { meta.column.name = newColumn.name meta.column.type = newColumn.type @@ -296,8 +296,15 @@ export default { const column = this.columnList.find(c => { return c.name === param.column }) - const metaIndex = this.metaList.findIndex(m => m.column.name === param.column && m.operator.value === param.operator && m.value.value === this.handleValue(param.value, column, param.operator)) - this.metaList.splice(metaIndex, 1) + const metaIndex = this.metaList.findIndex(m => m.column && m.column.name === param.column && m.operator.value === param.operator && m.value.value === this.handleValue(param.value, column, param.operator)) + // 不是在首位,则删除时顺带删除前一个index(and或or),否则顺带删除后一个index + if (metaIndex > 0) { + this.metaList.splice(metaIndex - 1, 2) + } else if (this.metaList.length === 1) { + this.metaList.splice(metaIndex, 1) + } else { + this.metaList.splice(metaIndex, 2) + } }) } }, diff --git a/src/components/advancedSearch/TextMode.vue b/src/components/advancedSearch/TextMode.vue index fdcda0dd..9426ac3e 100644 --- a/src/components/advancedSearch/TextMode.vue +++ b/src/components/advancedSearch/TextMode.vue @@ -110,7 +110,10 @@ export default { const column = this.columnList.find(c => c.name === param.column) // 将对应内容替换为空串 const sqlPiece = `${param.column}${handleOperatorSpace(param.operator)}${this.handleValue(param.value, column, param.operator)}`.trim() - current = current.replace(sqlPiece, '') + const sqlPieceWithConnection = [` AND ${sqlPiece}`, ` OR ${sqlPiece}`, `${sqlPiece} AND `, `${sqlPiece} OR `, sqlPiece] + sqlPieceWithConnection.forEach(piece => { + current = current.replace(piece, '') + }) }) toRaw(this.codeMirror).setValue(current) }, diff --git a/src/components/advancedSearch/meta/meta.js b/src/components/advancedSearch/meta/meta.js index 986ae1cb..d1451e73 100644 --- a/src/components/advancedSearch/meta/meta.js +++ b/src/components/advancedSearch/meta/meta.js @@ -71,9 +71,14 @@ export default class Meta { // 是否是完整的condition isCompleteCondition () { - return (this.column.type === columnType.fullText) - ? !_.isEmpty(this.column.name) - : !_.isEmpty(this.column.name) && !_.isEmpty(this.operator.value) && !_.isEmpty(this.value.value) + if (this.meta === condition) { + return (this.column.type === columnType.fullText) + ? !_.isEmpty(this.column.name) + : !_.isEmpty(this.column.name) && !_.isEmpty(this.operator.value) && !_.isEmpty(this.value.value) + } else if (this.meta === connection) { + return !!this.value + } + return false } // 取消editing状态 diff --git a/src/utils/constants.js b/src/utils/constants.js index 54c69028..ecc6f0f2 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -143,6 +143,28 @@ export const riskLevelMapping = [ { name: 'Suspicious', value: 4 }, { name: 'High Risk', value: 5 } ] +export const eventSeverity = { + critical: 'critical', + high: 'high', + medium: 'medium', + low: 'low', + info: 'info' +} +export const eventSeverityColor = { + critical: '#D84C4C', + high: '#FE845D', + medium: '#FFB65A', + low: '#FFD82D', + info: '#D1BD50' +} +export const securityType = { + commandAndControl: 'common and control', + payloadDelivery: 'payload delivery', + cryptomining: 'cryptomining', + phishing: 'phishing', + dga: 'dga', + ddos: 'ddos' +} export const iso36112 = { [storageKey.iso36112Capital]: 'data/countriesWithCapital', [storageKey.iso36112WorldLow]: 'worldChinaLow', diff --git a/src/views/detections/DetectionFilter.vue b/src/views/detections/DetectionFilter.vue index 3c1f9fa8..adf7d25e 100644 --- a/src/views/detections/DetectionFilter.vue +++ b/src/views/detections/DetectionFilter.vue @@ -12,8 +12,11 @@ @@ -27,6 +30,7 @@