All Agents

Agents across all organizations and cloud pollers

<%!-- Cloud Pollers --%> <%= if @has_cloud_pollers do %>

<.icon name="hero-cloud" class="w-5 h-5 inline mr-1" /> Cloud Pollers

<.table id="cloud-pollers-table" rows={@streams.cloud_pollers} row_link={fn {_id, agent} -> ~p"/agents/#{agent.id}" end} > <:col :let={{_id, agent}} label="Name">
{agent.name} <%= if agent.allow_remote_debug do %> <.icon name="hero-bug-ant" class="h-3 w-3" /> Debug <% end %>
<:col :let={{_id, agent}} label="Status"> <% {status, label} = agent_status(agent) %> {label} <:col :let={{_id, agent}} label="Devices"> <% counts = Map.get(@device_counts, agent.id, %{direct: 0, total: 0}) %>
{counts.total} total
{counts.direct} direct <%= if counts.total > counts.direct do %> · {counts.total - counts.direct} inherited <% end %>
<:col :let={{_id, agent}} label="Last Seen">
<.timestamp datetime={agent.last_seen_at} timezone={@timezone} now={@now} />
<%= if agent.last_seen_at do %>
<.timestamp datetime={agent.last_seen_at} timezone={@timezone} format="absolute" />
<% end %> <:col :let={{_id, agent}} label="Version"> <%= if agent.metadata["version"] do %>
{format_agent_version(agent.metadata["version"])}
<% end %>
<% end %> <%!-- Organization Agents --%> <%= if @has_org_agents do %>

<.icon name="hero-server" class="w-5 h-5 inline mr-1" /> Organization Agents

<.table id="org-agents-table" rows={@streams.org_agents} row_link={fn {_id, agent} -> ~p"/agents/#{agent.id}" end} > <:col :let={{_id, agent}} label="Name">
{agent.name} <%= if agent.allow_remote_debug do %> <.icon name="hero-bug-ant" class="h-3 w-3" /> Debug <% end %>
{agent.organization.name}
<:col :let={{_id, agent}} label="Status"> <% {status, label} = agent_status(agent) %> {label} <:col :let={{_id, agent}} label="Devices"> <% counts = Map.get(@device_counts, agent.id, %{direct: 0, total: 0}) %>
{counts.total} total
{counts.direct} direct <%= if counts.total > counts.direct do %> · {counts.total - counts.direct} inherited <% end %>
<:col :let={{_id, agent}} label="Last Seen">
<.timestamp datetime={agent.last_seen_at} timezone={@timezone} now={@now} />
<%= if agent.last_seen_at do %>
<.timestamp datetime={agent.last_seen_at} timezone={@timezone} format="absolute" />
<% end %> <:col :let={{_id, agent}} label="Version"> <%= if agent.metadata["version"] do %>
{format_agent_version(agent.metadata["version"])}
<% end %>
<% end %>