<h2>API Request Log</h2>

<p>Here you can see the latests API requests from: <%= link_to @cinstance.name, admin_application_path(@cinstance) %></p>

<div id="log-requests-container">
  <% if @log_requests.empty? %>
    <%= render :partial => 'no_log_requests' %>
  <% else %>

    <div class="operations"><%= fancy_button_to 'Purge', admin_application_purge_logs_path, :method => :delete, :class => 'delete', :remote => true %></div>

      <% @log_requests.each do |log| %>
        
        <div class="log-requests-transaction <%= cycle('odd','even', name: 'application-log-requests') %>" >
          <table class="log-request-transaction-table">
            <tbody>
              <tr><td><b>Time: </b></td><td><%= log[:timestamp] %></td></tr>
              <tr><td><b>Code: </b></td><td><%= log[:code] %></td></tr>
              <tr><td><b>Request: </b></td><td><%= log[:request] %></td></tr>
              <tr><td><b>Response: </b></td><td><%= log[:response] %></td></tr>
            </tbody>
           </table>
        </div>

        <% end %>
         
  <% end %>
</div>
