diff --git a/api/app/lib/utils/alarmHandle.js b/api/app/lib/utils/alarmHandle.js index f31e9a0..55be102 100644 --- a/api/app/lib/utils/alarmHandle.js +++ b/api/app/lib/utils/alarmHandle.js @@ -17,7 +17,7 @@ module.exports = function (app, opts) { async function sendAppearToWeb(datas, ttype) { try { //告警类型 - let alarmGroup = null + let alarmTypee = null //项目信息 let { projects, pepProjects } = await getProjectsInfo(datas); @@ -27,9 +27,9 @@ module.exports = function (app, opts) { let alarm_group = await clickHouse.anxinyun.query( `SELECT alarm_group FROM t_alarm_code WHERE code='${datas[0].alarmInfo.alarmCode}'`).toPromise(); - alarmGroup = alarm_group.length ? constAlarmGroups[alarm_group[0].alarm_group] : null + alarmTypee = alarm_group.length ? constAlarmGroups[alarm_group[0].alarm_group] : null } else { - alarmGroup = constAlarmGroups[ttype] + alarmTypee = constAlarmGroups[ttype] } let sendData = [] @@ -39,9 +39,9 @@ module.exports = function (app, opts) { projectCorrelationId: ld.projectCorrelationId, project: projects.find(p => p.id == ld.projectCorrelationId).name || pepProjects.find(pp => pp.id == pepPId).project_name,//前者为自定义项目名称 source: ld.alarmInfo.sourceName, - type: ld.alarmInfo.type,//异常类型 + alarmGroup: ld.alarmInfo.type,//异常类型 time: ld.time, - alarmGroup//告警类型 + type: alarmTypee//告警类型 }) }) //app.socket.emit('alarmSendSocket', { type: 'alarmAppear', sendData })