diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index c7e54433..f2ef0dcf 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -468,29 +468,34 @@ jQuery(function($){ else { item.rcpt = item.rcpt_smtp.join(", "); } - Object.keys(item.symbols).map(function(key) { + item.symbols = Object.keys(item.symbols).sort(function (a, b) { + if (item.symbols[a].score === 0) return 1 + if (item.symbols[b].score === 0) return -1 + if (item.symbols[b].score < 0 && item.symbols[a].score < 0) { + return item.symbols[a].score - item.symbols[b].score + } + if (item.symbols[b].score > 0 && item.symbols[a].score > 0) { + return item.symbols[b].score - item.symbols[a].score + } + return item.symbols[b].score - item.symbols[a].score + }).map(function(key) { var sym = item.symbols[key]; - if (sym.score <= 0) { + if (sym.score < 0) { sym.score_formatted = '(' + sym.score + ')' } + else if (sym.score === 0) { + sym.score_formatted = '(' + sym.score + ')' + } else { sym.score_formatted = '(' + sym.score + ')' } var str = '' + key + ' ' + sym.score_formatted; if (sym.options) { - str += ' [' + sym.options.join(",") + "]"; + str += ' [' + sym.options.join(", ") + "]"; } - item.symbols[key].str = str; - }); + return str + }).join('
\n'); item.subject = escapeHtml(item.subject); - item.symbols = Object.keys(item.symbols). - map(function(key) { - return item.symbols[key]; - }).sort(function(e1, e2) { - return Math.abs(e1.score) < Math.abs(e2.score); - }).map(function(e) { - return e.str; - }).join("
\n"); var scan_time = item.time_real.toFixed(3) + ' / ' + item.time_virtual.toFixed(3); item.scan_time = { "options": { diff --git a/data/web/js/site/quarantine.js b/data/web/js/site/quarantine.js index b1c0bc83..6364b579 100644 --- a/data/web/js/site/quarantine.js +++ b/data/web/js/site/quarantine.js @@ -98,6 +98,12 @@ jQuery(function($){ data.symbols.sort(function (a, b) { if (a.score === 0) return 1 if (b.score === 0) return -1 + if (b.score < 0 && a.score < 0) { + return a.score - b.score + } + if (b.score > 0 && a.score > 0) { + return b.score - a.score + } return b.score - a.score }) $.each(data.symbols, function (index, value) {