Show actual missing data counts instead of queued flags on backfill page
This commit is contained in:
parent
9485df4b8d
commit
4999548a0c
1 changed files with 38 additions and 11 deletions
|
|
@ -85,15 +85,37 @@ defmodule MicrowavepropWeb.BackfillLive do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp count_unprocessed do
|
defp count_unprocessed do
|
||||||
Repo.one(
|
missing_terrain =
|
||||||
from(c in Contact,
|
Repo.one(
|
||||||
where:
|
from(c in Contact,
|
||||||
not is_nil(c.pos1) and
|
left_join: t in Microwaveprop.Terrain.TerrainProfile, on: t.qso_id == c.id,
|
||||||
(c.hrrr_queued == false or c.weather_queued == false or
|
where: not is_nil(c.pos1) and not is_nil(c.pos2) and is_nil(t.id),
|
||||||
c.terrain_queued == false or c.iemre_queued == false),
|
select: count(c.id)
|
||||||
select: count(c.id)
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
missing_hrrr =
|
||||||
|
Repo.one(
|
||||||
|
from(c in Contact,
|
||||||
|
where: not is_nil(c.pos1) and c.hrrr_queued == false,
|
||||||
|
select: count(c.id)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
missing_weather =
|
||||||
|
Repo.one(
|
||||||
|
from(c in Contact,
|
||||||
|
where: not is_nil(c.pos1) and c.weather_queued == false,
|
||||||
|
select: count(c.id)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
%{
|
||||||
|
terrain: missing_terrain,
|
||||||
|
hrrr: missing_hrrr,
|
||||||
|
weather: missing_weather,
|
||||||
|
total: max(missing_terrain, max(missing_hrrr, missing_weather))
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp fetch_stats do
|
defp fetch_stats do
|
||||||
|
|
@ -148,15 +170,20 @@ defmodule MicrowavepropWeb.BackfillLive do
|
||||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 my-6">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 my-6">
|
||||||
<div class="stat bg-base-200 rounded-box p-4">
|
<div class="stat bg-base-200 rounded-box p-4">
|
||||||
<div class="text-xs opacity-60">Enrichment Progress</div>
|
<div class="text-xs opacity-60">Enrichment Progress</div>
|
||||||
<div class="text-2xl font-bold">{@unprocessed} remaining</div>
|
<div class="text-2xl font-bold">{@unprocessed.total} remaining</div>
|
||||||
<div class="text-xs opacity-60 mt-1">
|
<div class="text-xs opacity-60 mt-1">
|
||||||
{@total_contacts - @unprocessed} / {@total_contacts} complete
|
{@total_contacts - @unprocessed.total} / {@total_contacts} complete
|
||||||
</div>
|
</div>
|
||||||
<progress
|
<progress
|
||||||
class="progress progress-primary w-full mt-2"
|
class="progress progress-primary w-full mt-2"
|
||||||
value={@total_contacts - @unprocessed}
|
value={@total_contacts - @unprocessed.total}
|
||||||
max={@total_contacts}
|
max={@total_contacts}
|
||||||
/>
|
/>
|
||||||
|
<div class="flex gap-4 mt-2 text-xs opacity-60">
|
||||||
|
<span>Terrain: {@unprocessed.terrain}</span>
|
||||||
|
<span>HRRR: {@unprocessed.hrrr}</span>
|
||||||
|
<span>Weather: {@unprocessed.weather}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat bg-base-200 rounded-box p-4">
|
<div class="stat bg-base-200 rounded-box p-4">
|
||||||
<div class="text-xs opacity-60">Active/Queued Jobs</div>
|
<div class="text-xs opacity-60">Active/Queued Jobs</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue