Sha256: cdf9872383aef386a146d8a7380edd173ea2dc338961c0beb3c82fbcccadef0c

Contents?: true

Size: 1.73 KB

Versions: 2

Compression:

Stored size: 1.73 KB

Contents

<table class="min-w-full divide-y divide-gray-300">
  <thead class="bg-gray-50">
    <tr>
      <th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Name</th>
      <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">SQL</th>
      <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Duration</th>
      <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Date</th>
      <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
        <span class="sr-only">Edit</span>
      </th>
    </tr>
  </thead>
  <tbody class="divide-y divide-gray-200 bg-white">
    <% if @queries.empty? %>
      <tr>
        <td colspan="5">
          <p class="p-5 text-center">No queries registered</p>
        </td>
      </tr>
    <% end %>
    
    <% @queries.each do |query| %>
    <tr>
      <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-800">
        <%= query.content.name %>
      </td>
      <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
        <%= query.content.sql[0..80] %>
        <%= "..." if query.content.sql.size > 80 %>
      </td>
      <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
        <%= render RailsLiveDashboard::QueryDurationBadgeComponent.new(query.content.duration) %>
      </td>
      <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
        <%= query.created_at.strftime("%Y-%m-%d %H:%M:%S") %>
      </td>
      <td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
        <%= link_to 'Show', query_path(query), class: 'text-indigo-600 hover:text-indigo-900' %>
      </td>
    </tr>
    <% end %>
  </tbody>
</table>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_live_dashboard-0.1.1 app/views/rails_live_dashboard/queries/_list.html.erb
rails_live_dashboard-0.1.0 app/views/rails_live_dashboard/queries/_list.html.erb