Merge branch 'louislam:master' into tags-on-status

This commit is contained in:
Jasper Miller-Waugh
2021-11-07 14:39:43 +13:00
committed by GitHub
24 changed files with 233 additions and 211 deletions

View File

@@ -9,18 +9,17 @@ let interval;
exports.startInterval = () => {
let check = async () => {
try {
const res = await axios.get("https://raw.githubusercontent.com/louislam/uptime-kuma/master/package.json");
if (typeof res.data === "string") {
res.data = JSON.parse(res.data);
}
const res = await axios.get("https://uptime.kuma.pet/version");
// For debug
if (process.env.TEST_CHECK_VERSION === "1") {
res.data.version = "1000.0.0";
res.data.slow = "1000.0.0";
}
if (res.data.slow) {
exports.latestVersion = res.data.slow;
}
exports.latestVersion = res.data.version;
} catch (_) { }
};

View File

@@ -27,7 +27,7 @@ class Feishu extends NotificationProvider {
content: {
post: {
zh_cn: {
title: "UptimeKuma Alert: " + monitorJSON["name"],
title: "UptimeKuma Alert: [Down] " + monitorJSON["name"],
content: [
[
{
@@ -54,7 +54,7 @@ class Feishu extends NotificationProvider {
content: {
post: {
zh_cn: {
title: "UptimeKuma Alert: " + monitorJSON["name"],
title: "UptimeKuma Alert: [Up] " + monitorJSON["name"],
content: [
[
{

View File

@@ -186,6 +186,15 @@ exports.entryPage = "dashboard";
// Normal Router here
// ***************************
// Entry Page
app.get("/", async (_request, response) => {
if (exports.entryPage === "statusPage") {
response.redirect("/status");
} else {
response.redirect("/dashboard");
}
});
// Robots.txt
app.get("/robots.txt", async (_request, response) => {
let txt = "User-agent: *\nDisallow:";