Persist checkbox and limit state across backfill enqueue submissions
This commit is contained in:
parent
ef44109351
commit
c3819112fe
1 changed files with 12 additions and 2 deletions
|
|
@ -31,6 +31,7 @@ defmodule MicrowavepropWeb.BackfillLive do
|
|||
assign(socket,
|
||||
page_title: "Backfill",
|
||||
limit: limit,
|
||||
types: MapSet.new(~w(hrrr weather terrain iemre)),
|
||||
stats: stats,
|
||||
unprocessed: unprocessed,
|
||||
db_stats: db_stats,
|
||||
|
|
@ -56,7 +57,10 @@ defmodule MicrowavepropWeb.BackfillLive do
|
|||
|> BackfillEnqueueWorker.new()
|
||||
|> Oban.insert()
|
||||
|
||||
{:noreply, socket |> assign(enqueuing: true, limit: limit) |> LiveStash.stash_assigns([:limit])}
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(enqueuing: true, limit: limit, types: MapSet.new(types))
|
||||
|> LiveStash.stash_assigns([:limit])}
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
@ -351,7 +355,13 @@ defmodule MicrowavepropWeb.BackfillLive do
|
|||
<div class="flex gap-3 items-center">
|
||||
<%= for type <- ~w(hrrr weather terrain iemre) do %>
|
||||
<label class="label cursor-pointer gap-1">
|
||||
<input type="checkbox" name={type} value="true" checked class="checkbox checkbox-sm" />
|
||||
<input
|
||||
type="checkbox"
|
||||
name={type}
|
||||
value="true"
|
||||
checked={MapSet.member?(@types, type)}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
<span class="text-xs uppercase">{type}</span>
|
||||
</label>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue