index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff

Diffstat (limited to 'src/ui/table.rs')

-rw-r--r-- src/ui/table.rs 14
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/ui/table.rs b/src/ui/table.rs
index 7950d4d..04ebebb 100644
--- a/src/ui/table.rs
+++ b/src/ui/table.rs
@@ -23,7 +23,7 @@
        Style::new()
    };
    let row_style = if is_active {
        Style::new().on_blue().black()
        Style::new().on_dark_gray()
    } else {
        Style::new()
    };
@@ -124,6 +124,7 @@
    );
}

// TODO: make constraint long as it need
pub fn draw_available_network(
    f: &mut Frame<'_>,
    body_chunks: &Rc<[Rect]>,
@@ -137,7 +138,15 @@
        .map(|net| -> Row<'_> {
            Row::new(vec![
                Cell::from(net.ssid.clone()),
                Cell::from(if net.secured { "Secured" } else { "Open" }),
                Cell::from(if net.is_psk {
                    "psk"
                } else if net.is_eap {
                    "Enterprise"
                } else if !net.secured {
                    "Open"
                } else {
                    "Unknown"
                }),
                Cell::from(format!("{}%", net.strength.unwrap_or(0))),
            ])
        })
@@ -160,6 +169,7 @@
    );
}

// TODO: Add cells
pub fn draw_devices(f: &mut Frame<'_>, body_chunks: &Rc<[Rect]>, app: &mut App, active_tab: &Tabs) {
    let rows: Vec<Row> = app
        .devices