|
@@ -21,9 +21,13 @@
|
|
|
|
|
|
<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 %>
|
|
|
+ <%= link_to '#', 'data-toggle' => 'modal', 'data-target' => "#confirm-enable-agent#{agent.id}" do %>
|
|
|
+ <i class="glyphicon glyphicon-play"></i> Enable agent
|
|
|
+ <% end %>
|
|
|
<% 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-disable-agent#{agent.id}" do %>
|
|
|
+ <i class="glyphicon glyphicon-pause"></i> Disable agent
|
|
|
+ <% end %>
|
|
|
<% end %>
|
|
|
</li>
|
|
|
|
|
@@ -49,3 +53,53 @@
|
|
|
<%= 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>
|
|
|
+
|
|
|
+<% if agent.disabled? %>
|
|
|
+<div id="confirm-enable-agent<%= agent.id %>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="confirmEnableAgentLabel" 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>Enable "<%= 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.can_receive_events? || true %>
|
|
|
+ <div class="form-group">
|
|
|
+ <%= check_box_tag check_box_id = "agent#{agent.id}_drop_pending_events", 'true', false, name: :drop_pending_events %>
|
|
|
+ <%= label_tag check_box_id, 'Drop pending events' %>
|
|
|
+ </div>
|
|
|
+ <% end %>
|
|
|
+ <%= f.hidden_field :disabled, value: 'false' %>
|
|
|
+ <%= f.button 'No', class: 'btn btn-default', 'data-dismiss' => 'modal' %>
|
|
|
+ <%= f.submit 'Yes', class: 'btn btn-primary' %>
|
|
|
+ <% end %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<% else %>
|
|
|
+<div id="confirm-disable-agent<%= agent.id %>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="confirmDisableAgentLabel" 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>Disable "<%= agent.name %>"?</p>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <%= form_for(agent, as: :agent, url: agent_path(agent, return: returnTo), method: 'PUT') do |f| %>
|
|
|
+ <%= f.hidden_field :disabled, value: 'true' %>
|
|
|
+ <%= f.button 'No', class: 'btn btn-default', 'data-dismiss' => 'modal' %>
|
|
|
+ <%= f.submit 'Yes', class: 'btn btn-primary' %>
|
|
|
+ <% end %>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<% end %>
|