mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
uptime uptime variable location & unnecessary variables
This commit is contained in:
parent
b121cc7d5c
commit
71b73e979f
2 changed files with 3 additions and 5 deletions
|
@ -97,7 +97,6 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
|
|||
const uptimeCalculator = await UptimeCalculator.getUptimeCalculator(monitorID);
|
||||
|
||||
let heartbeats;
|
||||
let uptime;
|
||||
|
||||
if (heartbeatBarDays === 0) {
|
||||
// Auto mode - use original LIMIT 100 logic
|
||||
|
@ -134,6 +133,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
|
|||
}
|
||||
|
||||
// Calculate uptime based on the range
|
||||
let uptime;
|
||||
if (heartbeatBarDays <= 1) {
|
||||
uptime = uptimeCalculator.get24Hour().uptime;
|
||||
} else {
|
||||
|
|
|
@ -30,10 +30,8 @@ export default {
|
|||
return this.$t("statusMaintenance");
|
||||
}
|
||||
|
||||
let key = this.monitor.id;
|
||||
|
||||
if (this.$root.uptimeList[key] !== undefined) {
|
||||
let result = Math.round(this.$root.uptimeList[key] * 10000) / 100;
|
||||
if (this.$root.uptimeList[this.monitor.id] !== undefined) {
|
||||
let result = Math.round(this.$root.uptimeList[this.monitor.id] * 10000) / 100;
|
||||
// Only perform sanity check on status page. See louislam/uptime-kuma#2628
|
||||
if (this.$route.path.startsWith("/status") && result > 100) {
|
||||
return "100%";
|
||||
|
|
Loading…
Add table
Reference in a new issue