mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-05 00:44:46 +00:00
Adjust notification messagess
This commit is contained in:
parent
b2aa549f50
commit
533e5311b2
1 changed files with 4 additions and 3 deletions
|
@ -1516,8 +1516,9 @@ class Monitor extends BeanModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create stats to append to messages/logs
|
// Create stats to append to messages/logs
|
||||||
const methodDescription = [ "average", "max" ].includes(method) ? `${method} of ${windowDuration}s` : method;
|
const methodDescription = [ "average", "max" ].includes(method) ? `${method} of last ${windowDuration}s` : method;
|
||||||
let msgStats = `Response: ${actualResponseTime}ms (${methodDescription}) | Threshold: ${threshold}ms (${thresholdDescription})`;
|
let msgStats = `Response: ${actualResponseTime}ms (${methodDescription}) | Threshold: ${threshold}ms (${thresholdDescription})`;
|
||||||
|
let pingMsg = `${actualResponseTime}ms response (${methodDescription})`;
|
||||||
|
|
||||||
// Verify valid response time was calculated
|
// Verify valid response time was calculated
|
||||||
if (actualResponseTime === 0 || !Number.isInteger(actualResponseTime)) {
|
if (actualResponseTime === 0 || !Number.isInteger(actualResponseTime)) {
|
||||||
|
@ -1546,7 +1547,7 @@ class Monitor extends BeanModel {
|
||||||
|
|
||||||
// Mark important (SLOW -> NOMINAL)
|
// Mark important (SLOW -> NOMINAL)
|
||||||
bean.pingImportant = true;
|
bean.pingImportant = true;
|
||||||
bean.pingMsg = msgStats;
|
bean.pingMsg = pingMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset slow response count
|
// Reset slow response count
|
||||||
|
@ -1565,7 +1566,7 @@ class Monitor extends BeanModel {
|
||||||
|
|
||||||
// Mark important (NOMINAL -> SLOW)
|
// Mark important (NOMINAL -> SLOW)
|
||||||
bean.pingImportant = true;
|
bean.pingImportant = true;
|
||||||
bean.pingMsg = msgStats;
|
bean.pingMsg = pingMsg;
|
||||||
|
|
||||||
// Send notification every x times
|
// Send notification every x times
|
||||||
} else if (this.slowResponseNotificationResendInterval > 0) {
|
} else if (this.slowResponseNotificationResendInterval > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue