mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-20 18:55:49 +08:00
Pushover add UP/DOWN status sounds (#5426)
Co-authored-by: Frank Elsinga <frank@elsinga.de> Co-authored-by: Moqavem <sina.farahabadi@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const { getMonitorRelativeURL } = require("../../src/util");
|
||||
const { setting } = require("../util-server");
|
||||
const { UP } = require("../../src/util");
|
||||
|
||||
const NotificationProvider = require("./notification-provider");
|
||||
const axios = require("axios");
|
||||
@@ -43,15 +44,20 @@ class Pushover extends NotificationProvider {
|
||||
if (heartbeatJSON == null) {
|
||||
await axios.post(url, data);
|
||||
return okMsg;
|
||||
} else {
|
||||
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>:${heartbeatJSON["localDateTime"]}`;
|
||||
await axios.post(url, data);
|
||||
return okMsg;
|
||||
}
|
||||
|
||||
if (heartbeatJSON.status === UP && notification.pushoversounds_up) {
|
||||
// default = DOWN => DOWN-sound is also played for non-UP/DOWN notiifcations
|
||||
data.sound = notification.pushoversounds_up;
|
||||
}
|
||||
|
||||
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>: ${heartbeatJSON["localDateTime"]}`;
|
||||
await axios.post(url, data);
|
||||
return okMsg;
|
||||
|
||||
} catch (error) {
|
||||
this.throwGeneralAxiosError(error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user