blob: e686b01fc882cf404245d5ef8c186ae26ccaf1e7 (
plain) (
blame)
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
|
@use super::{header_html, footer_html};
@use crate::models::{DbUser, Peer, Network};
@(user: Option<DbUser>, peers: Vec<Peer>, nets: Vec<Network>)
@:header_html()
<h1>NCCd (Network Communications Control Daemon)</h1>
@if user.is_some() {
<h3>Welcome @user.clone().unwrap().pref_name</h3>
<table>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
<tr>
<td>ID</td>
<td>@user.clone().unwrap().id</td>
</tr>
<tr>
<td>Email</td>
<td>@user.clone().unwrap().email</td>
</tr>
<tr>
<td>Preferred Name</td>
<td>@user.clone().unwrap().pref_name</td>
</tr>
<tr>
<td>Last Login</td>
<td>@(user.clone().unwrap().last_login)Z</td>
</tr>
</table>
<hr>
<h3>Configured Peers</h3>
<table>
<tr>
<th>ID</th>
<th>Address</th>
<th>Public Key</th>
</tr>
@for p in peers {
<tr>
<td>@p.id</td>
<td>@p.addr</td>
<td>@p.public_key</td>
</tr>
}
</table>
<hr>
<h3>Configured subnets (<a href="/dash/nets/new">New</a>)</h3>
<table>
<tr>
<th>ID</th>
<th>Subnet CIDR</th>
<th>Description</th>
</tr>
@for n in nets {
<tr>
<td>@n.id</td>
<td>@n.subnet</td>
<td>@if n.description.is_some() { @n.description.unwrap()
} else { None }</td>
</tr>
}
</table>
} else {
<h3>Please <a href="/dash/auth/login">Log in</a></h3>
}
@:footer_html()
|