An additional page for Phoenix LiveDashboard with information about connected nodes.
For example, an app deployed to fly.io as a cluster in 3 regions, one of which has a remote console running and an attached Livebook session, would look like this:
If available in Hex, the package can be installed
by adding connected_nodes_dashboard
to your list of dependencies in mix.exs
:
def deps do
[
{:connected_nodes_dashboard, "~> 0.1.0"}
]
end
Add ConnectedNodesDashboard.Page
to the list of additional LiveDashboard pages in your router:
live_dashboard "/live_dashboard",
# ...
additional_pages: [
connected_nodes: ConnectedNodesDashboard.Page
]
You can also pass a list of environmental variables which values you'd like to see for each of the connected nodes.
live_dashboard "/live_dashboard",
# ...
additional_pages: [
connected_nodes: {ConnectedNodesDashboard.Page, env_vars: [:FOO, :BAR]}
]
Please note that since LiveDashboard table component requires fields to be atoms, env_vars
elements should also be atoms - the library ignores string keys.
In the above example, env_vars
is set up like this:
live_dashboard "/live_dashboard",
# ...
additional_pages: [
connected_nodes: {ConnectedNodesDashboard.Page, env_vars: [:FLY_REGION, :FLY_ALLOC_ID]}
]