Improve status page cluster information display

- Remove APRS server port from status page server field
- Add comprehensive cluster node list to cluster status section
- Highlight leader node with primary badge and indicator dot
- Display all cluster nodes in a responsive flex layout
- Include all_nodes field in cluster_info for complete node visibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Graham McIntire 2025-07-27 12:53:19 -05:00
parent 844c1b0a6c
commit 080dac3813
No known key found for this signature in database
2 changed files with 27 additions and 3 deletions

View file

@ -210,7 +210,8 @@ defmodule Aprsme.Cluster.LeaderElection do
Map.put(status, :cluster_info, %{
total_nodes: length(all_nodes),
connected_nodes: length(connected_statuses),
leader_node: get_leader_node_name()
leader_node: get_leader_node_name(),
all_nodes: all_nodes |> Enum.map(&to_string/1) |> Enum.sort()
})
[] ->
@ -220,7 +221,8 @@ defmodule Aprsme.Cluster.LeaderElection do
Map.put(local_status, :cluster_info, %{
total_nodes: length(all_nodes),
connected_nodes: 0,
leader_node: get_leader_node_name()
leader_node: get_leader_node_name(),
all_nodes: all_nodes |> Enum.map(&to_string/1) |> Enum.sort()
})
end
end

View file

@ -137,7 +137,7 @@ defmodule AprsmeWeb.StatusLive.Index do
<div class="flex items-center">
<span class="text-sm font-medium opacity-70 mr-2">{gettext("Server:")}</span>
<span class="text-sm font-mono">
{@aprs_status.server}:{@aprs_status.port}
{@aprs_status.server}
</span>
</div>
@ -317,6 +317,28 @@ defmodule AprsmeWeb.StatusLive.Index do
</div>
</div>
<%= if Map.has_key?(@aprs_status.cluster_info, :all_nodes) do %>
<div class="mt-4">
<span class="text-sm font-medium opacity-70">{gettext("Cluster Nodes:")}</span>
<div class="flex flex-wrap gap-2 mt-2">
<%= for node_name <- @aprs_status.cluster_info.all_nodes do %>
<div class={[
"badge gap-1",
if(node_name == @aprs_status.cluster_info.leader_node, do: "badge-primary", else: "badge-outline")
]}>
<%= if node_name == @aprs_status.cluster_info.leader_node do %>
<div class="w-2 h-2 bg-current rounded-full"></div>
<% end %>
<span class="font-mono text-xs">{node_name}</span>
</div>
<% end %>
</div>
<p class="text-xs opacity-70 mt-1">
{gettext("Leader node")} <span class="badge badge-primary badge-xs">{gettext("highlighted")}</span>
</p>
</div>
<% end %>
<p class="text-xs opacity-70 mt-2">
{gettext(
"Status is aggregated from all nodes in the cluster. Only the leader node maintains the APRS-IS connection."