WIP
This commit is contained in:
parent
594228e871
commit
defb8d0f34
7 changed files with 36 additions and 53 deletions
|
|
@ -36,8 +36,8 @@ function checkBalance (rec) {
|
|||
}
|
||||
|
||||
function checkBalances () {
|
||||
var balances = getBalances()
|
||||
return R.reject(R.isNil, balances.map(checkBalance))
|
||||
return getBalances()
|
||||
.then(balances => R.reject(R.isNil, balances.map(checkBalance)))
|
||||
}
|
||||
|
||||
function checkPing (deviceEvents) {
|
||||
|
|
@ -87,13 +87,13 @@ function devicesAndEvents () {
|
|||
|
||||
function checkStatus () {
|
||||
var alerts = {devices: {}, deviceNames: {}}
|
||||
alerts.general = checkBalances()
|
||||
|
||||
return devicesAndEvents()
|
||||
.then(function (rec) {
|
||||
return Promise.all([checkBalances(), devicesAndEvents()])
|
||||
.then(([balances, rec]) => {
|
||||
var devices = rec.devices
|
||||
var events = rec.events
|
||||
|
||||
alerts.general = balances
|
||||
devices.forEach(function (deviceRow) {
|
||||
var deviceId = deviceRow.device_id
|
||||
var deviceName = deviceRow.name || deviceId
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue