mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-19 02:36:47 +02:00
refactor _24 suffix
This commit is contained in:
parent
5e64226a63
commit
eb47b1f14f
2 changed files with 2 additions and 9 deletions
|
@ -154,14 +154,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
|
||||||
// Populate the response objects
|
// Populate the response objects
|
||||||
for (const result of monitorResults) {
|
for (const result of monitorResults) {
|
||||||
heartbeatList[result.monitorID] = result.heartbeats;
|
heartbeatList[result.monitorID] = result.heartbeats;
|
||||||
|
uptimeList[result.monitorID] = result.uptime;
|
||||||
// Always populate 24h uptime for compatibility
|
|
||||||
uptimeList[`${result.monitorID}_24`] = result.uptime;
|
|
||||||
|
|
||||||
// Add dynamic uptime key for the exact range
|
|
||||||
if (heartbeatBarDays > 0) {
|
|
||||||
uptimeList[`${result.monitorID}_${heartbeatBarDays}d`] = result.uptime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
response.json({
|
response.json({
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default {
|
||||||
return this.$t("statusMaintenance");
|
return this.$t("statusMaintenance");
|
||||||
}
|
}
|
||||||
|
|
||||||
let key = this.monitor.id + "_" + this.type;
|
let key = this.monitor.id;
|
||||||
|
|
||||||
if (this.$root.uptimeList[key] !== undefined) {
|
if (this.$root.uptimeList[key] !== undefined) {
|
||||||
let result = Math.round(this.$root.uptimeList[key] * 10000) / 100;
|
let result = Math.round(this.$root.uptimeList[key] * 10000) / 100;
|
||||||
|
|
Loading…
Add table
Reference in a new issue