Update import show page

This commit is contained in:
Eugene Burmakin 2024-03-24 19:53:19 +01:00
parent bd0f5bb624
commit 64e5028514
3 changed files with 27 additions and 68 deletions

View file

@ -1,8 +1,28 @@
<div id="<%= dom_id import %>">
<p class="my-5">
<strong class="block font-medium mb-1">Name:</strong>
<%= import.name %>
</p>
<table class="table">
<!-- head -->
<thead>
<tr>
<th>Name</th>
<th>Processed</th>
<th>Doubles</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<%= link_to import.name, import, class: 'underline hover:no-underline' %> (<%= import.source %>)
</td>
<td>
<%= "✅" if import.processed == import.raw_points %>
<%= "#{import.processed}/#{import.raw_points}" %>
</td>
<td><%= import.doubles %></td>
<td><%= import.created_at.strftime("%d.%m.%Y, %H:%M") %></td>
</tr>
</tbody>
</table>
<% if action_name != "show" %>
<%= link_to "Show this import", import, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>

View file

@ -6,10 +6,10 @@
<%= render @import %>
<%= link_to "Edit this import", edit_import_path(@import), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to "Edit this import", edit_import_path(@import), class: "mt-2 rounded-lg py-3 px-5 bg-secondary-content inline-block font-medium" %>
<div class="inline-block ml-2">
<%= link_to "Destroy this import", import_path(@import), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure? This action will delete all points imported with this file", turbo_method: :delete }, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
<%= link_to "Destroy this import", import_path(@import), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure? This action will delete all points imported with this file", turbo_method: :delete }, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-secondary-content font-medium" %>
</div>
<%= link_to "Back to imports", imports_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to "Back to imports", imports_path, class: "ml-2 rounded-lg py-3 px-5 bg-secondary-content inline-block font-medium" %>
</div>
</div>

View file

@ -1,61 +0,0 @@
<h1 class="text-2xl font-bold mb-4">Points Table</h1>
<table class="min-w-full bg-white border border-gray-300">
<thead>
<tr>
<th class="py-2 px-4 border-b">ID</th>
<th class="py-2 px-4 border-b">Battery Status</th>
<th class="py-2 px-4 border-b">Ping</th>
<th class="py-2 px-4 border-b">Battery</th>
<th class="py-2 px-4 border-b">Tracked ID</th>
<th class="py-2 px-4 border-b">Topic</th>
<th class="py-2 px-4 border-b">Altitude</th>
<th class="py-2 px-4 border-b">Velocity</th>
<th class="py-2 px-4 border-b">Trigger</th>
<th class="py-2 px-4 border-b">BSSID</th>
<th class="py-2 px-4 border-b">SSID</th>
<th class="py-2 px-4 border-b">Connection</th>
<th class="py-2 px-4 border-b">Vertical Accuracy</th>
<th class="py-2 px-4 border-b">Accuracy</th>
<th class="py-2 px-4 border-b">Timestamp</th>
<th class="py-2 px-4 border-b">Mode</th>
<th class="py-2 px-4 border-b">Latitude</th>
<th class="py-2 px-4 border-b">Longitude</th>
<th class="py-2 px-4 border-b">Inrids</th>
<th class="py-2 px-4 border-b">In Regions</th>
<th class="py-2 px-4 border-b">Raw Data</th>
<th class="py-2 px-4 border-b">Tracker ID</th>
<th class="py-2 px-4 border-b">Created At</th>
<th class="py-2 px-4 border-b">Updated At</th>
</tr>
</thead>
<tbody>
<% @points.each do |point| %>
<tr>
<td class="py-2 px-4 border-b"><%= point.id %></td>
<td class="py-2 px-4 border-b"><%= point.battery_status %></td>
<td class="py-2 px-4 border-b"><%= point.ping %></td>
<td class="py-2 px-4 border-b"><%= point.battery %></td>
<td class="py-2 px-4 border-b"><%= point.tracker_id %></td>
<td class="py-2 px-4 border-b"><%= point.topic %></td>
<td class="py-2 px-4 border-b"><%= point.altitude %></td>
<td class="py-2 px-4 border-b"><%= point.velocity %></td>
<td class="py-2 px-4 border-b"><%= point.trigger %></td>
<td class="py-2 px-4 border-b"><%= point.bssid %></td>
<td class="py-2 px-4 border-b"><%= point.ssid %></td>
<td class="py-2 px-4 border-b"><%= point.connection %></td>
<td class="py-2 px-4 border-b"><%= point.vertical_accuracy %></td>
<td class="py-2 px-4 border-b"><%= point.accuracy %></td>
<td class="py-2 px-4 border-b"><%= point.timestamp %></td>
<td class="py-2 px-4 border-b"><%= point.mode %></td>
<td class="py-2 px-4 border-b"><%= point.latitude %></td>
<td class="py-2 px-4 border-b"><%= point.longitude %></td>
<td class="py-2 px-4 border-b"><%= point.inrids %></td>
<td class="py-2 px-4 border-b"><%= point.in_regions %></td>
<td class="py-2 px-4 border-b"><%= point.raw_data %></td>
<td class="py-2 px-4 border-b"><%= point.created_at %></td>
<td class="py-2 px-4 border-b"><%= point.updated_at %></td>
</tr>
<% end %>
</tbody>
</table>