aboutsummaryrefslogblamecommitdiff
path: root/shardweb/lib/shard_web/templates/page/index.html.eex
blob: efa651b00648edb2ebc33ea7682f9468e3033745 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                   
                                                             

          


                                                           







                                          
                                                                                   




                                                                                         
<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 %>