mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
google chat: only show offline message in notification when service went down
This commit is contained in:
parent
8ad6bd31d4
commit
a6072a0e30
1 changed files with 6 additions and 6 deletions
|
@ -2,7 +2,7 @@ const NotificationProvider = require("./notification-provider");
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const { setting } = require("../util-server");
|
const { setting } = require("../util-server");
|
||||||
const { getMonitorRelativeURL } = require("../../src/util");
|
const { getMonitorRelativeURL } = require("../../src/util");
|
||||||
const { UP } = require("../../src/util");
|
const { DOWN, UP } = require("../../src/util");
|
||||||
|
|
||||||
class GoogleChat extends NotificationProvider {
|
class GoogleChat extends NotificationProvider {
|
||||||
|
|
||||||
|
@ -15,16 +15,16 @@ class GoogleChat extends NotificationProvider {
|
||||||
|
|
||||||
let textMsg = ''
|
let textMsg = ''
|
||||||
if (heartbeatJSON && heartbeatJSON.status === UP) {
|
if (heartbeatJSON && heartbeatJSON.status === UP) {
|
||||||
textMsg = `✅ Application is back online`;
|
textMsg = `✅ Application is back online\n`;
|
||||||
} else {
|
} else if (heartbeatJSON && heartbeatJSON.status === DOWN) {
|
||||||
textMsg = `🔴 Application went down`;
|
textMsg = `🔴 Application went down\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monitorJSON && monitorJSON.name) {
|
if (monitorJSON && monitorJSON.name) {
|
||||||
textMsg += `\n*${monitorJSON.name}*`;
|
textMsg += `*${monitorJSON.name}*\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
textMsg += `\n${msg}`;
|
textMsg += `${msg}`;
|
||||||
|
|
||||||
const baseURL = await setting("primaryBaseURL");
|
const baseURL = await setting("primaryBaseURL");
|
||||||
if (baseURL) {
|
if (baseURL) {
|
||||||
|
|
Loading…
Reference in a new issue