$.each(data, function (i, item) {
var widgetsOrder = ["scanned", "no action", "greylist", "add header", "rewrite subject", "reject", "learned"];
- function widget(k, v) {
+ function widget(k, v, cls) {
+ var c = (typeof cls === "undefined") ? "" : cls;
var titleAtt = d3.format(",")(v) + " " + k;
return '<div class="card stat-box d-inline-block text-center bg-light shadow-sm mr-3 px-3">' +
- '<div class="widget overflow-hidden p-2" title="' + titleAtt +
+ '<div class="widget overflow-hidden p-2' + c + '" title="' + titleAtt +
'"><strong class="d-block mt-2 mb-1 font-weight-bold">' +
d3.format(".3~s")(v) + "</strong>" + k + "</div></div>";
}
stat_w[widgetsOrder.indexOf(action)] = widget(action, count);
});
} else {
- stat_w[widgetsOrder.indexOf(i)] = widget(i, item);
+ stat_w[widgetsOrder.indexOf(i)] = widget(i, item, " text-capitalize");
}
});
$.each(stat_w, function (i, item) {
$(item).appendTo(widgets);
});
$("#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\"></div></div>");
+ .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");
$("#clusterTable tbody").empty();