From e02ac807a0ff5dd10cd97b56b2b5eb1ce69fd88d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 24 Aug 2018 20:39:37 +0200 Subject: dashboard/app: show recent crashes first after time sorting --- dashboard/app/bug.html | 2 +- dashboard/app/static/common.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dashboard/app/bug.html b/dashboard/app/bug.html index 2cdfc8d78..056699fae 100644 --- a/dashboard/app/bug.html +++ b/dashboard/app/bug.html @@ -38,7 +38,7 @@ Page with details about a single bug. All crashes ({{.Bug.NumCrashes}}): Manager - Time + Time Kernel Commit Syzkaller diff --git a/dashboard/app/static/common.js b/dashboard/app/static/common.js index f2c2a8c4a..5a146f3bd 100644 --- a/dashboard/app/static/common.js +++ b/dashboard/app/static/common.js @@ -1,14 +1,17 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. -function sortTable(item, colName, conv) { +function sortTable(item, colName, conv, desc = false) { table = item.parentNode.parentNode.parentNode; rows = table.getElementsByTagName("tr"); col = findColumnByName(rows[0].getElementsByTagName("th"), colName); values = new Array; for (i = 1; i < rows.length; i++) values[i] = conv(rows[i].getElementsByTagName("td")[col].textContent); - desc = isSorted(values); + if (desc) + desc = !isSorted(values.slice().reverse()) + else + desc = isSorted(values); do { changed = false; for (i = 1; i < values.length - 1; i++) { -- cgit mrf-deployment