mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-19 07:44:02 +02:00
remove normalized heartbeat days
This commit is contained in:
parent
d07575bbdb
commit
2707aa5ab4
1 changed files with 5 additions and 13 deletions
|
@ -65,14 +65,6 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
/**
|
|
||||||
* Normalized heartbeatBarDays as a number
|
|
||||||
* @returns {number} Number of days for heartbeat bar
|
|
||||||
*/
|
|
||||||
normalizedHeartbeatBarDays() {
|
|
||||||
return Math.max(0, Math.min(365, Math.floor(this.heartbeatBarDays || 0)));
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If heartbeatList is null, get it from $root.heartbeatList
|
* If heartbeatList is null, get it from $root.heartbeatList
|
||||||
* @returns {object} Heartbeat list
|
* @returns {object} Heartbeat list
|
||||||
|
@ -95,7 +87,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// For configured ranges, no padding needed since we show all beats
|
// For configured ranges, no padding needed since we show all beats
|
||||||
if (this.normalizedHeartbeatBarDays > 0) {
|
if (this.heartbeatBarDays > 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,10 +196,10 @@ export default {
|
||||||
*/
|
*/
|
||||||
timeSinceFirstBeat() {
|
timeSinceFirstBeat() {
|
||||||
// For configured days mode, show the configured range
|
// For configured days mode, show the configured range
|
||||||
if (this.normalizedHeartbeatBarDays >= 2) {
|
if (this.heartbeatBarDays >= 2) {
|
||||||
return this.normalizedHeartbeatBarDays + "d";
|
return this.heartbeatBarDays + "d";
|
||||||
} else if (this.normalizedHeartbeatBarDays === 1) {
|
} else if (this.heartbeatBarDays === 1) {
|
||||||
return (this.normalizedHeartbeatBarDays * 24) + "h";
|
return (this.heartbeatBarDays * 24) + "h";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to calculate from actual data
|
// Need to calculate from actual data
|
||||||
|
|
Loading…
Add table
Reference in a new issue