Skip to content
Permalink
Browse files

dashboard/app: tidy up UI

Don't show maintainers for crashes if we don't have them (only linux has).
Show short git hashes for kernel/syzkaller, 40 chars looks excessive (full hash is in hint).
Show current build kernel/syzkaller git hash in managers table.
Remove fuzzing time from managers table (does not seem too useful).
  • Loading branch information...
dvyukov committed Sep 20, 2018
1 parent 9a6f6af commit 4fb3cca18fff0effc3555d2baf840b1717b62407
Showing with 54 additions and 28 deletions.
  1. +6 −2 dashboard/app/bug.html
  2. +9 −0 dashboard/app/handler.go
  3. +26 −17 dashboard/app/main.go
  4. +11 −7 dashboard/app/main.html
  5. +2 −2 dashboard/app/static/style.css
@@ -47,21 +47,25 @@
<th><a onclick="return sortTable(this, 'Report', reproSort)" href="#">Report</a></th>
<th><a onclick="return sortTable(this, 'Syz repro', reproSort)" href="#">Syz repro</a></th>
<th><a onclick="return sortTable(this, 'C repro', textSort)" href="#">C repro</a></th>
{{if $.HasMaintainers}}
<th><a onclick="return sortTable(this, 'Maintainers', textSort)" href="#">Maintainers</a></th>
{{end}}
</tr>
{{range $c := $.Crashes}}
<tr>
<td class="manager">{{$c.Manager}}</td>
<td class="time">{{formatTime $c.Time}}</td>
<td class="kernel" title="{{$c.KernelAlias}}">{{$c.KernelAlias}}</td>
<td class="tag">{{$c.KernelCommit}}</td>
<td class="tag">{{$c.SyzkallerCommit}}</td>
<td class="tag" title="{{$c.KernelCommit}}">{{formatShortHash $c.KernelCommit}}</td>
<td class="tag" title="{{$c.SyzkallerCommit}}">{{formatShortHash $c.SyzkallerCommit}}</td>
<td class="config">{{if $c.KernelConfigLink}}<a href="{{$c.KernelConfigLink}}">.config</a>{{end}}</td>
<td class="repro">{{if $c.LogLink}}<a href="{{$c.LogLink}}">log</a>{{end}}</td>
<td class="repro">{{if $c.ReportLink}}<a href="{{$c.ReportLink}}">report</a>{{end}}</td>
<td class="repro">{{if $c.ReproSyzLink}}<a href="{{$c.ReproSyzLink}}">syz</a>{{end}}</td>
<td class="repro">{{if $c.ReproCLink}}<a href="{{$c.ReproCLink}}">C</a>{{end}}</td>
{{if $.HasMaintainers}}
<td class="maintainers" title="{{$c.Maintainers}}">{{$c.Maintainers}}</td>
{{end}}
</tr>
{{end}}
</table>
@@ -150,6 +150,14 @@ func formatStat(v int64) string {
return fmt.Sprint(v)
}

func formatShortHash(v string) string {
const hashLen = 8
if len(v) <= hashLen {
return v
}
return v[:hashLen]
}

var (
templates = template.Must(template.New("").Funcs(templateFuncs).ParseGlob("*.html"))

@@ -160,5 +168,6 @@ var (
"formatLateness": formatLateness,
"formatReproLevel": formatReproLevel,
"formatStat": formatStat,
"formatShortHash": formatShortHash,
}
)
@@ -67,14 +67,15 @@ type uiBuild struct {
}

type uiBugPage struct {
Header *uiHeader
Now time.Time
Bug *uiBug
DupOf *uiBugGroup
Dups *uiBugGroup
Similar *uiBugGroup
SampleReport []byte
Crashes []*uiCrash
Header *uiHeader
Now time.Time
Bug *uiBug
DupOf *uiBugGroup
Dups *uiBugGroup
Similar *uiBugGroup
SampleReport []byte
HasMaintainers bool
Crashes []*uiCrash
}

type uiBugNamespace struct {
@@ -248,15 +249,23 @@ func handleBug(c context.Context, w http.ResponseWriter, r *http.Request) error
if err != nil {
return err
}
hasMaintainers := false
for _, crash := range crashes {
if len(crash.Maintainers) != 0 {
hasMaintainers = true
break
}
}
data := &uiBugPage{
Header: commonHeader(c, r),
Now: timeNow(c),
Bug: uiBug,
DupOf: dupOf,
Dups: dups,
Similar: similar,
SampleReport: sampleReport,
Crashes: crashes,
Header: commonHeader(c, r),
Now: timeNow(c),
Bug: uiBug,
DupOf: dupOf,
Dups: dups,
Similar: similar,
SampleReport: sampleReport,
HasMaintainers: hasMaintainers,
Crashes: crashes,
}
return serveTemplate(w, "bug.html", data)
}
@@ -646,7 +655,7 @@ func loadCrashesForBug(c context.Context, bug *Bug) ([]*uiCrash, []byte, error)
ui := &uiCrash{
Manager: crash.Manager,
Time: crash.Time,
Maintainers: fmt.Sprintf("%q", crash.Maintainers),
Maintainers: strings.Join(crash.Maintainers, ", "),
LogLink: textLink(textCrashLog, crash.Log),
ReportLink: textLink(textCrashReport, crash.Report),
ReproSyzLink: textLink(textReproSyz, crash.ReproSyz),
@@ -29,10 +29,11 @@
<caption id="managers"><a class="plain" href="#managers">Managers:</a></caption>
<tr>
<th>Name</th>
<th>Last Active</th>
<th>Current Build</th>
<th>Current Uptime</th>
<th>Today: Fuzzing Time</th>
<th>Active</th>
<th>Uptime</th>
<th>Build</th>
<th>Kernel</th>
<th>Syzkaller</th>
<th>Corpus</th>
<th>Coverage</th>
<th>Crashes</th>
@@ -47,13 +48,16 @@
{{if $mgr.Link}}</a>{{end}}
</td>
<td class="stat {{if $mgr.LastActiveBad}}bad{{end}}">{{formatLateness $.Now $mgr.LastActive}}</td>
<td class="stat">{{formatDuration $mgr.CurrentUpTime}}</td>
{{if $mgr.CurrentBuild}}
<td class="stat" title="{{$mgr.CurrentBuild.KernelAlias}}/{{$mgr.CurrentBuild.KernelCommit}} (syzkaller {{$mgr.CurrentBuild.SyzkallerCommit}})">{{formatLateness $.Now $mgr.CurrentBuild.Time}}</td>
<td class="stat">{{formatLateness $.Now $mgr.CurrentBuild.Time}}</td>
<td class="stat" title="{{$mgr.CurrentBuild.KernelAlias}} {{$mgr.CurrentBuild.KernelCommit}}">{{formatShortHash $mgr.CurrentBuild.KernelCommit}}</td>
<td class="stat" title="{{$mgr.CurrentBuild.SyzkallerCommit}}">{{formatShortHash $mgr.CurrentBuild.SyzkallerCommit}}</td>
{{else}}
<td></td>
<td></td>
<td></td>
{{end}}
<td class="stat">{{formatDuration $mgr.CurrentUpTime}}</td>
<td class="stat">{{formatDuration $mgr.TotalFuzzingTime}}</td>
<td class="stat">{{formatStat $mgr.MaxCorpus}}</td>
<td class="stat">{{formatStat $mgr.MaxCover}}</td>
<td class="stat">{{formatStat $mgr.TotalCrashes}}</td>
@@ -80,8 +80,8 @@ table td, table th {
.list_table .tag {
font-family: monospace;
font-size: 8pt;
width: 200pt;
max-width: 200pt;
width: 40pt;
max-width: 40pt;
}

.list_table .opts {

0 comments on commit 4fb3cca

Please sign in to comment.
You can’t perform that action at this time.