index.html.erb 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. <% colors = {failing: "red", passing: "#5cb85c", error: "#666"} %>
  5. <table class="table">
  6. <thead>
  7. <tr>
  8. <th>Query</th>
  9. <th style="width: 10%;">State</th>
  10. <th style="width: 10%;">Run</th>
  11. <th style="width: 20%;">Emails</th>
  12. <th style="width: 15%;"></th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. <% @checks.each do |check| %>
  17. <tr>
  18. <td><%= link_to check.query.name, check.query %></td>
  19. <td>
  20. <% if check.state %>
  21. <small style="font-weight: bold; color: <%= colors[check.state.to_sym] %>;"><%= check.state.upcase %></small>
  22. <% end %>
  23. </td>
  24. <td><%= check.schedule if check.respond_to?(:schedule) %></td>
  25. <td>
  26. <ul class="list-unstyled" style="margin-bottom: 0;">
  27. <% check.split_emails.each do |email| %>
  28. <li><%= email %></li>
  29. <% end %>
  30. </ul>
  31. </td>
  32. <td style="text-align: right; padding: 1px;">
  33. <%= link_to "Edit", edit_check_path(check), class: "btn btn-info" %>
  34. <%= link_to "Run Now", run_check_path(check), class: "btn btn-primary" %>
  35. </td>
  36. </tr>
  37. <% end %>
  38. </tbody>
  39. </table>