diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-20 13:43:29 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-20 13:43:29 +0000 |
commit | c2f00fb418e707a4e3ddbc6460b3e08e9f04ad2f (patch) | |
tree | 6d59cc1eaeef24f6c34caa222a7723b40fae1cb3 /interface/js/app/history.js | |
parent | 0a0615b1b7eab093d1418a3b16aa13ab8913ccf1 (diff) | |
download | rspamd-c2f00fb418e707a4e3ddbc6460b3e08e9f04ad2f.tar.gz rspamd-c2f00fb418e707a4e3ddbc6460b3e08e9f04ad2f.zip |
[WebUI] Rework v2 symbols display
Diffstat (limited to 'interface/js/app/history.js')
-rw-r--r-- | interface/js/app/history.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/interface/js/app/history.js b/interface/js/app/history.js index d26dce277..8756a5f5a 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -68,8 +68,21 @@ function($, _, Humanize) { function (i, item) { preprocess_item(item); - var symbols = Object.keys(item.symbols); - item.symbols = symbols + Object.keys(item.symbols).map(function(key) { + var sym = item.symbols[key]; + var str = '<strong>' + key + '</strong>' + "(" + sym.score + ")"; + + if (sym.options) { + str += '[' + sym.options.join(",") + "]"; + } + item.symbols[key].str = str; + }); + item.symbols = Object.values(item.symbols). + sort(function(e1, e2) { + return Math.abs(e1.score) < Math.abs(e2.score); + }). + map(function(e) { return e.str; }). + join("<br>\n"); item.time = { "value": unix_time_format(item.unix_time), "options": { |