diff --git a/comp/core/remoteagentregistry/status/status.go b/comp/core/remoteagentregistry/status/status.go index dc32a9b2c0d3..6191b4a78283 100644 --- a/comp/core/remoteagentregistry/status/status.go +++ b/comp/core/remoteagentregistry/status/status.go @@ -64,6 +64,6 @@ func (p Provider) Text(_ bool, buffer io.Writer) error { } // HTML renders the html output -func (p Provider) HTML(_ bool, _ io.Writer) error { - return nil +func (p Provider) HTML(_ bool, buffer io.Writer) error { + return status.RenderHTML(templatesFS, "remote_agents_html.tmpl", buffer, p.getStatusInfo()) } diff --git a/comp/core/remoteagentregistry/status/status_templates/remote_agents_html.tmpl b/comp/core/remoteagentregistry/status/status_templates/remote_agents_html.tmpl new file mode 100644 index 000000000000..f89b7a14ad8f --- /dev/null +++ b/comp/core/remoteagentregistry/status/status_templates/remote_agents_html.tmpl @@ -0,0 +1,48 @@ +
+ Remote Agents + + {{ if not .registeredAgents }} + No remote agents registered + {{ else }} + {{ len .registeredAgents }} remote agent(s) registered: + {{- range $agent := .registeredAgents }} + + {{ $agent.DisplayName }}
+
+ + Last seen: {{ formatUnixTime $agent.LastSeenUnix }} ({{ formatUnixTimeSince $agent.LastSeenUnix }})
+
+ {{- end }} + {{ end }} +
+ {{- with .registeredAgentStatuses }} + {{- range $agentStatus := . }} + {{- with $agentStatus }} + + {{ .DisplayName }} + + + {{ if .FailureReason }} + Failure: {{ .FailureReason }} + {{ end }} + {{- if .MainSection }} + {{ range $key, $value := .MainSection -}} + {{ $key }}: {{ $value }}
+ {{ end }} + {{- end }} + + {{- if .NamedSections }} + {{- range $sectionName, $section := .NamedSections }} + {{ $sectionName }}:
+ + {{ end }} + {{- end }} +
+ {{- end }} + {{- end }} + {{- end -}} +