From e41ae765efe204eaad0db9849ec8a9a5fa455ce6 Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Thu, 19 Jul 2018 09:47:28 +0300 Subject: [PATCH] [WebUI] Fix symbols display in legacy history, compact symbols display, sort symbols by name Issue: #2348 --- interface/js/app/history.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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: { -- 2.39.5