mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 02:22:57 +08:00
add duration to heartbeat, add timezone array
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user