(opts *shared.ViewOptions, worker *machines.Worker)
| 116 | } |
| 117 | |
| 118 | func getWorkerAsBasic(opts *shared.ViewOptions, worker *machines.Worker) string { |
| 119 | var result strings.Builder |
| 120 | |
| 121 | result.WriteString(fmt.Sprintf("%s %s\n", output.Bold(worker.Name), output.Dimf("(%s)", worker.GetID()))) |
| 122 | result.WriteString(fmt.Sprintf("Health status: %s\n", getHealthStatusFormatted(worker.HealthStatus))) |
| 123 | result.WriteString(fmt.Sprintf("Current status: %s\n", worker.StatusSummary)) |
| 124 | result.WriteString(fmt.Sprintf("Communication style: %s\n", getWorkerTypeDisplayName(worker.Endpoint.GetCommunicationStyle()))) |
| 125 | |
| 126 | workerPoolMap, _ := shared.GetWorkerPoolMap(opts) |
| 127 | workerPoolNames := resolveValues(worker.WorkerPoolIDs, workerPoolMap) |
| 128 | result.WriteString(fmt.Sprintf("Worker Pools: %s\n", output.FormatAsList(workerPoolNames))) |
| 129 | |
| 130 | // Add endpoint-specific details |
| 131 | endpointDetails := getEndpointDetails(worker) |
| 132 | for key, value := range endpointDetails { |
| 133 | result.WriteString(fmt.Sprintf("%s: %s\n", key, value)) |
| 134 | } |
| 135 | |
| 136 | // Web URL |
| 137 | url := util.GenerateWebURL(opts.Host, worker.SpaceID, fmt.Sprintf("infrastructure/workers/%s/settings", worker.GetID())) |
| 138 | result.WriteString(fmt.Sprintf("\nView this worker in Octopus Deploy: %s\n", output.Blue(url))) |
| 139 | |
| 140 | return result.String() |
| 141 | } |
| 142 | |
| 143 | func getHealthStatusFormatted(status string) string { |
| 144 | switch status { |
no test coverage detected