index.html.erb 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <% blazer_title "Checks" %>
  2. <p style="float: right;"><%= link_to "New Check", new_check_path, class: "btn btn-info" %></p>
  3. <%= render partial: "blazer/nav" %>
  4. <table class="table">
  5. <thead>
  6. <tr>
  7. <th>Query</th>
  8. <th style="width: 10%;">State</th>
  9. <th style="width: 10%;">Run</th>
  10. <th style="width: 20%;">Emails</th>
  11. <th style="width: 15%;"></th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. <% @checks.each do |check| %>
  16. <tr>
  17. <td><%= link_to check.query.name, check.query %> <span class="text-muted"><%= check.try(:check_type).to_s.gsub("_", " ") %></span></td>
  18. <td>
  19. <% if check.state %>
  20. <small class="check-state <%= check.state.parameterize("_") %>"><%= check.state.upcase %></small>
  21. <% end %>
  22. </td>
  23. <td><%= check.schedule if check.respond_to?(:schedule) %></td>
  24. <td>
  25. <ul class="list-unstyled" style="margin-bottom: 0; word-break: break-all;">
  26. <% check.split_emails.each do |email| %>
  27. <li><%= email %></li>
  28. <% end %>
  29. </ul>
  30. </td>
  31. <td style="text-align: right; padding: 1px;">
  32. <%= link_to "Edit", edit_check_path(check), class: "btn btn-info" %>
  33. <%= link_to "Run Now", query_path(check.query), class: "btn btn-primary" %>
  34. </td>
  35. </tr>
  36. <% end %>
  37. </tbody>
  38. </table>