summaryrefslogtreecommitdiff
path: root/app/views/agents/index.html.erb
blob: f86f38215d3b3729be6f341d33430b867506d589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<div class="row">
  <div class="small-12 columns">
    <p id="notice"><%= notice %></p>

    <h1>Listing Agents</h1>
    <%= link_to 'New Agent', new_agent_path, class: 'button' %>

    <table>
      <thead>
        <tr>
          <th colspan="2"></th>
          <th>Hostname</th>
          <th>Events</th>
          <th>Files</th>
          <th>Registered At</th>
        </tr>
      </thead>
      <tbody>
        <% @agents.each do |agent| %>
          <tr>
            <td><%= link_to 'Edit', edit_agent_path(agent) %></td>
            <td><%= link_to 'Destroy', agent, method: :delete, data: { confirm: 'Are you sure?' } %></td>
            <td><%= link_to agent.hostname, agent_path(agent) %></td>
            <td><%= link_to agent.events.count, agent_events_path(agent) %></td>
            <td><%= link_to agent.files.count, agent_files_path(agent) %></td>
            <td><%= agent.created_at %></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>