aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/shard_web/templates/page/index.html.eex
blob: 2efa030f9c97ecead7de6772161f67bb38ed1840 (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
<h4>Peer list</h4>

<table class="table table-striped">
  <tr>
    <th>Peer ID</th>
    <th>Address</th>
    <th>Port</th>
  </tr>
  <%= for {id, pid, ip, port} <- peer_list() do %>
    <tr>
      <td>
        <%= if pid == nil do %>
          <%= peer_id_to_str(id) %>
        <% else %>
          <strong><%= peer_id_to_str(id) %></strong>
        <% 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 %>