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,
|
assign(socket,
|
||||||
page_title: "Backfill",
|
page_title: "Backfill",
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
types: MapSet.new(~w(hrrr weather terrain iemre)),
|
||||||
stats: stats,
|
stats: stats,
|
||||||
unprocessed: unprocessed,
|
unprocessed: unprocessed,
|
||||||
db_stats: db_stats,
|
db_stats: db_stats,
|
||||||
|
|
@ -56,7 +57,10 @@ defmodule MicrowavepropWeb.BackfillLive do
|
||||||
|> BackfillEnqueueWorker.new()
|
|> BackfillEnqueueWorker.new()
|
||||||
|> Oban.insert()
|
|> 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
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
|
@ -351,7 +355,13 @@ defmodule MicrowavepropWeb.BackfillLive do
|
||||||
<div class="flex gap-3 items-center">
|
<div class="flex gap-3 items-center">
|
||||||
<%= for type <- ~w(hrrr weather terrain iemre) do %>
|
<%= for type <- ~w(hrrr weather terrain iemre) do %>
|
||||||
<label class="label cursor-pointer gap-1">
|
<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>
|
<span class="text-xs uppercase">{type}</span>
|
||||||
</label>
|
</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue