Change seconds to minutes

pull/1212/head
OidaTiftla 3 years ago
parent 65fc71e485
commit 11e9eee09d

@ -403,7 +403,7 @@ class Monitor extends BeanModel {
bean.important = false; bean.important = false;
if (bean.status === DOWN && this.resendInterval > 0) { if (bean.status === DOWN && this.resendInterval > 0) {
timeSinceLastNotified = dayjs().valueOf() - (bean.lastNotifiedTime || 0); timeSinceLastNotified = (dayjs().valueOf() - (bean.lastNotifiedTime || 0)) / 60; // divide by 60 to convert from seconds to minutes
if (timeSinceLastNotified >= this.resendInterval) { if (timeSinceLastNotified >= this.resendInterval) {
// Send notification again, because we are still DOWN // Send notification again, because we are still DOWN
debug(`[${this.name}] sendNotification`); debug(`[${this.name}] sendNotification`);

@ -2,6 +2,7 @@ export default {
languageName: "English", languageName: "English",
checkEverySecond: "Check every {0} seconds", checkEverySecond: "Check every {0} seconds",
retryCheckEverySecond: "Retry every {0} seconds", retryCheckEverySecond: "Retry every {0} seconds",
resendEveryMinute: "Resend every {0} minutes if DOWN",
retriesDescription: "Maximum retries before the service is marked as down and a notification is sent", retriesDescription: "Maximum retries before the service is marked as down and a notification is sent",
ignoreTLSError: "Ignore TLS/SSL error for HTTPS websites", ignoreTLSError: "Ignore TLS/SSL error for HTTPS websites",
upsideDownModeDescription: "Flip the status upside down. If the service is reachable, it is DOWN.", upsideDownModeDescription: "Flip the status upside down. If the service is reachable, it is DOWN.",

@ -140,7 +140,7 @@
<div class="my-3"> <div class="my-3">
<label for="resend-interval" class="form-label"> <label for="resend-interval" class="form-label">
{{ $t("Notification resend Interval if Down") }} {{ $t("Notification resend Interval if Down") }}
<span>({{ $t("resendEverySecond", [ monitor.resendInterval ]) }})</span> <span>({{ $t("resendEveryMinute", [ monitor.resendInterval ]) }})</span>
</label> </label>
<input id="resend-interval" v-model="monitor.resendInterval" type="number" class="form-control" required min="20" step="1"> <input id="resend-interval" v-model="monitor.resendInterval" type="number" class="form-control" required min="20" step="1">
</div> </div>
@ -439,6 +439,7 @@ export default {
method: "GET", method: "GET",
interval: 60, interval: 60,
retryInterval: this.interval, retryInterval: this.interval,
resendInterval: 0,
maxretries: 0, maxretries: 0,
notificationIDList: {}, notificationIDList: {},
ignoreTls: false, ignoreTls: false,

Loading…
Cancel
Save