aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/shard_web/templates/page/index.html.eex
diff options
context:
space:
mode:
Diffstat (limited to 'shardweb/lib/shard_web/templates/page/index.html.eex')
-rw-r--r--shardweb/lib/shard_web/templates/page/index.html.eex29
1 files changed, 29 insertions, 0 deletions
diff --git a/shardweb/lib/shard_web/templates/page/index.html.eex b/shardweb/lib/shard_web/templates/page/index.html.eex
new file mode 100644
index 0000000..412cbe5
--- /dev/null
+++ b/shardweb/lib/shard_web/templates/page/index.html.eex
@@ -0,0 +1,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, peer_path(@conn, :add), [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 %>
+