}
function displayStatWidgets(checked_server) {
- var widgets = $("#statWidgets");
- $(widgets).empty().hide();
-
var servers = JSON.parse(sessionStorage.getItem("Credentials"));
var data = {};
-
if (servers && servers[checked_server]) {
data = servers[checked_server].data;
}
- var stat_w = [];
+ var stat_w = [];
+ $("#statWidgets").empty().hide();
$.each(data, function (i, item) {
var widgetsOrder = ["scanned", "no action", "greylist", "add header", "rewrite subject", "reject", "learned"];
}
$('<div class="' + cls + 'float-left px-3"><strong class="d-block mt-2 mb-1 font-weight-bold">' +
val + "</strong>" + i + "</div>")
- .appendTo(widgets);
+ .appendTo("#statWidgets");
} else if (i === "actions") {
$.each(item, function (action, count) {
stat_w[widgetsOrder.indexOf(action)] = widget(action, count);
}
});
$.each(stat_w, function (i, item) {
- $(item).appendTo(widgets);
+ $(item).appendTo("#statWidgets");
});
$("#statWidgets > div:not(.stat-box)")
.wrapAll('<div class="card stat-box text-center bg-light shadow-sm float-right">' +
'<div class="widget overflow-hidden p-2 text-capitalize"></div></div>');
$("#statWidgets").find("div.float-right").appendTo("#statWidgets");
+ $("#statWidgets").show();
$("#clusterTable tbody").empty();
$("#selSrv").empty();
$('#selSrv [value="' + key + '"]').prop("disabled", true);
}
});
- $(widgets).show();
}
function getChart(rspamd, pie, checked_server) {