-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.html
103 lines (95 loc) · 3.74 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<style>
.card {
margin-top: 10px;
}
body {
padding-top: 3rem;
}
.navbar {
background-color: #AE373A;
}
</style>
<title>Wireguard</title>
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-dark fixed-top">
<a class="navbar-brand" href="#">WireGuard</a>
</nav>
</header>
<main class="container">
<div class="row row-cols-1 row-cols-lg-3 row-cols-md-2">
<div class="col">
<div class="card border-primary">
<div class="card-header">
<a href="#" data-toggle="tooltip" title="{{.PublicKey}}">{{.Displayname}}</a>
<br>
(:{{.ListenPort}})
</div>
<div class="card-body">
<h6 class="card-subtitle">{{.Hostname}}</h6>
<ul class="list-group list-group-flush">
{{range $idx, $ip := .IPs }}
<li class="list-group-item">
IP:
<span class="text-success">
{{$ip}}
</span>
<span class="text-muted"> (on)</span>
</li>
{{end}}
</ul>
</div>
<div class="card-footer text-muted">
{{.CheckTime.Format "2006-01-02 15:04:05 MST"}}
<br>
(Tx: {{printf "%.1f" .TransferTx}} MiB | Rx: {{printf "%.1f" .TransferRx}} MiB)
</div>
</div>
</div>
{{range $pidx, $peer := .Peers}}
<div class="col">
<div class="card border-secondary">
<div class="card-header">
<a href="#" data-toggle="tooltip" title="{{.PublicKey}}">{{.Displayname}}</a>
<br>
({{.EndPoint}})
</div>
<div class="card-body">
<h6 class="card-subtitle">{{.Hostname}}</h6>
<ul class="list-group list-group-flush">
{{range $idx, $ip := .AllowedIPs }}
<li class="list-group-item">
IP:
<span class="{{if index $peer.Online $idx}}text-success{{else}}text-danger{{end}}">
{{$ip}}
</span>
{{with $dur := index $peer.Duration $idx}}
<span class="text-muted"> ({{$dur}})</span>
{{end}}
</li>
{{end}}
</ul>
</div>
<div class="card-footer text-muted">
{{.LatestHandshake.Format "2006-01-02 15:04:05 MST"}}
<br>
(Tx: {{printf "%.1f" .TransferTx}} MiB | Rx: {{printf "%.1f" .TransferRx}} MiB)
</div>
</div>
</div>
{{end}}
</div>
</main>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</body>
</html>