chore: add apps from go.sour.is/ev
This commit is contained in:
65
app/peerfinder/pages/home.go.tpl
Normal file
65
app/peerfinder/pages/home.go.tpl
Normal file
@@ -0,0 +1,65 @@
|
||||
{{template "main" .}}
|
||||
|
||||
{{define "meta"}}
|
||||
<meta http-equiv="refresh" content="30">
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<h2>What is this?</h2>
|
||||
|
||||
<p>This tool allows you to find "good" peerings
|
||||
for <a href="https://dn42.net">dn42</a>, by measuring the latency from
|
||||
various points in the network towards you.</p>
|
||||
|
||||
<p>If you don't know what dn42 is,
|
||||
read <a href="https://dn42.net/Home">the website</a> and in particular
|
||||
the <a href="https://dn42.net/Getting-started-with-dn42">Getting Started
|
||||
guide</a>.</p>
|
||||
|
||||
<h2>How does it work?</h2>
|
||||
|
||||
<p>
|
||||
<ol>
|
||||
<li>You enter your (Internet) IP address</li>
|
||||
<li>Various routers participating in dn42 will ping you over the Internet</li>
|
||||
<li>After a short while, you get back all the latency results</li>
|
||||
<li>You can then peer with people close to you (low latency)</li>
|
||||
</ol>
|
||||
</p>
|
||||
|
||||
<form class="form-inline" method="POST" action="/peers/req">
|
||||
<label>Ping IP Address [Check Hidden?]:</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" type="text" name="req_ip" placeholder="{{ .RemoteIP }}">
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox" name="req_hidden" value=1 aria-label="Hidden?">
|
||||
</span>
|
||||
</div>
|
||||
<button class="btn btn-default" type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<p>If you mark your measurement as hidden, it will not be displayed on the
|
||||
page below. Note that the IP addresses of the target will be shown alongside the result.</p>
|
||||
|
||||
|
||||
<div class=row>
|
||||
<h2>Results</h2>
|
||||
{{ with $args := . }}
|
||||
{{ range $req := .Requests }}
|
||||
{{ if ne $req.RequestID "" }}
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<a href="/peers/req/{{ $req.RequestID }}">
|
||||
{{ $req.RequestIP }} on {{ $req.Created.Format "02 Jan 06 15:04 MST" }}
|
||||
</a> — <b>Request ID:</b> {{ $req.RequestID }}
|
||||
<div style='float:right'>
|
||||
<a href="/peers/req/{{ $req.RequestID }}" class='btn btn-success'>{{ countResponses $req }} / {{ $args.CountPeers }} </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
50
app/peerfinder/pages/req.go.tpl
Normal file
50
app/peerfinder/pages/req.go.tpl
Normal file
@@ -0,0 +1,50 @@
|
||||
{{template "main" .}}
|
||||
|
||||
{{define "meta"}}
|
||||
<meta http-equiv="refresh" content="30">
|
||||
{{end}}
|
||||
|
||||
|
||||
{{define "content"}}
|
||||
{{range .Requests}}
|
||||
<h2>Results to {{.RequestIP}}{{if .Hidden}} 👁️{{end}}</h2>
|
||||
|
||||
{{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>
|
||||
<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