<% @agents.each do |agent| %> <% end %>
Name Last Check Last Event Out Last Event In Events Schedule Working?
<%= agent.name %>
<%= agent.short_type.titleize %>
<% if agent.cannot_be_scheduled? %> N/A <% else %> <%= agent.last_check_at ? time_ago_in_words(agent.last_check_at) + " ago" : "never" %> <% end %> <%= agent.last_event_at ? time_ago_in_words(agent.last_event_at) + " ago" : "never" %> <% if agent.cannot_receive_events? %> N/A <% else %> <%= agent.last_receive_at ? time_ago_in_words(agent.last_receive_at) + " ago" : "never" %> <% end %> <%= link_to(agent.events_count || 0, events_path(:agent => agent.to_param)) %> <%= (agent.schedule || "n/a").to_s.humanize.titleize %> <%= working(agent) %>
<%= link_to 'Show', agent_path(agent), class: "btn btn-mini" %> <%= link_to 'Edit', edit_agent_path(agent), class: "btn btn-mini" %> <%= link_to 'Delete', agent_path(agent), method: :delete, data: {confirm: 'Are you sure?'}, class: "btn btn-mini" %> <% if agent.can_be_scheduled? %> <%= link_to 'Run', run_agent_path(agent), method: :post, class: "btn btn-mini" %> <% else %> <%= link_to 'Run', "#", class: "btn btn-mini disabled" %> <% end %>
<%= paginate @agents, :theme => 'twitter-bootstrap' %>
<%= link_to ' New Agent'.html_safe, new_agent_path, class: "btn" %> <%= link_to ' Run event propagation'.html_safe, propagate_agents_path, method: 'post', class: "btn" %> <%= link_to ' View diagram'.html_safe, diagram_agents_path, class: "btn" %>