mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-19 18:56:48 +02:00
cleaned up empty lines + linting
This commit is contained in:
parent
94adf2c9d4
commit
b41d10ec27
3 changed files with 19 additions and 23 deletions
|
@ -100,7 +100,6 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
|
||||||
heartbeatList[monitorID] = aggregatedData;
|
heartbeatList[monitorID] = aggregatedData;
|
||||||
} else {
|
} else {
|
||||||
// Fall back to raw heartbeat data (auto mode or no stat data)
|
// Fall back to raw heartbeat data (auto mode or no stat data)
|
||||||
|
|
||||||
if (heartbeatRange === "auto") {
|
if (heartbeatRange === "auto") {
|
||||||
// Auto mode - use original LIMIT 100 logic
|
// Auto mode - use original LIMIT 100 logic
|
||||||
list = await R.getAll(`
|
list = await R.getAll(`
|
||||||
|
@ -116,8 +115,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
|
||||||
const hours = parseRangeHours(heartbeatRange);
|
const hours = parseRangeHours(heartbeatRange);
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setHours(date.getHours() - hours);
|
date.setHours(date.getHours() - hours);
|
||||||
const dateFrom = date.toISOString().slice(0, 19).replace('T', ' ');
|
const dateFrom = date.toISOString().slice(0, 19).replace("T", " ");
|
||||||
|
|
||||||
|
|
||||||
list = await R.getAll(`
|
list = await R.getAll(`
|
||||||
SELECT * FROM heartbeat
|
SELECT * FROM heartbeat
|
||||||
|
|
|
@ -48,7 +48,7 @@ async function getAggregatedHeartbeatData(monitorId, range) {
|
||||||
SELECT * FROM stat_hourly
|
SELECT * FROM stat_hourly
|
||||||
WHERE monitor_id = ? AND timestamp >= ?
|
WHERE monitor_id = ? AND timestamp >= ?
|
||||||
ORDER BY timestamp ASC
|
ORDER BY timestamp ASC
|
||||||
`, [monitorId, timestampKey]);
|
`, [ monitorId, timestampKey ]);
|
||||||
|
|
||||||
// If no stat data, fall back to raw heartbeat data
|
// If no stat data, fall back to raw heartbeat data
|
||||||
if (stats.length === 0) {
|
if (stats.length === 0) {
|
||||||
|
@ -75,7 +75,7 @@ async function getAggregatedHeartbeatData(monitorId, range) {
|
||||||
SELECT * FROM stat_daily
|
SELECT * FROM stat_daily
|
||||||
WHERE monitor_id = ? AND timestamp >= ?
|
WHERE monitor_id = ? AND timestamp >= ?
|
||||||
ORDER BY timestamp ASC
|
ORDER BY timestamp ASC
|
||||||
`, [monitorId, timestampKey]);
|
`, [ monitorId, timestampKey ]);
|
||||||
|
|
||||||
// If no stat data, fall back to raw heartbeat data
|
// If no stat data, fall back to raw heartbeat data
|
||||||
if (stats.length === 0) {
|
if (stats.length === 0) {
|
||||||
|
|
|
@ -99,7 +99,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
shortBeatList() {
|
shortBeatList() {
|
||||||
|
|
||||||
if (!this.beatList) {
|
if (!this.beatList) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -130,7 +129,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
aggregatedBeatList() {
|
aggregatedBeatList() {
|
||||||
|
|
||||||
if (!this.beatList || this.beatList.length === 0) {
|
if (!this.beatList || this.beatList.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue