Execute PLAN_FRONTEND.md
This commit is contained in:
70
cmd/frontend/templates/index.html
Normal file
70
cmd/frontend/templates/index.html
Normal file
@@ -0,0 +1,70 @@
|
||||
{{define "content"}}
|
||||
<h1>nginx-logtail</h1>
|
||||
|
||||
<div class="tabs">
|
||||
{{- range .Windows}}
|
||||
<a href="{{.URL}}"{{if .Active}} class="active"{{end}}>{{.Label}}</a>
|
||||
{{- end}}
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
{{- range .GroupBys}}
|
||||
<a href="{{.URL}}"{{if .Active}} class="active"{{end}}>{{.Label}}</a>
|
||||
{{- end}}
|
||||
</div>
|
||||
|
||||
{{if .Breadcrumbs}}
|
||||
<div class="crumbs">
|
||||
<span class="label">Filters:</span>
|
||||
{{- range .Breadcrumbs}}
|
||||
<span>{{.Text}}<a href="{{.RemoveURL}}" title="remove filter">×</a></span>
|
||||
{{- end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Error}}
|
||||
<div class="error">{{.Error}}</div>
|
||||
{{else}}
|
||||
|
||||
{{if .Sparkline}}
|
||||
<div class="sparkline">
|
||||
<small>{{.Params.WindowS}} trend · by {{.Params.GroupByS}}{{if .Source}} · source: {{.Source}}{{end}}</small>
|
||||
{{.Sparkline}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Entries}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="rank">#</th>
|
||||
<th>LABEL</th>
|
||||
<th class="num">COUNT</th>
|
||||
<th class="num">%</th>
|
||||
<th>BAR</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{- range .Entries}}
|
||||
<tr>
|
||||
<td class="rank">{{.Rank}}</td>
|
||||
<td><a href="{{.DrillURL}}">{{.Label}}</a></td>
|
||||
<td class="num">{{fmtCount .Count}}</td>
|
||||
<td class="num">{{printf "%.0f" .Pct}}%</td>
|
||||
<td class="bar"><meter value="{{printf "%.0f" .Pct}}" max="100"></meter></td>
|
||||
</tr>
|
||||
{{- end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<p class="nodata">(no data yet — ring buffer may still be filling)</p>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
<footer>
|
||||
{{- if .Source}}source: {{.Source}} · {{end -}}
|
||||
{{fmtCount .TotalCount}} requests · {{.Params.WindowS}} window · by {{.Params.GroupByS}}
|
||||
{{- if gt .RefreshSecs 0}} · auto-refresh {{.RefreshSecs}}s{{end}}
|
||||
</footer>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user