feat(rover-locations): show 10-char Maidenhead grid (computed, never stored)

This commit is contained in:
Graham McIntire 2026-04-26 13:10:49 -05:00
parent 140351c0f6
commit ca142d5091
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -7,6 +7,7 @@ defmodule MicrowavepropWeb.RoverLocationsLive do
use MicrowavepropWeb, :live_view use MicrowavepropWeb, :live_view
alias Microwaveprop.Accounts.User alias Microwaveprop.Accounts.User
alias Microwaveprop.Radio.Maidenhead
alias Microwaveprop.Rover alias Microwaveprop.Rover
alias Microwaveprop.Rover.Location alias Microwaveprop.Rover.Location
@ -237,9 +238,12 @@ defmodule MicrowavepropWeb.RoverLocationsLive do
> >
<div class="flex items-start justify-between gap-3"> <div class="flex items-start justify-between gap-3">
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
<div class="flex items-center gap-2 mb-1"> <div class="flex items-center gap-2 mb-1 flex-wrap">
<span class={status_class(loc.status)}>{status_label(loc.status)}</span> <span class={status_class(loc.status)}>{status_label(loc.status)}</span>
<span class="font-mono text-sm"> <span class="font-mono text-sm font-semibold">
{Maidenhead.from_latlon(loc.lat, loc.lon, 10)}
</span>
<span class="font-mono text-xs text-base-content/60">
{Float.round(loc.lat, 5)}, {Float.round(loc.lon, 5)} {Float.round(loc.lat, 5)}, {Float.round(loc.lon, 5)}
</span> </span>
</div> </div>