more refactoring
This commit is contained in:
parent
8acbc90dbd
commit
9a9c927801
6 changed files with 30 additions and 30 deletions
|
|
@ -95,18 +95,18 @@ function checkStatus () {
|
|||
var events = rec.events
|
||||
|
||||
devices.forEach(function (deviceRow) {
|
||||
var deviceFingerprint = deviceRow.fingerprint
|
||||
var deviceName = deviceRow.name || deviceFingerprint
|
||||
var deviceId = deviceRow.device_id
|
||||
var deviceName = deviceRow.name || deviceId
|
||||
var deviceEvents = events.filter(function (eventRow) {
|
||||
return eventRow.device_fingerprint === deviceFingerprint
|
||||
return eventRow.device_id === deviceId
|
||||
})
|
||||
|
||||
var deviceAlerts = []
|
||||
deviceAlerts = R.concat(deviceAlerts, checkStuckScreen(deviceEvents))
|
||||
deviceAlerts = R.concat(deviceAlerts, checkPing(deviceEvents))
|
||||
|
||||
alerts.devices[deviceFingerprint] = deviceAlerts
|
||||
alerts.deviceNames[deviceFingerprint] = deviceName
|
||||
alerts.devices[deviceId] = deviceAlerts
|
||||
alerts.deviceNames[deviceId] = deviceName
|
||||
})
|
||||
|
||||
return alerts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue