diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-22 19:12:29 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-22 19:12:29 +0300 |
| commit | 1c6397b1cddb288099ed212a5979732698bd72c2 (patch) | |
| tree | 0574b428903ea1ce106bc7ba36e213c0418aa9f4 /src/client/shell/endpoint_sidebar.rs | |
| parent | 7237703dc59102cf3097e833eb896b314007b548 (diff) | |
fix: reuse ssh authentication and add machine recovery commands (#4490)
* fix: reuse ssh authentication and add in-app mfa recovery
refs #3763
* refactor: move ssh recovery to machine cli
refs #3763
Diffstat (limited to 'src/client/shell/endpoint_sidebar.rs')
| -rw-r--r-- | src/client/shell/endpoint_sidebar.rs | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/src/client/shell/endpoint_sidebar.rs b/src/client/shell/endpoint_sidebar.rs index c4f701c3..96982487 100644 --- a/src/client/shell/endpoint_sidebar.rs +++ b/src/client/shell/endpoint_sidebar.rs @@ -90,12 +90,26 @@ pub(super) fn render_collapsed( palette.overlay0 }), ); + let mut status_badge = Rect::default(); if !endpoint.endpoint_id.is_local() { let (glyph, _, color) = endpoint_status_presentation(endpoint.status, palette); - put_right_text(buffer, rect, rect.y, glyph, Style::default().fg(color)); + let width = display_width(glyph).min(rect.width); + status_badge = Rect::new(rect.right().saturating_sub(width), rect.y, width, 1); + put_right_text( + buffer, + rect, + rect.y, + glyph, + state.machine_diagnostics.badge_style( + endpoint, + palette, + Style::default().fg(color), + ), + ); } hits.machines.push(MachineHit { rect, + status_badge, collapse_toggle: Rect::new(rect.x, rect.y, u16::from(rect.width > 1), 1), endpoint_id: endpoint.endpoint_id.clone(), }); @@ -394,16 +408,18 @@ pub(super) fn render_expanded( let rect = Rect::new(body.x, y, content_width, 1); let collapsed = state.collapsed_endpoints.contains(&endpoint.endpoint_id); let marker = if collapsed { "▸" } else { "▾" }; - render_endpoint_row( + let status_badge = render_endpoint_row( buffer, rect, marker, endpoint, collapsed && &endpoint.endpoint_id == state.active_endpoint_id, + state.machine_diagnostics, palette, ); hits.machines.push(MachineHit { rect, + status_badge, collapse_toggle: Rect::new( rect.x.saturating_add(1), rect.y, @@ -577,8 +593,9 @@ fn render_endpoint_row( marker: &str, endpoint: &ClientShellEndpoint, highlighted: bool, + auth: &super::machine_diagnostics::MachineDiagnostics, palette: &Palette, -) { +) -> Rect { if highlighted { buffer.set_style(rect, Style::default().bg(palette.active_row_bg)); } @@ -588,7 +605,11 @@ fn render_endpoint_row( } else { state }; - let signal = if endpoint.endpoint_id.is_local() { + let signal = if auth.required_for(endpoint) { + "! auth".to_owned() + } else if endpoint.status == ClientEndpointStatus::Attention { + "! error".to_owned() + } else if endpoint.endpoint_id.is_local() { String::new() } else if state.is_empty() { glyph.to_owned() @@ -612,5 +633,17 @@ fn render_endpoint_row( ) .add_modifier(Modifier::BOLD), ); - put_right_text(buffer, rect, rect.y, &signal, Style::default().fg(color)); + put_right_text( + buffer, + rect, + rect.y, + &signal, + auth.badge_style(endpoint, palette, Style::default().fg(color)), + ); + Rect::new( + rect.right().saturating_sub(signal_width), + rect.y, + signal_width, + 1, + ) } |
