1
0

_action_menu.html.erb 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <ul class="dropdown-menu" role="menu">
  2. <% if agent.can_be_scheduled? %>
  3. <li>
  4. <%= link_to '<span class="color-success glyphicon glyphicon-refresh"></span> Run'.html_safe, run_agent_path(agent, :return => returnTo), method: :post, :tabindex => "-1" %>
  5. </li>
  6. <% end %>
  7. <li>
  8. <%= link_to '<span class="glyphicon glyphicon-eye-open"></span> Show'.html_safe, agent_path(agent) %>
  9. </li>
  10. <li class="divider"></li>
  11. <li>
  12. <%= link_to '<span class="glyphicon glyphicon-pencil"></span> Edit agent'.html_safe, edit_agent_path(agent) %>
  13. </li>
  14. <li>
  15. <%= link_to '<span class="glyphicon glyphicon-plus"></span> Clone agent'.html_safe, new_agent_path(id: agent), :tabindex => "-1" %>
  16. </li>
  17. <li>
  18. <% if agent.disabled? %>
  19. <%= link_to '<i class="glyphicon glyphicon-play"></i> Enable agent'.html_safe, agent_path(agent, :agent => { :disabled => false }, :return => returnTo), :method => :put %>
  20. <% else %>
  21. <%= link_to '<i class="glyphicon glyphicon-pause"></i> Disable agent'.html_safe, agent_path(agent, :agent => { :disabled => true }, :return => returnTo), :method => :put %>
  22. <% end %>
  23. </li>
  24. <% if agent.scenarios.length > 0 %>
  25. <li class="divider"></li>
  26. <% agent.scenarios.each do |scenario| %>
  27. <li>
  28. <%= link_to "<span class='color-warning glyphicon glyphicon-remove-circle'></span> Remove from <span class='scenario label label-info'>#{h scenario.name}</span>".html_safe, leave_scenario_agent_path(agent, :scenario_id => scenario.to_param, :return => returnTo), method: :put, :tabindex => "-1" %>
  29. </li>
  30. <% end %>
  31. <% end %>
  32. <li class="divider"></li>
  33. <% if agent.can_create_events? && agent.events.count > 0 %>
  34. <li>
  35. <%= link_to '<span class="color-danger glyphicon glyphicon-trash"></span> Delete all events'.html_safe, remove_events_agent_path(agent, :return => returnTo), method: :delete, data: {confirm: 'Are you sure you want to delete ALL emitted events for this Agent?'}, :tabindex => "-1" %>
  36. </li>
  37. <% end %>
  38. <li>
  39. <%= link_to '<span class="color-danger glyphicon glyphicon-remove"></span> Delete agent'.html_safe, agent_path(agent, :return => returnTo), method: :delete, data: { confirm: 'Are you sure that you want to permanently delete this Agent?' }, :tabindex => "-1" %>
  40. </li>
  41. </ul>