1.5 KiB · text History 9c0fc16
<div class="overflow-x-auto">
  <div class="my-2 flex flex-wrap items-center gap-2">
    <.link patch={~p"/cfg/devices"} class="btn btn-ghost normal-case">
      <i class="fa-solid fa-chevron-left"></i> All devices
    </.link>
    <span class="text-sm opacity-60">
      The scan looks for devices on every interface it is left with. Loopback, docker,
      tunnels and the like are dropped by name before they get here; unchecking one of
      these stops sweeping it, and is remembered across a restart.
    </span>
  </div>

  <table class="table table-zebra w-full">
    <thead>
      <tr>
        <th>Swept</th>
        <th>Interface</th>
        <th>Address</th>
      </tr>
    </thead>
    <tbody>
      <%= if Enum.empty?(@interfaces) do %>
        <tr>
          <th colspan="3">No interfaces to scan.</th>
        </tr>
      <% end %>
      <%= for iface <- @interfaces do %>
        <tr>
          <td>
            <input
              type="checkbox"
              class="checkbox"
              checked={iface.enabled}
              phx-click="toggle_iface"
              phx-value-name={iface.name}
            />
          </td>
          <th><%= iface.name %></th>
          <td><%= iface.addr || "-" %></td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <p class="text-sm opacity-60 py-2">
    <%= swept(@interfaces) %> of <%= length(@interfaces) %> swept. A manual probe still
    reaches an address on an interface that is not being swept.
  </p>
</div>