mirror of https://github.com/bastienwirtz/homer
Merge 706bcee2fd
into c230392da8
commit
434d1f92f3
|
@ -47,8 +47,10 @@ export default {
|
||||||
|
|
||||||
for (let id in this.heartbeat.heartbeatList) {
|
for (let id in this.heartbeat.heartbeatList) {
|
||||||
let index = this.heartbeat.heartbeatList[id].length - 1;
|
let index = this.heartbeat.heartbeatList[id].length - 1;
|
||||||
|
if (index >= 0) {
|
||||||
result[id] = this.heartbeat.heartbeatList[id][index];
|
result[id] = this.heartbeat.heartbeatList[id][index];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
@ -102,7 +104,10 @@ export default {
|
||||||
if (!this.heartbeat) {
|
if (!this.heartbeat) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const data = Object.values(this.heartbeat.uptimeList);
|
let data = [];
|
||||||
|
for (let id in this.lastHeartBeatList) {
|
||||||
|
data.push(this.heartbeat.uptimeList[id + "_24"]);
|
||||||
|
}
|
||||||
const percent = data.reduce((a, b) => a + b, 0) / data.length || 0;
|
const percent = data.reduce((a, b) => a + b, 0) / data.length || 0;
|
||||||
return (percent * 100).toFixed(1);
|
return (percent * 100).toFixed(1);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue