defmodule Bloccs.Web.Panels.Networks do @moduledoc """ Panel 1 — the list of every running network (`Bloccs.Introspect.list_networks/0`), each row linking into its topology. Pure presentation; data is loaded by `Bloccs.Web.DashboardLive` and passed in. """ use Bloccs.Web, :html alias Bloccs.Web.{Format, Paths} attr :networks, :list, required: true attr :base_path, :string, required: true attr :now, :integer, required: true def render(assigns) do ~H"""

Networks

{count_label(@networks)}
Network Version Nodes Edges Uptime
<.link navigate={Paths.topology(@base_path, n.id)} class="bloccs-link"> {n.id} {n.version} {n.node_count} {n.edge_count} {Format.uptime(n.started_at, @now)}

No running networks.

Start a compiled network (e.g. mix bloccs.run) and it appears here. Networks built with bloccs < 0.2 must be recompiled to be discoverable.

""" end defp count_label([_]), do: "1 running" defp count_label(list), do: "#{length(list)} running" end