<.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={@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> Beacon monitors <:subtitle> Register remote monitor stations. Each monitor gets a unique token the monitor program uses to authenticate its reports. <.form :let={f} for={@beacon_monitor_changeset} as={:beacon_monitor} action={~p"/users/beacon-monitors"} id="create_beacon_monitor" >
<.button variant="primary" phx-disable-with="Adding...">Add monitor
<%= if @beacon_monitors == [] do %>

No monitors registered yet.

<% else %>
<%= for monitor <- @beacon_monitors do %> <% end %>
Name Token Last seen
{monitor.name} {monitor.token} <%= 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 %>