Skip to content

Commit

Permalink
Add Hosts DayMap --fix :sad: :sad: :sad: , it's the latest
Browse files Browse the repository at this point in the history
  • Loading branch information
a632079 committed Apr 7, 2018
1 parent 16215a8 commit 250d10b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/controllers/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ async function getHostsDayMap (limitHosts, now) {
const data = {}
for (let host of limitHosts) {
const _ = result[0] ? now[host] - parseInt(result[0][host]) : 0
data[host] = []
data[host].push(_)
data[host] = {}
data[host].dayMap = []
data[host].dayMap.push(_)
}
for (let index = 0; index < (result.length - 2); index++) {
for (let host of limitHosts) {
const _ = result[index] && result[index + 1] ? parseInt(result[index][host]) - parseInt(result[index + 1][host]) : null
data[host].push(_)
data[host].dayMap.push(_)
}
}
return data
Expand Down

0 comments on commit 250d10b

Please sign in to comment.