Add slow response notification resend interval to db/gui

This commit is contained in:
Stephen Papierski 2023-10-29 12:28:49 -06:00
parent daacc2842e
commit 8669c5df50
2 changed files with 12 additions and 0 deletions

View file

@ -6,6 +6,7 @@ exports.up = function (knex) {
table.integer("slow_response_notification_threshold").defaultTo(0);
table.integer("slow_response_notification_range").defaultTo(0);
table.string("slow_response_notification_method").defaultTo("");
table.integer("slow_response_notification_resend_interval").defaultTo(0);
});
}
@ -16,5 +17,6 @@ exports.down = function (knex) {
table.integer("slow_response_notification_threshold").defaultTo(0);
table.integer("slow_response_notification_range").defaultTo(0);
table.string("slow_response_notification_method").defaultTo("");
table.integer("slow_response_notification_resend_interval").defaultTo(0);
});
}

View file

@ -465,6 +465,15 @@
</div>
</div>
<div v-if="monitor.slowResponseNotification" class="my-3">
<label for="slow-response-notification-resend-interval" class="form-label">
{{ $t("Resend Notification if Slow Response X times consecutively") }}
<span v-if="monitor.slowResponseNotificationResendInterval > 0">({{ $t("resendEveryXTimes", [ monitor.slowResponseNotificationResendInterval ]) }})</span>
<span v-else>({{ $t("resendDisabled") }})</span>
</label>
<input id="slow-response-notification-resend-interval" v-model="monitor.slowResponseNotificationResendInterval" type="number" class="form-control" required min="0" step="1">
</div>
<h2 v-if="monitor.type !== 'push'" class="mt-5 mb-2">{{ $t("Advanced") }}</h2>
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' " class="my-3 form-check">
@ -939,6 +948,7 @@ const monitorDefaults = {
slowResponseNotificationThreshold: 5000,
slowResponseNotificationRange: 60,
slowResponseNotificationMethod: "average",
slowResponseNotificationResendInterval: 0,
};
export default {