diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-24 20:39:37 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-24 20:39:37 +0200 |
| commit | e02ac807a0ff5dd10cd97b56b2b5eb1ce69fd88d (patch) | |
| tree | fa36dbcedc87f4d41e3c2a18c7ac01f950fdc97d /dashboard/app/static | |
| parent | 8ec5fc8d3c2c38c9e1f17ff6005b7b888705163d (diff) | |
dashboard/app: show recent crashes first after time sorting
Diffstat (limited to 'dashboard/app/static')
| -rw-r--r-- | dashboard/app/static/common.js | 7 |
1 files changed, 5 insertions, 2 deletions
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++) { |
