Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions comp/core/remoteagentregistry/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<div class="stat">
<span class="stat_title">Remote Agents</span>
<span class="stat_data">
{{ if not .registeredAgents }}
No remote agents registered
{{ else }}
{{ len .registeredAgents }} remote agent(s) registered:
{{- range $agent := .registeredAgents }}
<span class="stat_subtitle">
{{ $agent.DisplayName }} <br>
</span>
<span class="stat_subdata">
Last seen: {{ formatUnixTime $agent.LastSeenUnix }} ({{ formatUnixTimeSince $agent.LastSeenUnix }}) <br>
</span>
{{- end }}
{{ end }}
</span>
{{- with .registeredAgentStatuses }}
{{- range $agentStatus := . }}
{{- with $agentStatus }}
<span class="stat_title">
{{ .DisplayName }}
</span>
<span class="stat_subdata">
{{ if .FailureReason }}
Failure: {{ .FailureReason }}
{{ end }}
{{- if .MainSection }}
{{ range $key, $value := .MainSection -}}
{{ $key }}: {{ $value }} <br>
{{ end }}
{{- end }}

{{- if .NamedSections }}
{{- range $sectionName, $section := .NamedSections }}
{{ $sectionName }}: <br>
<ul>
{{- range $key, $value := $section }}
<li> {{ $key }}: {{ $value }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML list item tag is missing its closing tag. Please update this line to:

<li> {{ $key }}: {{ $value }}</li>

This ensures proper HTML structure and prevents potential rendering issues in browsers that strictly enforce HTML syntax.

Suggested change
<li> {{ $key }}: {{ $value }}
<li> {{ $key }}: {{ $value }}</li>

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

{{- end }}
</ul>
{{ end }}
{{- end }}
</span>
{{- end }}
{{- end }}
{{- end -}}
</div>