mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-21 04:54:41 -04:00
Uptime calculation improvement and 1-year uptime (#2750)
This commit is contained in:
parent
eec221247f
commit
076331bf00
22 changed files with 1306 additions and 264 deletions
|
@ -7,6 +7,7 @@ const { R } = require("redbean-node");
|
|||
const Monitor = require("../model/monitor");
|
||||
const { badgeConstants } = require("../config");
|
||||
const { makeBadge } = require("badge-maker");
|
||||
const { UptimeCalculator } = require("../uptime-calculator");
|
||||
|
||||
let router = express.Router();
|
||||
|
||||
|
@ -92,8 +93,8 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
|
|||
list = R.convertToBeans("heartbeat", list);
|
||||
heartbeatList[monitorID] = list.reverse().map(row => row.toPublicJSON());
|
||||
|
||||
const type = 24;
|
||||
uptimeList[`${monitorID}_${type}`] = await Monitor.calcUptime(type, monitorID);
|
||||
const uptimeCalculator = await UptimeCalculator.getUptimeCalculator(monitorID);
|
||||
uptimeList[`${monitorID}_24`] = uptimeCalculator.get24Hour().uptime;
|
||||
}
|
||||
|
||||
response.json({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue