neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
?
5c42b1f · gmorell · 2023-06-16 23:32
Files changed
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_source_live/show.ex
+6
−3
@@ -11,7 +11,7 @@ defmodule RoomSanctumWeb.SourceLive.Show do
| 11 | 11 | socket |
| 12 | 12 | |> assign(:status, :idle) |
| 13 | 13 | |> assign(:status_val, 0) |
| 14 | − |> assign(:stats, []) | |
| 14 | + |> assign(:stats, %{}) | |
| 15 | 15 | |> assign(:queries, []) |
| 16 | 16 | } |
| 17 | 17 | end |
@@ -85,11 +85,14 @@ defmodule RoomSanctumWeb.SourceLive.Show do
| 85 | 85 | |
| 86 | 86 | def handle_event("do-stats", %{"type" => type, "id" => id}, socket) do |
| 87 | 87 | IO.inspect({type, id}) |
| 88 | − | |
| 88 | + stats = case type do | |
| 89 | + "gtfs" -> %{"gtfs": RoomGtfs.Worker.source_stats(id), "rt": %{}} | |
| 90 | + _otherwise -> %{} | |
| 91 | + end | |
| 89 | 92 | { |
| 90 | 93 | :noreply, |
| 91 | 94 | socket |
| 92 | − |> assign(:stats, socket.assigns.stats ++ ["1", "2", "3", "4", "5"]) | |
| 95 | + |> assign(:stats, stats) | |
| 93 | 96 | } |
| 94 | 97 | end |
| 95 | 98 |
Parents: a7c4807