MCPcopy Index your code
hub / github.com/coder/coder / renderAgentRow

Function renderAgentRow

cli/cliui/resources.go:121–144  ·  view source on GitHub ↗
(agent codersdk.WorkspaceAgent, index, totalAgents int, options WorkspaceResourcesOptions)

Source from the content-addressed store, hash-verified

119}
120
121func renderAgentRow(agent codersdk.WorkspaceAgent, index, totalAgents int, options WorkspaceResourcesOptions) table.Row {
122 row := table.Row{
123 // These tree from a resource!
124 fmt.Sprintf("%s─ %s (%s, %s)", renderPipe(index, totalAgents), agent.Name, agent.OperatingSystem, agent.Architecture),
125 }
126 if !options.HideAgentState {
127 var agentStatus, agentHealth, agentVersion string
128 if !options.HideAgentState {
129 agentStatus = renderAgentStatus(agent)
130 agentHealth = renderAgentHealth(agent)
131 agentVersion = renderAgentVersion(agent.Version, options.ServerVersion)
132 }
133 row = append(row, agentStatus, agentHealth, agentVersion)
134 }
135 if !options.HideAccess {
136 sshCommand := "coder ssh " + options.WorkspaceName
137 if totalAgents > 1 || len(options.Devcontainers) > 0 {
138 sshCommand += "." + agent.Name
139 }
140 sshCommand = pretty.Sprint(DefaultStyles.Code, sshCommand)
141 row = append(row, sshCommand)
142 }
143 return row
144}
145
146func renderListeningPorts(wro WorkspaceResourcesOptions, agentID uuid.UUID, idx, total int) []table.Row {
147 var rows []table.Row

Callers 1

WorkspaceResourcesFunction · 0.85

Calls 4

renderPipeFunction · 0.85
renderAgentStatusFunction · 0.85
renderAgentHealthFunction · 0.85
renderAgentVersionFunction · 0.85

Tested by

no test coverage detected