diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-08 12:22:28 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-08 14:15:20 +0000 |
| commit | 0571368b3bc37f92b06873e02342317006b0da60 (patch) | |
| tree | 35637840d7e9098ee8ea54784d6c03b58e1be8cc /pkg/manager/html | |
| parent | 44b1e39faee03d3a5f496f66157a41f939e74286 (diff) | |
pkg/manager: move HTML code to separate files
Diffstat (limited to 'pkg/manager/html')
| -rw-r--r-- | pkg/manager/html/common.html | 60 | ||||
| -rw-r--r-- | pkg/manager/html/corpus.html | 4 | ||||
| -rw-r--r-- | pkg/manager/html/crash.html | 33 | ||||
| -rw-r--r-- | pkg/manager/html/fallback_cover.html | 19 | ||||
| -rw-r--r-- | pkg/manager/html/job_list.html | 20 | ||||
| -rw-r--r-- | pkg/manager/html/main.html | 112 | ||||
| -rw-r--r-- | pkg/manager/html/prio.html | 18 | ||||
| -rw-r--r-- | pkg/manager/html/raw_cover.html | 22 | ||||
| -rw-r--r-- | pkg/manager/html/syscalls.html | 22 | ||||
| -rw-r--r-- | pkg/manager/html/text.html | 7 | ||||
| -rw-r--r-- | pkg/manager/html/vms.html | 24 |
11 files changed, 341 insertions, 0 deletions
diff --git a/pkg/manager/html/common.html b/pkg/manager/html/common.html new file mode 100644 index 000000000..6a8599902 --- /dev/null +++ b/pkg/manager/html/common.html @@ -0,0 +1,60 @@ +{{/* +Copyright 2024 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. +*/}} + +<!doctype html> +<html> +<head> + <title>{{.PageTitle}}</title> + {{HEAD}} +</head> +<body> + <header id="topbar"> + <table class="position_table"> + <tr> + <td> + <h1><a href="/">syzkaller</a></h1> + </td> + <td> + <form action="/action" method="post"> + <input type="hidden" name="url" value="{{.CurrentURL}}" /> + <button type="submit" name="action" value="toggle-expert" class="action_button{{if .ExpertMode}}_selected{{end}}" title="Toggle expert mode"> + 🧠 + </input> + <button type="submit" name="action" value="pause-unpause" class="action_button{{if .Paused}}_selected{{end}}" title="Pause/unpause fuzzing"> + {{if .Paused}}▶️{{else}}⏸️{{end}} + </input> + </form> + </td> + <td class="search"> + <a href="https://github.com/google/syzkaller/blob/master/docs/" target="_blank">docs</a> | + <a href="https://groups.google.com/forum/#!forum/syzkaller" target="_blank">mailing list</a> | + <a href="{{.GitRevisionLink}}" target="_blank">source {{.GitRevision}}</a> + </td> + </tr> + </table> + <div class="navigation"> + <div class="navigation_tab{{if eq .URLPath "/stats"}}_selected{{end}}"> + <a href='/stats'>📈 stats</a> + </div> + <div class="navigation_tab{{if eq .URLPath "/cover"}}_selected{{end}}"> + <a href='/cover'>📃 coverage</a> + </div> + <div class="navigation_tab{{if eq .URLPath "/syscalls"}}_selected{{end}}"> + <a href='/syscalls'>🤖 syscalls</a> + </div> + <div class="navigation_tab{{if eq .URLPath "/corpus"}}_selected{{end}}"> + <a href='/corpus'>🛒 corpus</a> + </div> + <div class="navigation_tab{{if eq .URLPath "/vms"}}_selected{{end}}"> + <a href='/vms'>💻 VMs</a> + </div> + <div class="navigation_tab{{if eq .URLPath "/config"}}_selected{{end}}"> + <a href='/config'>🔧 config</a> + </div> + </div> + </header> + <br> + %s +</body></html> diff --git a/pkg/manager/html/corpus.html b/pkg/manager/html/corpus.html new file mode 100644 index 000000000..2c3a9272c --- /dev/null +++ b/pkg/manager/html/corpus.html @@ -0,0 +1,4 @@ +{{/* +Copyright 2024 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. +*/}} diff --git a/pkg/manager/html/crash.html b/pkg/manager/html/crash.html new file mode 100644 index 000000000..6554f2817 --- /dev/null +++ b/pkg/manager/html/crash.html @@ -0,0 +1,33 @@ +{{/* +Copyright 2024 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. +*/}} + +<b>{{.Description}}</b> + +{{if .Triaged}} +Report: <a href="/report?id={{.ID}}">{{.Triaged}}</a> +{{end}} + +<table class="list_table"> + <tr> + <th>#</th> + <th>Log</th> + <th>Report</th> + <th>Time</th> + <th>Tag</th> + </tr> + {{range $c := $.Crashes}} + <tr> + <td>{{$c.Index}}</td> + <td><a href="/file?name={{$c.Log}}">log</a></td> + <td> + {{if $c.Report}} + <a href="/file?name={{$c.Report}}">report</a></td> + {{end}} + </td> + <td class="time {{if not $c.Active}}inactive{{end}}">{{formatTime $c.Time}}</td> + <td class="tag {{if not $c.Active}}inactive{{end}}" title="{{$c.Tag}}">{{formatTagHash $c.Tag}}</td> + </tr> + {{end}} +</table> diff --git a/pkg/manager/html/fallback_cover.html b/pkg/manager/html/fallback_cover.html new file mode 100644 index 000000000..007278224 --- /dev/null +++ b/pkg/manager/html/fallback_cover.html @@ -0,0 +1,19 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + <tr> + <th>Call</th> + <th>Successful</th> + <th>Errnos</th> + </tr> + {{range $c := $.Calls}} + <tr> + <td>{{$c.Name}}</td> + <td>{{if $c.Successful}}{{$c.Successful}}{{end}}</td> + <td>{{range $e := $c.Errnos}}{{$e}} {{end}}</td> + </tr> + {{end}} +</table> diff --git a/pkg/manager/html/job_list.html b/pkg/manager/html/job_list.html new file mode 100644 index 000000000..229f8df18 --- /dev/null +++ b/pkg/manager/html/job_list.html @@ -0,0 +1,20 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + <caption>{{.PageTitle}} ({{len .Jobs}}):</caption> + <tr> + <th>Program</th> + <th>Calls</th> + <th>Execs</th> + </tr> + {{range $job := $.Jobs}} + <tr> + <td class="job_description"><a href='/jobs?id={{$job.ID}}'>{{$job.Short}}</a></td> + <td class="job_description">{{$job.Calls}}</td> + <td class="job_description">{{$job.Execs}}</td> + </tr> + {{end}} +</table> diff --git a/pkg/manager/html/main.html b/pkg/manager/html/main.html new file mode 100644 index 000000000..1b4ea0f75 --- /dev/null +++ b/pkg/manager/html/main.html @@ -0,0 +1,112 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + {{range $s := $.Stats}} + <tr> + <td class="stat_name" title="{{$s.Hint}}">{{$s.Name}}</td> + <td class="stat_value"> + {{if $s.Link}} + <a href="{{$s.Link}}">{{$s.Value}}</a> + {{else}} + {{$s.Value}} + {{end}} + </td> + </tr> + {{end}} +</table> + +{{if .Crashes}} +<table class="list_table"> + <caption>Crashes:</caption> + <tr> + <th><a onclick="return sortTable(this, 'Description', textSort)" href="#">Description</a></th> + <th><a onclick="return sortTable(this, 'Count', numSort)" href="#">Count</a></th> + <th><a onclick="return sortTable(this, 'Last Time', textSort, true)" href="#">Last Time</a></th> + <th><a onclick="return sortTable(this, 'Report', textSort)" href="#">Report</a></th> + </tr> + {{range $c := $.Crashes}} + <tr> + <td class="title"><a href="/crash?id={{$c.ID}}">{{$c.Description}}</a></td> + <td class="stat {{if not $c.Active}}inactive{{end}}">{{$c.Count}}</td> + <td class="time {{if not $c.Active}}inactive{{end}}">{{formatTime $c.LastTime}}</td> + <td> + {{if $c.Triaged}} + <a href="/report?id={{$c.ID}}">{{$c.Triaged}}</a> + {{end}} + {{if $c.Strace}} + <a href="/file?name={{$c.Strace}}">Strace</a> + {{end}} + </td> + </tr> + {{end}} +</table> +{{end}} + +{{define "diff_crashes"}} +<table class="list_table"> + <caption>{{.Title}}:</caption> + <tr> + <th>Description</th> + <th>Base</th> + <th>Patched</th> + </tr> + {{range $bug := .List}} + <tr> + <td class="title">{{$bug.Title}}</td> + <td class="title"> + {{if gt $bug.Base.Crashes 0}} + {{$bug.Base.Crashes}} crashes + {{else if $bug.Base.NotCrashed}} + Not affected + {{else}} ? {{end}} + {{if $bug.Base.Report}} + <a href="/file?name={{$bug.Base.Report}}">[report]</a> + {{end}} + </td> + <td class="title"> + {{if gt $bug.Patched.Crashes 0}} + {{$bug.Patched.Crashes}} crashes + {{else}} ? {{end}} + {{if $bug.Patched.Report}} + <a href="/file?name={{$bug.Patched.Report}}">[report]</a> + {{end}} + {{if $bug.Patched.CrashLog}} + <a href="/file?name={{$bug.Patched.CrashLog}}">[crash log]</a> + {{end}} + {{if $bug.Patched.Repro}} + <a href="/file?name={{$bug.Patched.Repro}}">[syz repro]</a> + {{end}} + {{if $bug.Patched.ReproLog}} + <a href="/file?name={{$bug.Patched.ReproLog}}">[repro log]</a> + {{end}} + {{if $bug.Reproducing}}[reproducing]{{end}} + </td> + </tr> + {{end}} +</table> +{{end}} + +{{if .PatchedOnly}} +{{template "diff_crashes" .PatchedOnly}} +{{end}} + +{{if .AffectsBoth}} +{{template "diff_crashes" .AffectsBoth}} +{{end}} + +{{if .InProgress}} +{{template "diff_crashes" .InProgress}} +{{end}} + +<b>Log:</b> +<br> +<textarea id="log_textarea" readonly rows="20" wrap=off> +{{.Log}} +</textarea> +<script> + var textarea = document.getElementById("log_textarea"); + textarea.scrollTop = textarea.scrollHeight; +</script> diff --git a/pkg/manager/html/prio.html b/pkg/manager/html/prio.html new file mode 100644 index 000000000..551ec117b --- /dev/null +++ b/pkg/manager/html/prio.html @@ -0,0 +1,18 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + <caption>Priorities for {{$.Call}}:</caption> + <tr> + <th><a onclick="return sortTable(this, 'Prio', floatSort)" href="#">Prio</a></th> + <th><a onclick="return sortTable(this, 'Call', textSort)" href="#">Call</a></th> + </tr> + {{range $p := $.Prios}} + <tr> + <td>{{printf "%5v" $p.Prio}}</td> + <td><a href='/prio?call={{$p.Call}}'>{{$p.Call}}</a></td> + </tr> + {{end}} +</table> diff --git a/pkg/manager/html/raw_cover.html b/pkg/manager/html/raw_cover.html new file mode 100644 index 000000000..391e8e80f --- /dev/null +++ b/pkg/manager/html/raw_cover.html @@ -0,0 +1,22 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + <caption>Raw cover</caption> + <tr> + <th>Line</th> + <th>Links</th> + </tr> + {{range $line := .Calls}} + <tr> + <td>{{$line.Call}}</td> + <td> + {{range $id := $line.UpdateIDs}} + <a href="/rawcover?input={{$line.Sig}}&update_id={{$id}}">[{{$id}}]</a> + {{end}} +</td> + </tr> + {{end}} +</table> diff --git a/pkg/manager/html/syscalls.html b/pkg/manager/html/syscalls.html new file mode 100644 index 000000000..cb6991f42 --- /dev/null +++ b/pkg/manager/html/syscalls.html @@ -0,0 +1,22 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + <caption>Per-syscall coverage:</caption> + <tr> + <th><a onclick="return sortTable(this, 'Syscall', textSort)" href="#">Syscall</a></th> + <th><a onclick="return sortTable(this, 'Inputs', numSort)" href="#">Inputs</a></th> + <th><a onclick="return sortTable(this, 'Coverage', numSort)" href="#">Coverage</a></th> + <th>Prio</th> + </tr> + {{range $c := $.Calls}} + <tr> + <td>{{$c.Name}}{{if $c.ID }} [{{$c.ID}}]{{end}}</td> + <td><a href='/corpus?call={{$c.Name}}'>{{$c.Inputs}}</a></td> + <td><a href='/cover?call={{$c.Name}}'>{{$c.Cover}}</a></td> + <td><a href='/prio?call={{$c.Name}}'>prio</a></td> + </tr> + {{end}} +</table> diff --git a/pkg/manager/html/text.html b/pkg/manager/html/text.html new file mode 100644 index 000000000..8e991a90e --- /dev/null +++ b/pkg/manager/html/text.html @@ -0,0 +1,7 @@ +{{/* +Copyright 2024 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. +*/}} + +{{.HTML}} +<pre>{{printf "%s" .Text}}</pre> diff --git a/pkg/manager/html/vms.html b/pkg/manager/html/vms.html new file mode 100644 index 000000000..35c9d6c8c --- /dev/null +++ b/pkg/manager/html/vms.html @@ -0,0 +1,24 @@ +{{/* +Copyright 2024 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. +*/}} + +<table class="list_table"> + <caption>VM Info:</caption> + <tr> + <th><a onclick="return sortTable(this, 'Name', textSort)" href="#">Name</a></th> + <th><a onclick="return sortTable(this, 'State', textSort)" href="#">State</a></th> + <th><a onclick="return sortTable(this, 'Since', timeSort)" href="#">Since</a></th> + <th><a onclick="return sortTable(this, 'Machine Info', timeSort)" href="#">Machine Info</a></th> + <th><a onclick="return sortTable(this, 'Status', timeSort)" href="#">Status</a></th> + </tr> + {{range $vm := $.VMs}} + <tr> + <td>{{$vm.Name}}</td> + <td>{{$vm.State}}</td> + <td>{{formatDuration $vm.Since}}</td> + <td>{{optlink $vm.MachineInfo "info"}}</td> + <td>{{optlink $vm.DetailedStatus "status"}}</td> + </tr> + {{end}} +</table> |
