mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-18 19:44:50 -04:00
add duration to heartbeat, add timezone array
This commit is contained in:
parent
46f07fc17e
commit
82afddcfd6
5 changed files with 394 additions and 4 deletions
|
@ -23,6 +23,7 @@ class Heartbeat extends BeanModel {
|
|||
msg: this.msg,
|
||||
ping: this.ping,
|
||||
important: this.important,
|
||||
duration: this.duration,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,14 @@ class Monitor extends BeanModel {
|
|||
bean.time = R.isoDateTime(dayjs.utc());
|
||||
bean.status = 0;
|
||||
|
||||
// Duration
|
||||
if (previousBeat) {
|
||||
bean.duration = dayjs(bean.time).diff(dayjs(previousBeat.time), 'second');
|
||||
} else {
|
||||
bean.duration = 0;
|
||||
console.log(previousBeat)
|
||||
}
|
||||
|
||||
try {
|
||||
if (this.type === "http") {
|
||||
let startTime = dayjs().valueOf();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue