mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-19 15:44:02 +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:
|
||||
uptime-kuma:
|
||||
hostname: uptime-kuma
|
||||
image: louislam/uptime-kuma:1
|
||||
# image: louislam/uptime-kuma:1
|
||||
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
ports:
|
||||
|
|
|
@ -24,7 +24,7 @@ const { CookieJar } = require("tough-cookie");
|
|||
const { HttpsCookieAgent } = require("http-cookie-agent/http");
|
||||
const https = require("https");
|
||||
const http = require("http");
|
||||
const os = require('os');
|
||||
const os = require("os");
|
||||
|
||||
const rootCertificates = rootCertificatesFingerprints();
|
||||
|
||||
|
@ -1302,6 +1302,8 @@ class Monitor extends BeanModel {
|
|||
// Prevent if the msg is undefined, notifications such as Discord cannot send out.
|
||||
if (!heartbeatJSON["msg"]) {
|
||||
heartbeatJSON["msg"] = "N/A";
|
||||
} else {
|
||||
heartbeatJSON["msg"] = `[${os.hostname()}] ${heartbeatJSON["msg"]}`;
|
||||
}
|
||||
|
||||
// Also provide the time in server timezone
|
||||
|
|
Loading…
Add table
Reference in a new issue