fix(peers): fixing sort on results
This commit is contained in:
@@ -45,7 +45,8 @@
|
||||
<div class=row>
|
||||
<h2>Results</h2>
|
||||
{{ with $args := . }}
|
||||
{{range $req := .Requests}}
|
||||
{{ range $req := .Requests }}
|
||||
{{ if ne $req.RequestID "" }}
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<a href="/peers/req/{{ $req.RequestID }}">
|
||||
@@ -58,6 +59,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
|
||||
@@ -9,44 +9,42 @@
|
||||
{{range .Requests}}
|
||||
<h2>Results to {{.RequestIP}}{{if .Hidden}} 👁️{{end}}</h2>
|
||||
|
||||
{{with (orderByPeer .)}}
|
||||
{{range .}}
|
||||
<div class="panel panel-primary" id="peer-{{.Nick}}">
|
||||
<div class="panel-heading">
|
||||
<b> {{.Country}} :: {{.Name}} :: {{.Nick}} </b>
|
||||
<div style='float:right'>
|
||||
<a class='btn btn-success' href="#peer-{{.Nick}}">{{ if eq .Latency 0.0 }}—{{ else }}{{printf "%0.3f ms" .Latency}}{{ end }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<b>Note:</b> {{.Note}}<br/>
|
||||
<b>VPN Types:</b> {{range .VPNTypes}} {{.}} {{end}}<br/>
|
||||
<b>IRC:</b> {{.Nick}}
|
||||
<h4>Other Results</h4>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Peer Name</th>
|
||||
<th>Country</th>
|
||||
<th>Latency</th>
|
||||
<th>Jitter</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Results}}
|
||||
<tr>
|
||||
<th>{{.Name}}</th>
|
||||
<td>{{.Country}}</td>
|
||||
<td>{{ if eq .Latency 0.0 }}—{{ else }}{{printf "%0.3f ms" .Latency}}{{ end }}</td>
|
||||
<td>{{ if eq .Jitter 0.0 }}—{{ else }}{{ printf "%0.3f ms" .Jitter }}{{ end }}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{range orderByPeer .}}
|
||||
<div class="panel panel-primary" id="peer-{{.Nick}}">
|
||||
<div class="panel-heading">
|
||||
<b> {{.Country}} :: {{.Name}} :: {{.Nick}} </b>
|
||||
<div style='float:right'>
|
||||
<a class='btn btn-success' href="#peer-{{.Nick}}">{{ if eq .Latency 0.0 }}—{{ else }}{{printf "%0.3f ms" .Latency}}{{ end }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="panel-body">
|
||||
<b>Note:</b> {{.Note}}<br/>
|
||||
<b>VPN Types:</b> {{range .VPNTypes}} {{.}} {{end}}<br/>
|
||||
<b>IRC:</b> {{.Nick}}
|
||||
<h4>Other Results</h4>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Peer Name</th>
|
||||
<th>Country</th>
|
||||
<th>Latency</th>
|
||||
<th>Jitter</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Results}}
|
||||
<tr>
|
||||
<th>{{.Name}}</th>
|
||||
<td>{{.Country}}</td>
|
||||
<td>{{ if eq .Latency 0.0 }}—{{ else }}{{printf "%0.3f ms" .Latency}}{{ end }}</td>
|
||||
<td>{{ if eq .Jitter 0.0 }}—{{ else }}{{ printf "%0.3f ms" .Jitter }}{{ end }}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user