(&self, workers: Vec<WorkerInfo>)
| 226 | |
| 227 | impl Output for CliOutput { |
| 228 | fn print_worker_list(&self, workers: Vec<WorkerInfo>) { |
| 229 | let rows: Vec<_> = workers |
| 230 | .into_iter() |
| 231 | .map(|worker| { |
| 232 | let manager_info = worker.configuration.get_manager_info(); |
| 233 | vec![ |
| 234 | worker.id.cell().justify(Justify::Right), |
| 235 | worker_status(&worker), |
| 236 | worker.configuration.hostname.cell(), |
| 237 | resources_summary(&worker.configuration.resources, false).cell(), |
| 238 | manager_info |
| 239 | .as_ref() |
| 240 | .map(|info| info.manager.to_string()) |
| 241 | .unwrap_or_else(|| "None".to_string()) |
| 242 | .cell(), |
| 243 | manager_info |
| 244 | .as_ref() |
| 245 | .map(|info| info.allocation_id.as_str()) |
| 246 | .unwrap_or("N/A") |
| 247 | .to_string() |
| 248 | .cell(), |
| 249 | ] |
| 250 | }) |
| 251 | .collect(); |
| 252 | |
| 253 | let header = vec![ |
| 254 | "ID".cell(), |
| 255 | "State".cell().bold(true), |
| 256 | "Hostname".cell().bold(true), |
| 257 | "Resources".cell().bold(true), |
| 258 | "Manager".cell().bold(true), |
| 259 | "Manager Job ID".cell().bold(true), |
| 260 | ]; |
| 261 | self.print_horizontal_table(rows, header); |
| 262 | } |
| 263 | |
| 264 | fn print_worker_info(&self, workers: Vec<WorkerInfo>) { |
| 265 | for (i, worker_info) in workers.into_iter().enumerate() { |
no test coverage detected