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
|
<h4>Peer list</h4>
<table class="table table-striped">
<tr>
<th>Peer ID</th>
<th>Address</th>
<th>Port</th>
</tr>
<%= for {{:tcp4, ip, port}, pid, auth} <- conn_list() do %>
<tr>
<td>
<%= case auth do %>
<% nil -> %>(anonymous)
<% %SNet.Auth{his_pk: his_pk} -> %> <%= his_pk %>
<% end %>
</td>
<td><%= :inet_parse.ntoa(ip) %></td>
<td><%= port %></td>
</tr>
<% end %>
</table>
<%= form_for @conn, page_path(@conn, :add_peer), [class: "form-inline"], fn f -> %>
<%= text_input f, :ip, [class: "form-control", placeholder: "Hostname / IP address"] %>
<%= text_input f, :port, [class: "form-control", placeholder: "Port", value: "4044"] %>
<%= submit "Add peer", [class: "btn btn-default"] %>
<% end %>
|