Current section
Files
Jump to
Current section
Files
lib/history_web/live/candle_live.html.leex
<div class="space-x-4">
<%= render HistoryWeb.DataView, "_header.html", conn: @socket, section: ["Candles"] %>
</div>
<%= render HistoryWeb.DataView, "_nav.html", conn: @socket %>
<div class="mt-4">
<h3 class="text-2xl">
Schedules
</h3>
<table class="w-full mt-8">
<thead class="bg-gray-200 border-t-2 border-gray-400">
<tr>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Created At</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Every</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">From</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">To</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Products</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Status</th>
</tr>
</thead>
<tbody>
<%= if Enum.any?(@job_schedules) do %>
<%= for s <- @job_schedules do %>
<tr class="hover:bg-gray-50 border-t border-b group">
<td class="px-4 py-3"><%= s.inserted_at %></td>
<td class="px-4 py-3">TODO...</td>
<td class="px-4 py-3">TODO...</td>
<td class="px-4 py-3">TODO...</td>
<td class="px-4 py-3">TODO...</td>
<td class="px-4 py-3">TODO...</td>
</tr>
<% end %>
<% else %>
<tr class="hover:bg-gray-50 border-t border-b group">
<td colspan="6" class="px-4 py-3">No schedules</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="mt-8">
<h3 class="text-2xl">
Jobs
</h3>
<table class="w-full mt-4">
<thead class="bg-gray-200 border-t-2 border-gray-400">
<tr>
<th scope="col" class="px-4 py-3 text-left text-gray-700">ID</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Created At</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">From</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">To</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Periods</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Products</th>
<th scope="col" class="px-4 py-3 text-left text-gray-700">Status</th>
</tr>
</thead>
<tbody>
<%= if Enum.any?(@jobs) do %>
<%= for j <- @jobs do %>
<tr class="hover:bg-gray-50 border-t border-b group">
<td class="px-4 py-3"><%= link j.id, to: Routes.candle_job_path(@socket, :show, j.id), class: "hover:opacity-75" %></td>
<td class="px-4 py-3"><%= j.inserted_at %></td>
<td class="px-4 py-3"><%= History.RangeJob.from!(j) %></td>
<td class="px-4 py-3"><%= History.RangeJob.to!(j) %></td>
<td class="px-4 py-3"><%= j.periods |> Enum.join(", ") %></td>
<td class="px-4 py-3">
<%= products_by_group(j.products, max_products: 3) %>
</td>
<td class="px-4 py-3">
<%= render HistoryWeb.StatusView, "_pill.html", status: j.status %>
</td>
</tr>
<% end %>
<% else %>
<tr class="hover:bg-gray-50 border-t border-b group">
<td colspan="7" class="px-4 py-3">No history download jobs</td>
</tr>
<% end %>
</tbody>
<tfoot>
<tr>
<td colspan="11" class="px-4 py-3 text-right">
<%= link "See more...", to: Routes.candle_job_path(@socket, :index), class: "opacity-70 hover:opacity-50" %>
</td>
</tr>
</tfoot>
</table>
</div>