mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-30 01:59:06 -04:00
Feat: Use separate storage for custom chart period
Fix: Fix import error
This commit is contained in:
parent
b83c59e308
commit
2f7b60f5e5
3 changed files with 67 additions and 51 deletions
|
@ -650,10 +650,23 @@ exports.entryPage = "dashboard";
|
|||
|
||||
console.log(`Get Monitor Beats: ${monitorID} User ID: ${socket.userID}`);
|
||||
|
||||
await sendHeartbeatList(socket, monitorID, true, true, period);
|
||||
if (period == null) {
|
||||
throw new Error("Invalid period.");
|
||||
}
|
||||
|
||||
let list = await R.getAll(`
|
||||
SELECT * FROM heartbeat
|
||||
WHERE monitor_id = ? AND
|
||||
time > DATETIME('now', '-' || ? || ' hours')
|
||||
ORDER BY time ASC
|
||||
`, [
|
||||
monitorID,
|
||||
period,
|
||||
]);
|
||||
|
||||
callback({
|
||||
ok: true
|
||||
ok: true,
|
||||
data: list,
|
||||
});
|
||||
} catch (e) {
|
||||
callback({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue