From: Vsevolod Stakhov Date: Mon, 20 Mar 2017 13:43:29 +0000 (+0000) Subject: [WebUI] Rework v2 symbols display X-Git-Tag: 1.5.4~76 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c2f00fb418e707a4e3ddbc6460b3e08e9f04ad2f;p=rspamd.git [WebUI] Rework v2 symbols display --- 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 = '' + key + '' + "(" + 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("
\n"); item.time = { "value": unix_time_format(item.unix_time), "options": {