]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Fix symbols display in legacy history,
authorAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 19 Jul 2018 06:47:28 +0000 (09:47 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 19 Jul 2018 06:47:28 +0000 (09:47 +0300)
compact symbols display,
sort symbols by name

Issue: #2348

interface/js/app/history.js

index bfbc838748bee0e25357d555a90b7f070ce3a716..fdab6a54663005331ee18a1c1b4abc2f8e7d2cd7 100644 (file)
@@ -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: {