wsup 0.1.6

A beautiful TUI localhost process manager with real-time graphs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub const LOGO_LINES: [&str; 6] = [
    "__      _____ _   _ _ __  ",
    "\\ \\ /\\ / / __| | | | '_ \\ ",
    " \\ V  V /\\__ \\ |_| | |_) |",
    "  \\_/\\_/ |___/\\__,_| .__/ ",
    "                   | |    ",
    "                   |_|    ",
];

pub fn formatMemory(bytes: u64) -> String {
    let kb = bytes / 1024;
    let mb = kb / 1024;
    if mb > 0 {
        format!("{}M", mb)
    } else {
        format!("{}K", kb)
    }
}