| 1 |
<html lang="en"> |
| 2 |
<head> |
| 3 |
<meta charset="UTF-8"> |
| 4 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 5 |
<title>{{.Name}}</title> |
| 6 |
<style>{{.CSS}}</style> |
| 7 |
</head> |
| 8 |
<body> |
| 9 |
<header> |
| 10 |
<h1>{{.Name}}</h1> |
| 11 |
</header> |
| 12 |
<main> |
| 13 |
{{if .Description}}<h2>{{.Description}}</h2>{{end}} |
| 14 |
{{if .Version}}<div>Version: {{.Version}}</div>{{end}} |
| 15 |
<div> |
| 16 |
<ul> |
| 17 |
{{ range .Links }} |
| 18 |
<li><a href="{{if $.RoutePrefix}}{{ $.RoutePrefix }}{{end}}{{ .Address }}">{{.Text}}</a>{{if .Description}}: {{.Description}}{{end}}</li> |
| 19 |
{{ end }} |
| 20 |
</ul> |
| 21 |
</div> |
| 22 |
{{ if .Form.Action }} |
| 23 |
<div> |
| 24 |
<form action="{{if $.RoutePrefix}}{{ $.RoutePrefix }}{{end}}{{ .Form.Action }}"> |
| 25 |
{{ range .Form.Inputs }} |
| 26 |
<label>{{ .Label }}:</label> <input type="{{ .Type }}" name="{{ .Name }}" placeholder="{{ .Placeholder }}" value="{{ .Value }}"><br> |
| 27 |
{{ end }} |
| 28 |
<input type="submit" value="Submit"> |
| 29 |
</form> |
| 30 |
</div> |
| 31 |
{{ end }} |
| 32 |
{{ .ExtraHTML }} |
| 33 |
{{ if eq .Profiling "true" }} |
| 34 |
<div id="pprof"> |
| 35 |
Download a detailed report of resource usage (pprof format, from the Go runtime): |
| 36 |
<ul> |
| 37 |
<li><a href="{{if $.RoutePrefix}}{{ $.RoutePrefix }}{{end}}debug/pprof/heap">heap usage (memory)</a> |
| 38 |
<li><a href="{{if $.RoutePrefix}}{{ $.RoutePrefix }}{{end}}debug/pprof/profile?seconds=60">CPU usage (60 second profile)</a> |
| 39 |
</ul> |
| 40 |
To visualize and share profiles you can upload to <a href="https://pprof.me" target="_blank" rel="noopener noreferrer">pprof.me</a> |
| 41 |
</div> |
| 42 |
{{ end }} |
| 43 |
</main> |
| 44 |
</body> |
| 45 |
</html> |