aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates
diff options
context:
space:
mode:
Diffstat (limited to 'shardweb/lib/templates')
-rw-r--r--shardweb/lib/templates/page/shard_list.html.eex15
1 files changed, 14 insertions, 1 deletions
diff --git a/shardweb/lib/templates/page/shard_list.html.eex b/shardweb/lib/templates/page/shard_list.html.eex
index 3fffef7..79fd794 100644
--- a/shardweb/lib/templates/page/shard_list.html.eex
+++ b/shardweb/lib/templates/page/shard_list.html.eex
@@ -23,9 +23,10 @@
<tr>
<th></th>
<th>Shard</th>
+ <th></th>
<th>URI</th>
</tr>
- <%= for {_id, manifest, why_have_it} <- shard_list() do %>
+ <%= for {id, manifest, why_have_it} <- shard_list() do %>
<tr>
<td>
<%= case why_have_it do %>
@@ -37,6 +38,18 @@
<td>
<%= render "shard_entry.html", conn: @conn, manifest: manifest, pk: @pk %>
</td>
+ <td>
+ <%= case why_have_it do %>
+ <% {:cached, _} -> %>
+ <%= form_for @conn, page_path(@conn, :shard_action), [class: "form-inline", style: "display: inline", onsubmit: "return confirm('Delete this shard and all its data?');"], fn f -> %>
+ <%= hidden_input f, :shard_id, value: id |> Base.encode16 %>
+ <%= hidden_input f, :action, value: "delete" %>
+ <%= submit "Delete", [class: "btn btn-xs btn-danger"] %>
+ <% end %>
+ <% _ -> %>&nbsp;
+ <% end %>
+
+ </td>
<td><small class="shard_uri"><%= manifest |> ShardURI.from_manifest %></small></td>
</tr>
<% end %>