aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2020-08-08 20:59:27 +0300
committermoisseev <moiseev@mezonplus.ru>2020-08-08 20:59:27 +0300
commit1b34085ec52494c59b203908a4976d05aaa0f28f (patch)
treed968edb1a28c53c827b8a19a4a3024848f20ea2f /interface/js
parentcb776ef73e9043843480db683392cba4636feb51 (diff)
downloadrspamd-1b34085ec52494c59b203908a4976d05aaa0f28f.tar.gz
rspamd-1b34085ec52494c59b203908a4976d05aaa0f28f.zip
[WebUI] Add Bayesian statistics info
Diffstat (limited to 'interface/js')
-rw-r--r--interface/js/app/stats.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js
index 57e16261e..532aec922 100644
--- a/interface/js/app/stats.js
+++ b/interface/js/app/stats.js
@@ -142,6 +142,37 @@ define(["jquery", "d3pie"],
$('#selSrv [value="' + key + '"]').prop("disabled", true);
}
});
+
+ function addStatfiles(server, statfiles) {
+ $.each(statfiles, function (i, statfile) {
+ var cls = "";
+ switch (statfile.symbol) {
+ case "BAYES_SPAM":
+ cls = "symbol-positive";
+ break;
+ case "BAYES_HAM":
+ cls = "symbol-negative";
+ break;
+ default:
+ }
+ $("#bayesTable tbody").append("<tr>" +
+ (i === 0 ? '<td rowspan="' + statfiles.length + '">' + server + "</td>" : "") +
+ '<td class="' + cls + '">' + statfile.symbol + "</td>" +
+ '<td class="' + cls + '">' + statfile.type + "</td>" +
+ '<td class="' + cls + '">' + statfile.revision + "</td>" +
+ '<td class="' + cls + '">' + statfile.users + "</td></tr>");
+ });
+ }
+ $("#bayesTable tbody").empty();
+ if (checked_server === "All SERVERS") {
+ $.each(servers, function (server, val) {
+ if (server !== "All SERVERS") {
+ addStatfiles(server, val.data.statfiles);
+ }
+ });
+ } else {
+ addStatfiles(checked_server, data.statfiles);
+ }
}
function getChart(rspamd, pie, checked_server) {