diff --git a/lib/nerves_hub_web/components/core_components.ex b/lib/nerves_hub_web/components/core_components.ex index f0b287838..e38cde682 100644 --- a/lib/nerves_hub_web/components/core_components.ex +++ b/lib/nerves_hub_web/components/core_components.ex @@ -188,7 +188,7 @@ defmodule NervesHubWeb.CoreComponents do <.button phx-click="go" class="ml-2">Send! """ attr(:style, :string, default: "secondary") - attr(:type, :string, default: nil) + attr(:type, :string, default: "button") attr(:class, :string, default: nil) attr(:rest, :global, include: ~w(disabled form name value href navigate download)) diff --git a/lib/nerves_hub_web/components/icons.ex b/lib/nerves_hub_web/components/icons.ex index 9d015392f..a58c50602 100644 --- a/lib/nerves_hub_web/components/icons.ex +++ b/lib/nerves_hub_web/components/icons.ex @@ -82,4 +82,30 @@ defmodule NervesHubWeb.Components.Icons do """ end + + def icon(%{name: "connection"} = assigns) do + ~H""" + + + + """ + end + + def icon(%{name: "identify"} = assigns) do + ~H""" + + + + """ + end end diff --git a/lib/nerves_hub_web/live/devices/show-new.html.heex b/lib/nerves_hub_web/live/devices/show-new.html.heex index 1487893e3..23e396e42 100644 --- a/lib/nerves_hub_web/live/devices/show-new.html.heex +++ b/lib/nerves_hub_web/live/devices/show-new.html.heex @@ -10,63 +10,17 @@ {@device.identifier}
- - - - - + <.button aria-label="Reboot device" style="secondary" phx-click="reboot" data-confirm="Are you sure you want to reboot the device?" disabled={disconnected?(@device_connection)}> + <.icon name="power" />Reboot + + + <.button aria-label="Reconnect device" style="secondary" phx-click="reconnect" disabled={disconnected?(@device_connection)}> + <.icon name="connection" />Reconnect + + + <.button aria-label="Identify device" style="secondary" phx-click="identify" disabled={disconnected?(@device_connection)}> + <.icon name="identify" />Identify +