(agent codersdk.WorkspaceAgent, index, totalAgents int, options WorkspaceResourcesOptions)
| 119 | } |
| 120 | |
| 121 | func 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 | |
| 146 | func renderListeningPorts(wro WorkspaceResourcesOptions, agentID uuid.UUID, idx, total int) []table.Row { |
| 147 | var rows []table.Row |
no test coverage detected