mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-21 08:34:03 +02:00
Add the new hostname to heartbeatJSON messages, fix linter errors
Signed-off-by: Sid Sun <sids@Sids-MacBook.local>
This commit is contained in:
parent
0890660e01
commit
d8269ba3ca
2 changed files with 5 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
||||||
services:
|
services:
|
||||||
uptime-kuma:
|
uptime-kuma:
|
||||||
hostname: uptime-kuma
|
hostname: uptime-kuma
|
||||||
image: louislam/uptime-kuma:1
|
# image: louislam/uptime-kuma:1
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -24,7 +24,7 @@ const { CookieJar } = require("tough-cookie");
|
||||||
const { HttpsCookieAgent } = require("http-cookie-agent/http");
|
const { HttpsCookieAgent } = require("http-cookie-agent/http");
|
||||||
const https = require("https");
|
const https = require("https");
|
||||||
const http = require("http");
|
const http = require("http");
|
||||||
const os = require('os');
|
const os = require("os");
|
||||||
|
|
||||||
const rootCertificates = rootCertificatesFingerprints();
|
const rootCertificates = rootCertificatesFingerprints();
|
||||||
|
|
||||||
|
@ -1302,6 +1302,8 @@ class Monitor extends BeanModel {
|
||||||
// Prevent if the msg is undefined, notifications such as Discord cannot send out.
|
// Prevent if the msg is undefined, notifications such as Discord cannot send out.
|
||||||
if (!heartbeatJSON["msg"]) {
|
if (!heartbeatJSON["msg"]) {
|
||||||
heartbeatJSON["msg"] = "N/A";
|
heartbeatJSON["msg"] = "N/A";
|
||||||
|
} else {
|
||||||
|
heartbeatJSON["msg"] = `[${os.hostname()}] ${heartbeatJSON["msg"]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also provide the time in server timezone
|
// Also provide the time in server timezone
|
||||||
|
|
Loading…
Add table
Reference in a new issue