mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-29 09:39:04 -04:00
Added clear all db statistics function
This commit is contained in:
parent
1341d220ed
commit
7b92166d18
6 changed files with 48 additions and 8 deletions
|
@ -566,7 +566,6 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
|
|||
|
||||
callback({
|
||||
ok: true,
|
||||
msg: "Events Successfully Cleared.",
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
|
@ -589,7 +588,26 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString();
|
|||
|
||||
callback({
|
||||
ok: true,
|
||||
msg: "Heartbeats Successfully Cleared.",
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
callback({
|
||||
ok: false,
|
||||
msg: e.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("clearStatistics", async (callback) => {
|
||||
try {
|
||||
checkLogin(socket)
|
||||
|
||||
console.log(`Clear Statistics User ID: ${socket.userID}`)
|
||||
|
||||
await R.exec("DELETE FROM heartbeat");
|
||||
|
||||
callback({
|
||||
ok: true,
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue