aboutsummaryrefslogblamecommitdiff
path: root/shardweb/lib/templates/page/shard_list.html.eex
blob: 27f70b49334f3ecc6766ac2d2536969a481c286c (plain) (tree)
























                                                          
                  
       
                                                     



                                                                            
                                             



                                                                            
                                                                                  
                                                           
                         

                
                                                                                               

                                                                                                          
                                                                                                                   

                



                                                        
                                    



           
<!-- Page Heading -->
<div class="row">
  <div class="col-lg-12">
    <h1 class="page-header">
      Shard list

    </h1>
    <ol class="breadcrumb">
      <li>
        <i class="fa fa-dashboard"></i> Dashboard
      </li>
      <li class="active">
        <i class="fa fa-table"></i> Shard list
      </li>
    </ol>
  </div>
</div>
<!-- /.row -->

<%= render ShardWeb.LayoutView, "flashes.html", assigns %>

<table class="table table-striped">
  <tr>
    <th>Shard</th>
    <th>Id</th>
    <th>State</th>
  </tr>
  <%= for {id, manifest, state} <- shard_list() do %>
    <tr>
      <td>
        <%= case manifest do %>
          <% %SApp.Identity.Manifest{pk: pk} -> %><i class="fa fa-user"></i>
            <%= SApp.Identity.get_nick(pk) %>
            <a href="<%= identity_path(@conn, :view, pk|>Base.encode16) %>">
              <small><%= Shard.Keys.pk_display pk %></small>
            </a>

          <% %SApp.Chat.Manifest{channel: chan} -> %><i class="fa fa-hashtag"></i>
            <a href="<%= chat_path(@conn, :chat, chan) %>">
              <%= chan %>
            </a>

          <% %SApp.Chat.PrivChat.Manifest{pk_list: pk_list} -> %><i class="fa fa-comments"></i>
            <a href="<%= chat_path(@conn, :privchat,
                (pk_list |> Enum.filter(&(&1!=@pk)) |> Enum.map(&Base.encode16/1) |> Enum.join(","))) %>">
                <%= pk_list |> Enum.filter(&(&1!=@pk)) |> Enum.map(&SApp.Identity.get_nick/1) |> Enum.join(", ") %>
            </a>

          <% x -> %> <%= inspect x %>
        <% end %>
      </td>
      <td><small><%= id |> Base.encode16 %></small></td>
      <td><%= inspect(state) %></td>
    </tr>
  <% end %>
</table>