mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
WIP
This commit is contained in:
parent
20a68a16f5
commit
21a6b4a131
@ -4,7 +4,7 @@ const { sendInfo } = require("../client");
|
|||||||
const { checkLogin } = require("../util-server");
|
const { checkLogin } = require("../util-server");
|
||||||
const GameResolver = require("gamedig/lib/GameResolver");
|
const GameResolver = require("gamedig/lib/GameResolver");
|
||||||
const { testChrome } = require("../monitor-types/real-browser-monitor-type");
|
const { testChrome } = require("../monitor-types/real-browser-monitor-type");
|
||||||
const fs = require("fs");
|
const fs = require("fs/promises");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
let gameResolver = new GameResolver();
|
let gameResolver = new GameResolver();
|
||||||
@ -85,17 +85,17 @@ module.exports.generalSocketHandler = (socket, server) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("getPushExample", (language, callback) => {
|
socket.on("getPushExample", async (language, callback) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let dir = path.join("./extra/push-examples", language);
|
let dir = path.join("./extra/push-examples", language);
|
||||||
let files = fs.readdirSync(dir);
|
let files = await fs.readdir(dir);
|
||||||
|
|
||||||
for (let file of files) {
|
for (let file of files) {
|
||||||
if (file.startsWith("index.")) {
|
if (file.startsWith("index.")) {
|
||||||
callback({
|
callback({
|
||||||
ok: true,
|
ok: true,
|
||||||
code: fs.readFileSync(path.join(dir, file), "utf8"),
|
code: await fs.readFile(path.join(dir, file), "utf8"),
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user