aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-03-08 11:32:33 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-03-08 11:32:33 +0100
commit549f0dc24e0f395223d16069bb2692bafdf3e2da (patch)
treeaa3a49d9615b6116c4a81ea29e5750994672b56d
parent7166783e9b5219026ab0456ba1191c89897f38d6 (diff)
dashboard/app: allow sorting crash table
Sorting at least by date may be useful.
-rw-r--r--dashboard/app/bug.html22
-rw-r--r--dashboard/app/static/common.js23
2 files changed, 34 insertions, 11 deletions
diff --git a/dashboard/app/bug.html b/dashboard/app/bug.html
index 89f8d6c05..3f99d798f 100644
--- a/dashboard/app/bug.html
+++ b/dashboard/app/bug.html
@@ -32,17 +32,17 @@ Page with details about a single bug.
<table class="list_table">
<caption>Crashes ({{.Bug.NumCrashes}}):</caption>
<tr>
- <th>Manager</th>
- <th>Time</th>
- <th>Kernel</th>
- <th>Commit</th>
- <th>Syzkaller</th>
- <th>Config</th>
- <th>Log</th>
- <th>Report</th>
- <th>Syz repro</th>
- <th>C repro</th>
- <th>Maintainers</th>
+ <th><a onclick="return sortTable('Manager', textSort)" href="#">Manager</a></th>
+ <th><a onclick="return sortTable('Time', dateSort)" href="#">Time</a></th>
+ <th><a onclick="return sortTable('Kernel', textSort)" href="#">Kernel</a></th>
+ <th><a onclick="return sortTable('Commit', textSort)" href="#">Commit</a></th>
+ <th><a onclick="return sortTable('Syzkaller', textSort)" href="#">Syzkaller</a></th>
+ <th><a onclick="return sortTable('Config', textSort)" href="#">Config</a></th>
+ <th><a onclick="return sortTable('Log', textSort)" href="#">Log</a></th>
+ <th><a onclick="return sortTable('Report', reproSort)" href="#">Report</a></th>
+ <th><a onclick="return sortTable('Syz repro', reproSort)" href="#">Syz repro</a></th>
+ <th><a onclick="return sortTable('C repro', textSort)" href="#">C repro</a></th>
+ <th><a onclick="return sortTable('Maintainers', textSort)" href="#">Maintainers</a></th>
</tr>
{{range $c := $.Crashes}}
<tr>
diff --git a/dashboard/app/static/common.js b/dashboard/app/static/common.js
index d3e408e64..c2e021d81 100644
--- a/dashboard/app/static/common.js
+++ b/dashboard/app/static/common.js
@@ -62,3 +62,26 @@ function timeSort(v) {
return parseInt(v) * 60 * 24;
return 1000000000;
}
+
+function dateSort(v) {
+ if (v == "")
+ return 0;
+ switch (v.substring(0, 3)) {
+ case "Jan": w = 0; break;
+ case "Feb": w = 1; break;
+ case "Mar": w = 2; break;
+ case "Apr": w = 3; break;
+ case "May": w = 4; break;
+ case "Jun": w = 5; break;
+ case "Jul": w = 6; break;
+ case "Aug": w = 7; break;
+ case "Sep": w = 8; break;
+ case "Oct": w = 9; break;
+ case "Nov": w = 10; break;
+ case "Dec": w = 11; break;
+ }
+ w = w * 100 + parseInt(v.substring(4, 6));
+ w = w * 100 + parseInt(v.substring(7, 9));
+ w = w * 100 + parseInt(v.substring(10, 12));
+ return -w;
+}