<%= if @error do %>

Error

{@error}
<% else %>
<%= for packet <- @all_packets do %> <% end %>
Time Sender Data Type Information Path Device
<%= case packet.received_at do %> <% %DateTime{} = dt -> %> {Calendar.strftime(dt, "%Y-%m-%d %H:%M:%S")} <% dt when is_binary(dt) -> %> <%= case DateTime.from_iso8601(dt) do %> <% {:ok, parsed_dt, _} -> %> {Calendar.strftime(parsed_dt, "%Y-%m-%d %H:%M:%S")} <% _ -> %> {dt} <% end %> <% _ -> %> N/A <% end %> {packet.sender} {packet.data_type} <%= if String.length(packet.information_field || "") > 50 do %> {String.slice(packet.information_field, 0, 50)}... <% else %> {packet.information_field} <% end %> {packet.path} <%= if packet.device_model || packet.device_vendor do %> {[packet.device_model, packet.device_vendor] |> Enum.reject(&is_nil/1) |> Enum.join(" ")} <% else %> {Map.get( packet, :device_identifier, Map.get(packet, "device_identifier", "") )} <% end %>
<%= if length(@all_packets) == 0 do %>

No packets found for {@callsign}

Packets will appear here as they are received live or if there are stored packets for this callsign.

<% end %>
Live packets: {length(@live_packets)} Stored packets: {length(@packets)} Total: {length(@all_packets)}/100
<% end %>