|
|
@ -126,7 +126,7 @@ module.exports = function (app, opts) { |
|
|
|
if (offArr.length && c.noticeWay && c.noticeWay.includes('offline') && receiver.length) { |
|
|
|
if (c.pushWay == 'email') { |
|
|
|
// 邮件
|
|
|
|
let text = `【${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,有${offArr.length}个设备掉线:\n` |
|
|
|
let text = `【${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,新增${offArr.length}个设备掉线:\n` |
|
|
|
text += offArr.map(o => `【${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n') |
|
|
|
text += `\n请及时处理!` |
|
|
|
await pushByEmail({ |
|
|
@ -285,7 +285,7 @@ module.exports = function (app, opts) { |
|
|
|
], |
|
|
|
}) |
|
|
|
for (let c of configRes) { |
|
|
|
// 查配置信息所对应的摄像头15min内的在离线状态
|
|
|
|
// 查配置信息所对应的摄像头在离线状态
|
|
|
|
const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId) |
|
|
|
const offlineRes = await models.Camera.findAll({ |
|
|
|
where: { |
|
|
@ -330,7 +330,7 @@ module.exports = function (app, opts) { |
|
|
|
group: ['cameraId'], |
|
|
|
}) |
|
|
|
if (offlineTimeRes.length) { |
|
|
|
let text = `【${corUser[0].username}】账号下的设备,截止${moment(timeNow).format('MM月DD日 HH时mm分')},有${offlineRes.length}个设备掉线:\n` |
|
|
|
let text = `【${corUser[0].username}】账号下的设备,截止${moment(timeNow).format('MM月DD日 HH时mm分')},新增${offlineRes.length}个设备掉线:\n` |
|
|
|
text += offlineTimeRes.map(o => { |
|
|
|
let corCamera = offlineRes.find(c => c.id == o.cameraId) |
|
|
|
if (corCamera) { |
|
|
|