<.header> Account Settings <:subtitle>Manage your account email address and password settings
<.form :let={f} for={@email_changeset} action={~p"/users/settings"} id="update_email"> <.input field={f[:email]} type="email" label="Email" autocomplete="username" spellcheck="false" required /> <.button variant="primary" phx-disable-with="Changing...">Change Email
<.form :let={f} for={@home_qth_changeset} action={~p"/users/settings"} id="update_home_qth">

Home QTH

Used to anchor the rover map (drive radius, distance/bearing labels). Enter a Maidenhead grid (e.g. EM13qc) or explicit lat/lon.

<.icon name="hero-exclamation-triangle" class="size-4 shrink-0" /> Using the default NTMS-area location (EM13). A QRZ lookup for {@current_scope.user.callsign} is queued — check back shortly, or set yours manually below.
<.input field={f[:home_grid]} type="text" label="Home grid" placeholder="EM13qc" autocomplete="off" />
<.input field={f[:home_lat]} type="number" step="any" label="Latitude" /> <.input field={f[:home_lon]} type="number" step="any" label="Longitude" />
<.button variant="primary" phx-disable-with="Saving...">Save Home QTH
<.form :let={f} for={@password_changeset} action={~p"/users/settings"} id="update_password"> <.input field={f[:password]} type="password" label="New password" autocomplete="new-password" spellcheck="false" required /> <.input field={f[:password_confirmation]} type="password" label="Confirm new password" autocomplete="new-password" spellcheck="false" required /> <.button variant="primary" phx-disable-with="Changing..."> Save Password
<.header> Assigned beacon monitors <:subtitle> Physical monitor hardware assigned to you by an admin. Each unit reports beacon reception data back to Microwaveprop. <%= if @beacon_monitors == [] do %>

No monitors assigned to you yet.

<% else %>
<%= for monitor <- @beacon_monitors do %> <% end %>
Name Hardware Monitoring Last seen
{monitor.name} <%= if monitor.hardware_type do %> {monitor.hardware_type}
{monitor.hardware_id} <% else %> <% end %>
<%= if monitor.beacon do %> <.link navigate={~p"/beacons/#{monitor.beacon.id}"} class="link link-hover font-mono" > {monitor.beacon.callsign} {monitor.beacon.frequency_mhz} MHz <% else %> Not configured <% end %> <%= if monitor.last_seen_at do %> {Calendar.strftime(monitor.last_seen_at, "%Y-%m-%d %H:%M UTC")} <% else %> never <% end %> <.link href={~p"/users/beacon-monitors/#{monitor.id}"} method="delete" class="btn btn-ghost btn-xs text-error" data-confirm={"Delete monitor '#{monitor.name}'? Its token will stop working immediately."} > Delete
<% end %>
<.header> API tokens <:subtitle> Long-lived bearer tokens for the <.link navigate={~p"/docs/api"} class="link">REST API at /api/v1. Each token grants the same permissions as your account; treat them like passwords. <%= if Phoenix.Flash.get(@flash, :api_token) do %>
<.icon name="hero-key" class="size-4 shrink-0" />

New token — copy now, it will not be shown again:

{Phoenix.Flash.get(@flash, :api_token)}
<% end %> <.form :let={f} for={%{}} as={:api_token} action={~p"/users/api-tokens"} id="create_api_token" >
<.button variant="primary" phx-disable-with="Creating...">Create token
<%= if @api_tokens == [] do %>

No API tokens yet.

<% else %>
<%= for token <- @api_tokens do %> <% end %>
Name Created Last used Expires
{token.name} {Calendar.strftime(token.inserted_at, "%Y-%m-%d")} <%= if token.last_used_at do %> {Calendar.strftime(token.last_used_at, "%Y-%m-%d %H:%M UTC")} <% else %> never <% end %> <%= if token.expires_at do %> {Calendar.strftime(token.expires_at, "%Y-%m-%d")} <% else %> never <% end %> <.link href={~p"/users/api-tokens/#{token.id}"} method="delete" class="btn btn-ghost btn-xs text-error" data-confirm={"Revoke API token '#{token.name}'? It will stop working immediately."} > Revoke
<% end %>