From b0155b7757d541dc59fec0fc3c3f7f4f97c5469f Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Sat, 13 Oct 2018 20:46:53 +0300 Subject: [WebUI] Colorize symbols --- interface/js/app/history.js | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'interface/js/app') diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 184be994c..8717d2e8e 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -177,24 +177,36 @@ define(["jquery", "footable", "humanize"], return {full:full, shrt:shrt}; } + function get_symbol_class(name, score) { + if (name.match(/^GREYLIST$/)) { + return "symbol-special"; + } + + if (score < 0) { + return "symbol-negative"; + } else if (score > 0) { + return "symbol-positive"; + } + return null; + } + preprocess_item(item); Object.keys(item.symbols).forEach(function (key) { - var str = null; var sym = item.symbols[key]; + sym.str = ''; if (sym.description) { - str = "" + sym.name + "(" + sym.score + ")"; - + sym.str += '' + + sym.name + " (" + sym.score + ")"; // Store description for tooltip symbolDescriptions[key] = sym.description; } else { - str = "" + sym.name + "(" + sym.score + ")"; + sym.str += sym.name + " (" + sym.score + ")"; } if (sym.options) { - str += "[" + sym.options.join(",") + "]"; + sym.str += " [" + sym.options.join(",") + "]"; } - sym.str = str; }); unsorted_symbols.push(item.symbols); item.symbols = sort_symbols(item.symbols, compare_function); @@ -204,8 +216,7 @@ define(["jquery", "footable", "humanize"], sortValue: item.unix_time } }; - var scan_time = item.time_real.toFixed(3) + " / " + - item.time_virtual.toFixed(3); + var scan_time = item.time_real.toFixed(3) + " / " + item.time_virtual.toFixed(3); item.scan_time = { options: { sortValue: item.time_real -- cgit v1.2.3