last deploy change

This commit is contained in:
Graham McIntire 2025-06-21 22:06:49 -05:00
parent 05815a0f8b
commit 191fe5cb01
No known key found for this signature in database

View file

@ -154,14 +154,18 @@ defmodule AprsWeb.MapLive.Index do
@impl true @impl true
def handle_event("bounds_changed", %{"bounds" => bounds}, socket) do def handle_event("bounds_changed", %{"bounds" => bounds}, socket) do
Logger.debug("handle_event bounds_changed: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}") Logger.debug(
"handle_event bounds_changed: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}"
)
handle_bounds_update(bounds, socket) handle_bounds_update(bounds, socket)
end end
@impl true @impl true
def handle_event("update_bounds", %{"bounds" => bounds}, socket) do def handle_event("update_bounds", %{"bounds" => bounds}, socket) do
Logger.debug("handle_event update_bounds: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}") Logger.debug(
"handle_event update_bounds: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}"
)
handle_bounds_update(bounds, socket) handle_bounds_update(bounds, socket)
end end
@ -325,7 +329,9 @@ defmodule AprsWeb.MapLive.Index do
west: bounds["west"] west: bounds["west"]
} }
Logger.debug("handle_bounds_update: new #{inspect(map_bounds)} vs current #{inspect(socket.assigns.map_bounds)}") Logger.debug(
"handle_bounds_update: new #{inspect(map_bounds)} vs current #{inspect(socket.assigns.map_bounds)}"
)
# Validate bounds to prevent invalid coordinates # Validate bounds to prevent invalid coordinates
if map_bounds.north > 90 or map_bounds.south < -90 or if map_bounds.north > 90 or map_bounds.south < -90 or
@ -351,7 +357,9 @@ defmodule AprsWeb.MapLive.Index do
@spec process_bounds_update(map(), Socket.t()) :: Socket.t() @spec process_bounds_update(map(), Socket.t()) :: Socket.t()
defp process_bounds_update(map_bounds, socket) do defp process_bounds_update(map_bounds, socket) do
Logger.debug("process_bounds_update: Loading historical packets for bounds #{inspect(map_bounds)}") Logger.debug(
"process_bounds_update: Loading historical packets for bounds #{inspect(map_bounds)}"
)
# Remove out-of-bounds packets and markers immediately # Remove out-of-bounds packets and markers immediately
new_visible_packets = new_visible_packets =
@ -385,22 +393,30 @@ defmodule AprsWeb.MapLive.Index do
end end
@impl true @impl true
def handle_info({:process_bounds_update, map_bounds}, socket), do: handle_info_process_bounds_update(map_bounds, socket) def handle_info({:process_bounds_update, map_bounds}, socket),
do: handle_info_process_bounds_update(map_bounds, socket)
def handle_info({:delayed_zoom, %{lat: lat, lng: lng}}, socket), do: handle_info_delayed_zoom(lat, lng, socket) def handle_info({:delayed_zoom, %{lat: lat, lng: lng}}, socket),
do: handle_info_delayed_zoom(lat, lng, socket)
def handle_info({:ip_location, %{lat: lat, lng: lng}}, socket), do: handle_info_ip_location(lat, lng, socket) def handle_info({:ip_location, %{lat: lat, lng: lng}}, socket),
do: handle_info_ip_location(lat, lng, socket)
def handle_info(:initialize_replay, socket), do: handle_info_initialize_replay(socket) def handle_info(:initialize_replay, socket), do: handle_info_initialize_replay(socket)
def handle_info(:cleanup_old_packets, socket), do: handle_cleanup_old_packets(socket) def handle_info(:cleanup_old_packets, socket), do: handle_cleanup_old_packets(socket)
def handle_info(:reload_historical_packets, socket), do: handle_reload_historical_packets(socket) def handle_info(:reload_historical_packets, socket),
do: handle_reload_historical_packets(socket)
def handle_info({:postgres_packet, packet}, socket), do: handle_info_postgres_packet(packet, socket) def handle_info({:postgres_packet, packet}, socket),
do: handle_info_postgres_packet(packet, socket)
def handle_info(%Phoenix.Socket.Broadcast{topic: "aprs_messages", event: "packet", payload: packet}, socket), def handle_info(
do: handle_info({:postgres_packet, packet}, socket) %Phoenix.Socket.Broadcast{topic: "aprs_messages", event: "packet", payload: packet},
socket
),
do: handle_info({:postgres_packet, packet}, socket)
# Private handler functions for each message type # Private handler functions for each message type
@ -960,7 +976,7 @@ defmodule AprsWeb.MapLive.Index do
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
/> />
</svg> </svg>
<span class="font-medium">Deployed:</span> <span class="font-medium">Last Deploy:</span>
</div> </div>
<div class="text-xs text-slate-500 font-mono"> <div class="text-xs text-slate-500 font-mono">
{Calendar.strftime(@deployed_at, "%Y-%m-%d %H:%M UTC")} {Calendar.strftime(@deployed_at, "%Y-%m-%d %H:%M UTC")}