From c2f00fb418e707a4e3ddbc6460b3e08e9f04ad2f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 20 Mar 2017 13:43:29 +0000 Subject: [WebUI] Rework v2 symbols display --- interface/js/app/history.js | 17 +++++++++++++++-- 1 file 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 = '' + 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": { -- cgit v1.2.3