Show enrichment progress bar with remaining/total contacts

This commit is contained in:
Graham McIntire 2026-04-02 11:47:20 -05:00
parent c95da8ccdb
commit b6a5e709b7
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -18,6 +18,7 @@ defmodule MicrowavepropWeb.BackfillLive do
stats = fetch_stats()
unprocessed = count_unprocessed()
total_contacts = Repo.aggregate(from(c in Contact, where: not is_nil(c.pos1)), :count)
{:ok,
assign(socket,
@ -25,6 +26,7 @@ defmodule MicrowavepropWeb.BackfillLive do
limit: 500,
stats: stats,
unprocessed: unprocessed,
total_contacts: total_contacts,
last_enqueued: nil,
enqueuing: false
)}
@ -145,8 +147,16 @@ defmodule MicrowavepropWeb.BackfillLive do
<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="text-xs opacity-60">Contacts Needing Enrichment</div>
<div class="text-2xl font-bold">{@unprocessed}</div>
<div class="text-xs opacity-60">Enrichment Progress</div>
<div class="text-2xl font-bold">{@unprocessed} remaining</div>
<div class="text-xs opacity-60 mt-1">
{@total_contacts - @unprocessed} / {@total_contacts} complete
</div>
<progress
class="progress progress-primary w-full mt-2"
value={@total_contacts - @unprocessed}
max={@total_contacts}
/>
</div>
<div class="stat bg-base-200 rounded-box p-4">
<div class="text-xs opacity-60">Active/Queued Jobs</div>