diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-07 20:27:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 20:27:28 +0100 |
commit | 1c7d251741b58f976f7fbb2a03bd8369311cbdbd (patch) | |
tree | 08b14f4ad696081128d4af53984734412d2f0167 /interface/js | |
parent | 1a4fa45966ebfb5b77af4fd980ba2e6dde4f02c8 (diff) | |
parent | 9de2bdef09aa9cfa1bcbbef07c208e96c737765e (diff) | |
download | rspamd-1c7d251741b58f976f7fbb2a03bd8369311cbdbd.tar.gz rspamd-1c7d251741b58f976f7fbb2a03bd8369311cbdbd.zip |
Merge pull request #3463 from moisseev/webui
[WebUI] Add "rewrite subject" to Status tab widgets
Diffstat (limited to 'interface/js')
-rw-r--r-- | interface/js/app/stats.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js index 18c3a2c08..e2724af47 100644 --- a/interface/js/app/stats.js +++ b/interface/js/app/stats.js @@ -68,12 +68,13 @@ define(["jquery", "d3pie"], var stat_w = []; $.each(data, function (i, item) { - var widgetsOrder = ["scanned", "no action", "greylist", "add header", "reject", "learned"]; + 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>"; } @@ -94,14 +95,15 @@ define(["jquery", "d3pie"], 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(); @@ -160,6 +162,11 @@ define(["jquery", "d3pie"], data: data["add header"], value: data["add header"] }, { + color: "#FF6600", + label: "rewrite subject", + data: data["rewrite subject"], + value: data["rewrite subject"] + }, { color: "#436EEE", label: "greylist", data: data.greylist, @@ -186,6 +193,7 @@ define(["jquery", "d3pie"], actions: { "no action": 0, "add header": 0, + "rewrite subject": 0, "greylist": 0, "reject": 0, "soft reject": 0, |