|
@@ -20,10 +20,12 @@
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
- <% if agent.disabled? %>
|
|
|
- <%= link_to '<i class="glyphicon glyphicon-play"></i> Enable agent'.html_safe, agent_path(agent, :agent => { :disabled => false }, :return => returnTo), :method => :put %>
|
|
|
- <% else %>
|
|
|
- <%= link_to '<i class="glyphicon glyphicon-pause"></i> Disable agent'.html_safe, agent_path(agent, :agent => { :disabled => true }, :return => returnTo), :method => :put %>
|
|
|
+ <%= link_to '#', 'data-toggle' => 'modal', 'data-target' => "#confirm-agent#{agent.id}" do %>
|
|
|
+ <% if agent.disabled? %>
|
|
|
+ <i class="glyphicon glyphicon-play"></i> Enable agent
|
|
|
+ <% else %>
|
|
|
+ <i class="glyphicon glyphicon-pause"></i> Disable agent
|
|
|
+ <% end %>
|
|
|
<% end %>
|
|
|
</li>
|
|
|
|
|
@@ -49,3 +51,32 @@
|
|
|
<%= 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" %>
|
|
|
</li>
|
|
|
</ul>
|
|
|
+
|
|
|
+<div id="confirm-agent<%= agent.id %>" class="confirm-agent modal fade" tabindex="-1" role="dialog" aria-labelledby="confirmAgentLabel" aria-hidden="true">
|
|
|
+ <div class="modal-dialog modal-sm">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
|
|
+ <h4 class="modal-title">Confirm</h4>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <p><% if agent.disabled? %>Enable<% else %>Disable<% end %> "<%= agent.name %>"?</p>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <%= form_for(agent, as: :agent, url: agent_path(agent, return: returnTo), method: 'PUT') do |f| %>
|
|
|
+ <% if agent.disabled && agent.can_receive_events? %>
|
|
|
+ <div class="form-group">
|
|
|
+ <%= f.check_box :drop_pending_events %>
|
|
|
+ <%= f.label :drop_pending_events, 'Drop pending events' %>
|
|
|
+ <span class="glyphicon glyphicon-question-sign hover-help" data-content="As soon as you enable this agent, it starts to receive pending events that have not been processed while it was disabled. To prevent that from happening, you can check this option."></span>
|
|
|
+ </div>
|
|
|
+ <% end %>
|
|
|
+ <%= f.hidden_field :disabled, value: (!agent.disabled).to_s %>
|
|
|
+ <%= f.button 'No', class: 'btn btn-default', 'data-dismiss' => 'modal' %>
|
|
|
+ <%= f.submit 'Yes', class: 'btn btn-primary' %>
|
|
|
+ <% end %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|