Print the third title row: last sync and full sync timestamps, right-aligned in dim.
(
last_sync_at: u64,
last_full_sync_at: u64,
last_sync_duration_ms: u64,
inner_width: usize,
)
| 337 | |
| 338 | /// Print the third title row: last sync and full sync timestamps, right-aligned in dim. |
| 339 | fn print_sync_row( |
| 340 | last_sync_at: u64, |
| 341 | last_full_sync_at: u64, |
| 342 | last_sync_duration_ms: u64, |
| 343 | inner_width: usize, |
| 344 | ) { |
| 345 | let duration = format_duration_ms(last_sync_duration_ms); |
| 346 | let sync_part = if duration.is_empty() { |
| 347 | format!("Last sync {}", format_relative_time(last_sync_at)) |
| 348 | } else { |
| 349 | format!( |
| 350 | "Last sync {} ({})", |
| 351 | format_relative_time(last_sync_at), |
| 352 | duration |
| 353 | ) |
| 354 | }; |
| 355 | let sync_text = format!( |
| 356 | "{} Full sync {}", |
| 357 | sync_part, |
| 358 | format_relative_time(last_full_sync_at) |
| 359 | ); |
| 360 | let available = inner_width.saturating_sub(2); |
| 361 | let pad = available.saturating_sub(sync_text.len()); |
| 362 | println!("│ {}\x1b[2m{}\x1b[0m │", " ".repeat(pad), sync_text); |
| 363 | } |
| 364 | |
| 365 | fn print_branch_row(info: &BranchInfo, inner_width: usize) { |
| 366 | let mut text = format!("Branch: {}", info.branch); |
no test coverage detected