2013-06-13 14:10:05 +00:00
|
|
|
function init() {
|
2013-07-24 01:14:40 +00:00
|
|
|
$(".alert_header").click(function() {
|
|
|
|
var expanderIcon = $(this).find("i.icon-chevron-down");
|
2015-11-11 19:04:37 +00:00
|
|
|
if (expanderIcon.length !== 0) {
|
2013-07-24 01:14:40 +00:00
|
|
|
expanderIcon.removeClass("icon-chevron-down").addClass("icon-chevron-up");
|
|
|
|
} else {
|
|
|
|
var collapserIcon = $(this).find("i.icon-chevron-up");
|
|
|
|
collapserIcon.removeClass("icon-chevron-up").addClass("icon-chevron-down");
|
|
|
|
}
|
|
|
|
$(this).next().toggle();
|
|
|
|
});
|
2018-03-01 15:26:36 +00:00
|
|
|
|
2018-03-09 13:39:28 +00:00
|
|
|
$("div.show-annotations").click(function() {
|
|
|
|
const targetEl = $('div.show-annotations');
|
|
|
|
const icon = $(targetEl).children('i');
|
2018-03-01 15:26:36 +00:00
|
|
|
|
2018-03-09 13:39:28 +00:00
|
|
|
if (icon.hasClass('glyphicon-unchecked')) {
|
|
|
|
$(".alert_annotations").show();
|
|
|
|
$(".alert_annotations_header").show();
|
|
|
|
$(targetEl).children('i').removeClass('glyphicon-unchecked').addClass('glyphicon-check');
|
|
|
|
targetEl.addClass('is-checked');
|
|
|
|
} else if (icon.hasClass('glyphicon-check')) {
|
|
|
|
$(".alert_annotations").hide();
|
|
|
|
$(".alert_annotations_header").hide();
|
|
|
|
$(targetEl).children('i').removeClass('glyphicon-check').addClass('glyphicon-unchecked');
|
|
|
|
targetEl.removeClass('is-checked');
|
2018-03-01 15:26:36 +00:00
|
|
|
}
|
|
|
|
});
|
2019-10-29 10:09:53 +00:00
|
|
|
|
|
|
|
function displayAlerts(alertState, shouldDisplay) {
|
|
|
|
$("#alertsTable > tbody > tr." + alertState).each(function(_, container) {
|
|
|
|
$(container).toggle(shouldDisplay);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if(localStorage.hideInactiveAlerts === "true") {
|
|
|
|
$("#inactiveAlerts").parent().removeClass("active");
|
|
|
|
displayAlerts("alert-success", false);
|
|
|
|
}
|
|
|
|
if(localStorage.hidePendingAlerts === "true") {
|
|
|
|
$("#pendingAlerts").parent().removeClass("active");
|
|
|
|
displayAlerts("alert-warning", false);
|
|
|
|
}
|
|
|
|
if(localStorage.hideFiringAlerts === "true") {
|
|
|
|
$("#firingAlerts").parent().removeClass("active");
|
|
|
|
displayAlerts("alert-danger", false);
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#alertFilters :input").change(function() {
|
|
|
|
const target = $(this).attr("id");
|
|
|
|
var shouldHide = $(this).parent().hasClass("active");
|
|
|
|
if (target === "inactiveAlerts") {
|
|
|
|
localStorage.setItem("hideInactiveAlerts", shouldHide);
|
|
|
|
displayAlerts("alert-success", !shouldHide);
|
|
|
|
} else if (target === "pendingAlerts") {
|
|
|
|
localStorage.setItem("hidePendingAlerts", shouldHide);
|
|
|
|
displayAlerts("alert-warning", !shouldHide);
|
|
|
|
} else if (target === "firingAlerts") {
|
|
|
|
localStorage.setItem("hideFiringAlerts", shouldHide);
|
|
|
|
displayAlerts("alert-danger", !shouldHide);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2013-06-13 14:10:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$(init);
|