Packages

A self-hosted, real-time dashboard for running bloccs networks — topology, live per-node metrics, and coverage, mounted into your Phoenix app.

Current section

Files

Jump to
bloccs_web lib bloccs web paths.ex
Raw

lib/bloccs/web/paths.ex

defmodule Bloccs.Web.Paths do
@moduledoc """
Builds dashboard URLs from the mount base path (e.g. `"/bloccs"`), which the
router macro stashes in the session. A library can't use the host's `~p`
verified routes, so paths are assembled here from one source of truth.
"""
@spec networks(String.t()) :: String.t()
def networks(base), do: "#{base}/networks"
@spec topology(String.t(), atom() | String.t()) :: String.t()
def topology(base, id), do: "#{base}/networks/#{id}"
@spec messages(String.t(), atom() | String.t()) :: String.t()
def messages(base, id), do: "#{base}/networks/#{id}/messages"
@spec metrics(String.t(), atom() | String.t()) :: String.t()
def metrics(base, id), do: "#{base}/networks/#{id}/metrics"
@spec coverage(String.t(), atom() | String.t()) :: String.t()
def coverage(base, id), do: "#{base}/networks/#{id}/coverage"
end