[push type] hide upside down mode, apply primary base url

This commit is contained in:
LouisLam 2021-10-08 20:03:52 +08:00
parent 3f26327f95
commit fc8d1e78b6
5 changed files with 28 additions and 14 deletions

View file

@ -4,6 +4,8 @@
const { TimeLogger } = require("../src/util");
const { R } = require("redbean-node");
const { io } = require("./server");
const { setting } = require("./util-server");
const checkVersion = require("./check-version");
async function sendNotificationList(socket) {
const timeLogger = new TimeLogger();
@ -14,10 +16,10 @@ async function sendNotificationList(socket) {
]);
for (let bean of list) {
result.push(bean.export())
result.push(bean.export());
}
io.to(socket.userID).emit("notificationList", result)
io.to(socket.userID).emit("notificationList", result);
timeLogger.print("Send Notification List");
@ -39,7 +41,7 @@ async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite =
LIMIT 100
`, [
monitorID,
])
]);
let result = list.reverse();
@ -69,7 +71,7 @@ async function sendImportantHeartbeatList(socket, monitorID, toUser = false, ove
LIMIT 500
`, [
monitorID,
])
]);
timeLogger.print(`[Monitor: ${monitorID}] sendImportantHeartbeatList`);
@ -81,8 +83,18 @@ async function sendImportantHeartbeatList(socket, monitorID, toUser = false, ove
}
async function sendInfo(socket) {
socket.emit("info", {
version: checkVersion.version,
latestVersion: checkVersion.latestVersion,
primaryBaseURL: await setting("primaryBaseURL")
});
}
module.exports = {
sendNotificationList,
sendImportantHeartbeatList,
sendHeartbeatList,
}
sendInfo
};