Show enrichment progress bar with remaining/total contacts
This commit is contained in:
parent
c95da8ccdb
commit
b6a5e709b7
1 changed files with 12 additions and 2 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue