diff options
author | Alex Auvolat <alex@adnab.me> | 2018-09-01 16:07:22 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-09-01 16:07:22 +0200 |
commit | 81b5a844a2a155e28c497a8ce671eb5f02803e5d (patch) | |
tree | 15e878ebe47d5993e7af46a48a1ccdc1dd1e4b2f /shardweb/lib/shard_web/templates/page/index.html.eex | |
parent | c6ec33d6e612168e14d77007915a4ea423c55a2e (diff) | |
download | shard-81b5a844a2a155e28c497a8ce671eb5f02803e5d.tar.gz shard-81b5a844a2a155e28c497a8ce671eb5f02803e5d.zip |
Import shardweb0.0.2
Diffstat (limited to 'shardweb/lib/shard_web/templates/page/index.html.eex')
-rw-r--r-- | shardweb/lib/shard_web/templates/page/index.html.eex | 29 |
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 %> + |