refactor _24 suffix

This commit is contained in:
Doruk 2025-06-17 19:36:51 +02:00
parent 5e64226a63
commit eb47b1f14f
2 changed files with 2 additions and 9 deletions

View file

@ -154,14 +154,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
// Populate the response objects
for (const result of monitorResults) {
heartbeatList[result.monitorID] = result.heartbeats;
// 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;
}
uptimeList[result.monitorID] = result.uptime;
}
response.json({

View file

@ -30,7 +30,7 @@ export default {
return this.$t("statusMaintenance");
}
let key = this.monitor.id + "_" + this.type;
let key = this.monitor.id;
if (this.$root.uptimeList[key] !== undefined) {
let result = Math.round(this.$root.uptimeList[key] * 10000) / 100;