summaryrefslogtreecommitdiff
path: root/app/views/agents/index.html.erb
blob: 65ce07ef8256cb172c2a809a11bef661da063152 (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
<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>Hostname</th>
          <th>Created At</th>
          <th colspan="3"></th>
        </tr>
      </thead>
      <tbody>
        <% @agents.each do |agent| %>
          <tr>
            <td><%= link_to agent.hostname, agent_path(agent) %></td>
            <td><%= agent.created_at %></td>
            <td><%= link_to "Events (#{agent.events.count})", agent_events_path(agent) %></td>
            <td><%= link_to 'Edit', edit_agent_path(agent) %></td>
            <td><%= link_to 'Destroy', agent, method: :delete, data: { confirm: 'Are you sure?' } %></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>