mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-04-08 06:30:05 +00:00
Fix JS to run applyFilters only when statuses have changed
This commit is contained in:
parent
9ce8249123
commit
7abcd4adbe
1 changed files with 6 additions and 2 deletions
|
@ -274,6 +274,7 @@ $(function () {
|
|||
dataType: "json",
|
||||
timeout: 2000,
|
||||
success: function (data) {
|
||||
var statusChanged = false;
|
||||
for (var i = 0, el; (el = data.details[i]); i++) {
|
||||
if (lastStatus[el.code] != el.status) {
|
||||
lastStatus[el.code] = el.status;
|
||||
|
@ -281,6 +282,7 @@ $(function () {
|
|||
"class",
|
||||
"status ic-" + el.status,
|
||||
);
|
||||
statusChanged = true;
|
||||
}
|
||||
|
||||
if (lastStarted[el.code] != el.started) {
|
||||
|
@ -289,6 +291,7 @@ $(function () {
|
|||
"started",
|
||||
el.started,
|
||||
);
|
||||
statusChanged = true;
|
||||
}
|
||||
|
||||
if (lastPing[el.code] != el.last_ping) {
|
||||
|
@ -297,8 +300,9 @@ $(function () {
|
|||
}
|
||||
}
|
||||
|
||||
// If there are any active status filters, then we need to re-apply filters
|
||||
if ($(".filter-btn:visible").length) {
|
||||
// If there were status updates and we have active status filters
|
||||
// then we need to reapply filters now:
|
||||
if (statusChanged && $(".filter-btn:visible").length) {
|
||||
applyFilters();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue