summaryrefslogtreecommitdiffstats
path: root/interface/js/app/history.js
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-07-19 09:47:28 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-07-19 09:47:28 +0300
commite41ae765efe204eaad0db9849ec8a9a5fa455ce6 (patch)
tree8835f321902e54f147c84c8d26764719470ecc99 /interface/js/app/history.js
parent4c75b1bd1286acc82b213256ed27b41a56771085 (diff)
downloadrspamd-e41ae765efe204eaad0db9849ec8a9a5fa455ce6.tar.gz
rspamd-e41ae765efe204eaad0db9849ec8a9a5fa455ce6.zip
[WebUI] Fix symbols display in legacy history,
compact symbols display, sort symbols by name Issue: #2348
Diffstat (limited to 'interface/js/app/history.js')
-rw-r--r--interface/js/app/history.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/interface/js/app/history.js b/interface/js/app/history.js
index bfbc83874..fdab6a546 100644
--- a/interface/js/app/history.js
+++ b/interface/js/app/history.js
@@ -70,7 +70,7 @@ define(["jquery", "footable", "humanize"],
if (!sym.name) {
sym.name = key;
}
- sym.name = EscapeHTML(key);
+ sym.name = EscapeHTML(sym.name);
if (sym.description) {
sym.description = EscapeHTML(sym.description);
}
@@ -218,6 +218,10 @@ define(["jquery", "footable", "humanize"],
function process_history_legacy(data) {
var items = [];
+ var compare = function (e1, e2) {
+ return e1.name.localeCompare(e2.name);
+ };
+
$.each(data, function (i, item) {
item.time = unix_time_format(item.unix_time);
preprocess_item(item);
@@ -227,6 +231,13 @@ define(["jquery", "footable", "humanize"],
},
value: item.scan_time
};
+ item.symbols = Object.keys(item.symbols)
+ .map(function (key) {
+ return item.symbols[key];
+ })
+ .sort(compare)
+ .map(function (e) { return e.name; })
+ .join(", ");
item.time = {
value: unix_time_format(item.unix_time),
options: {