From 30abf74200ca803b12d4d53b32d118ff0b7c847a Mon Sep 17 00:00:00 2001 From: wuqun Date: Fri, 4 Nov 2022 11:09:32 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=91=8A=E8=AD=A6=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/utils/alarmHandle.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 })