mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-19 02:36:47 +02:00
Update src/components/HeartbeatBar.vue
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
a59a02e0de
commit
2c7165a798
1 changed files with 6 additions and 6 deletions
|
@ -229,14 +229,14 @@ export default {
|
|||
* @returns {string} The time elapsed in minutes or hours.
|
||||
*/
|
||||
timeSinceFirstBeat() {
|
||||
// For configured days mode, show the configured range
|
||||
if (this.normalizedHeartbeatBarDays > 0) {
|
||||
return this.normalizedHeartbeatBarDays < 2 ?
|
||||
(this.normalizedHeartbeatBarDays * 24) + "h" :
|
||||
this.normalizedHeartbeatBarDays + "d";
|
||||
if (this.normalizedHeartbeatBarDays === 1) {
|
||||
return (this.normalizedHeartbeatBarDays * 24) + "h";
|
||||
}
|
||||
if (this.normalizedHeartbeatBarDays >= 2) {
|
||||
return this.normalizedHeartbeatBarDays + "d";
|
||||
}
|
||||
|
||||
// For auto mode, calculate from actual data
|
||||
// Need to calculate from actual data
|
||||
const firstValidBeat = this.shortBeatList.at(this.numPadding);
|
||||
const minutes = dayjs().diff(dayjs.utc(firstValidBeat?.time), "minutes");
|
||||
return minutes > 60 ? Math.floor(minutes / 60) + "h" : minutes + "m";
|
||||
|
|
Loading…
Add table
Reference in a new issue