mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Abstracts database storage & Status page UI (#88)
This commit is contained in:
parent
7bb80c0c2e
commit
b7c0990dcb
14 changed files with 456 additions and 256 deletions
57
templates/status.html
Normal file
57
templates/status.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
{{define "title"}}
|
||||
Connected Peers
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
{{end}}
|
||||
|
||||
{{define "username"}}
|
||||
{{ .username }}
|
||||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Connected Peers
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
{{ if .error }}
|
||||
<div class="alert alert-warning" role="alert">{{.error}}</div>
|
||||
{{ end}}
|
||||
{{ range $dev := .devices }}
|
||||
<table class="table table-sm">
|
||||
<caption>List of connected peers for device with name {{ $dev.Name }} </caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Email</th>
|
||||
<th scope="col">Public Key</th>
|
||||
<th scope="col">ReceiveBytes</th>
|
||||
<th scope="col">TransmitBytes</th>
|
||||
<th scope="col">Connected (Approximation)</th>
|
||||
<th scope="col">LastHandshakeTime</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $idx, $peer := $dev.Peers }}
|
||||
<tr {{ if $peer.Connected }} class="table-success" {{ end }}>
|
||||
<th scope="row">{{ $idx }}</th>
|
||||
<td>{{ $peer.Name }}</td>
|
||||
<td>{{ $peer.Email }}</td>
|
||||
<td>{{ $peer.PublicKey }}</td>
|
||||
<td>{{ $peer.ReceivedBytes }}</td>
|
||||
<td>{{ $peer.TransmitBytes }}</td>
|
||||
<td>{{ $peer.Connected }}</td>
|
||||
<td>{{ $peer.LastHandshakeTime }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ end }}
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
Loading…
Add table
Add a link
Reference in a new issue