Html程序  |  105行  |  3.54 KB

{{/*
Copyright 2017 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.
*/}}

{{/* Common page head part, invoked with *uiHeader */}}
{{define "head"}}
	<link rel="stylesheet" href="/static/style.css"/>
	<script src="/static/common.js"></script>
	{{if .AnalyticsTrackingID}}
		<script async src="https://www.googletagmanager.com/gtag/js?id={{.AnalyticsTrackingID}}"></script>
		<script>
			window.dataLayer = window.dataLayer || [];
			function gtag() { dataLayer.push(arguments); }
			gtag('js', new Date());
			gtag('config', '{{.AnalyticsTrackingID}}');
		</script>
	{{end}}
{{end}}

{{/* Common page header, invoked with *uiHeader */}}
{{define "header"}}
	<header id="topbar">
		<table class="position_table">
			<tr>
				<td>
					<h1><a href="/">syzbot</a></h1>
				</td>
				<td class="search">
					{{if .LoginLink}}
						<a href="{{.LoginLink}}">sign-in</a> |
					{{end}}
					<a href="https://groups.google.com/forum/#!forum/syzkaller" target="_blank">mailing list</a> |
					<a href="https://github.com/google/syzkaller" target="_blank">source</a> |
					<a href="https://github.com/google/syzkaller/blob/master/docs/syzbot.md" target="_blank">docs</a>
				</td>
			</tr>
		</table>
	</header>
	<br>
{{end}}

{{/* List of bugs, invoked with *uiBugGroup */}}
{{define "bug_list"}}
{{if .}}
{{if .Bugs}}
<table class="list_table">
	<caption id="{{.Fragment}}">{{$.Caption}}:</caption>
	<tr>
		{{if $.ShowNamespace}}
			<th><a onclick="return sortTable(this, 'Kernel', textSort)" href="#">Kernel</a></th>
		{{end}}
		<th><a onclick="return sortTable(this, 'Title', textSort)" href="#">Title</a></th>
		<th><a onclick="return sortTable(this, 'Repro', reproSort)" href="#">Repro</a></th>
		<th><a onclick="return sortTable(this, 'Count', numSort)" href="#">Count</a></th>
		<th><a onclick="return sortTable(this, 'Last', timeSort)" href="#">Last</a></th>
		<th><a onclick="return sortTable(this, 'Reported', timeSort)" href="#">Reported</a></th>
		{{if $.ShowPatch}}
			<th><a onclick="return sortTable(this, 'Closed', timeSort)" href="#">Closed</a></th>
			<th><a onclick="return sortTable(this, 'Patch', textSort)" href="#">Patch</a></th>
		{{end}}
		{{if $.ShowPatched}}
			<th><a onclick="return sortTable(this, 'Patched', patchedSort)" href="#">Patched</a></th>
		{{end}}
		{{if $.ShowStatus}}
			<th><a onclick="return sortTable(this, 'Status', textSort)" href="#">Status</a></th>
		{{end}}
	</tr>
	{{range $b := .Bugs}}
		<tr>
			{{if $.ShowNamespace}}<td>{{$b.Namespace}}</td>{{end}}
			<td class="title"><a href="{{$b.Link}}">{{$b.Title}}</a></td>
			<td class="stat">{{formatReproLevel $b.ReproLevel}}</td>
			<td class="stat {{if $b.NumCrashesBad}}bad{{end}}">{{$b.NumCrashes}}</td>
			<td class="stat">{{formatLateness $.Now $b.LastTime}}</td>
			<td class="stat">
				{{if $b.ExternalLink}}
					<a href="{{$b.ExternalLink}}">{{formatLateness $.Now $b.ReportedTime}}</a>
				{{else}}
					{{formatLateness $.Now $b.ReportedTime}}
				{{end}}
			</td>
			{{if $.ShowPatch}}
				<td class="stat">{{formatLateness $.Now $b.ClosedTime}}</td>
				<td class="title" title="{{$b.Commits}}">{{$b.Commits}}</td>
			{{end}}
			{{if $.ShowPatched}}
				<td class="patched" title="{{$b.Commits}}">{{if $b.Commits}}{{len $b.PatchedOn}}/{{$b.NumManagers}}{{end}}</td>
			{{end}}
			{{if $.ShowStatus}}
				<td class="status">
					{{if $b.ExternalLink}}
						<a href="{{$b.ExternalLink}}">{{$b.Status}}</a>
					{{else}}
						{{$b.Status}}
					{{end}}
				</td>
			{{end}}
		</tr>
	{{end}}
</table>
{{end}}
{{end}}
{{end}}