mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 05:34:57 +02:00
Added arrows to indicate process sorting direction
This commit is contained in:
parent
11f8b8ea2b
commit
72a3de98c2
@ -30,7 +30,7 @@ tokio = "0.2.0-alpha.4"
|
|||||||
winapi = "0.3.8"
|
winapi = "0.3.8"
|
||||||
|
|
||||||
[dependencies.tui-temp-fork]
|
[dependencies.tui-temp-fork]
|
||||||
#git = "https://github.com/ClementTsang/tui-rs"
|
git = "https://github.com/ClementTsang/tui-rs"
|
||||||
#path = "../tui-rs"
|
#path = "../tui-rs"
|
||||||
version = "0.6.4"
|
version = "0.6.4"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
4
TODO.md
4
TODO.md
@ -4,8 +4,6 @@ Note this will probably migrate to GitHub's native Issues; this was mostly for p
|
|||||||
|
|
||||||
- Rebalance cpu usage in process by using current value (it's currently just summing to 100%)
|
- Rebalance cpu usage in process by using current value (it's currently just summing to 100%)
|
||||||
|
|
||||||
- Scrolling support for temp/disk
|
|
||||||
|
|
||||||
- Travis
|
- Travis
|
||||||
|
|
||||||
- Refactoring! Please.
|
- Refactoring! Please.
|
||||||
@ -18,8 +16,6 @@ Note this will probably migrate to GitHub's native Issues; this was mostly for p
|
|||||||
|
|
||||||
- Mouse + key events conflict? Make it so that some events don't clog up the loop if they are not valid keys!
|
- Mouse + key events conflict? Make it so that some events don't clog up the loop if they are not valid keys!
|
||||||
|
|
||||||
- Header should be clear on current sorting direction!
|
|
||||||
|
|
||||||
- It would be maybe a good idea to see if we can run the process calculation across ALL cpus...? Might be more accurate.
|
- It would be maybe a good idea to see if we can run the process calculation across ALL cpus...? Might be more accurate.
|
||||||
|
|
||||||
- ~~Add custom error because it's really messy~~ Done, but need to implement across rest of app!
|
- ~~Add custom error because it's really messy~~ Done, but need to implement across rest of app!
|
||||||
|
@ -358,19 +358,41 @@ pub fn draw_data<B : backend::Backend>(terminal : &mut Terminal<B>, app_state :
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
Table::new(["PID", "Name", "CPU%", "Mem%"].iter(), process_rows)
|
{
|
||||||
.block(
|
use app::data_collection::processes::ProcessSorting;
|
||||||
Block::default()
|
let mut pid = "PID".to_string();
|
||||||
.title("Processes")
|
let mut name = "Name".to_string();
|
||||||
.borders(Borders::ALL)
|
let mut cpu = "CPU%".to_string();
|
||||||
.border_style(match app_state.current_application_position {
|
let mut mem = "Mem%".to_string();
|
||||||
app::ApplicationPosition::PROCESS => highlighted_border_style,
|
|
||||||
_ => border_style,
|
let direction_val = if app_state.process_sorting_reverse {
|
||||||
}),
|
" ⯆".to_string()
|
||||||
)
|
}
|
||||||
.header_style(Style::default().fg(Color::LightBlue))
|
else {
|
||||||
.widths(&[(width * 0.2) as u16, (width * 0.35) as u16, (width * 0.2) as u16, (width * 0.2) as u16])
|
" ⯅".to_string()
|
||||||
.render(&mut f, bottom_chunks[1]);
|
};
|
||||||
|
|
||||||
|
match app_state.process_sorting_type {
|
||||||
|
ProcessSorting::CPU => cpu += &direction_val,
|
||||||
|
ProcessSorting::MEM => mem += &direction_val,
|
||||||
|
ProcessSorting::PID => pid += &direction_val,
|
||||||
|
ProcessSorting::NAME => name += &direction_val,
|
||||||
|
};
|
||||||
|
|
||||||
|
Table::new([pid, name, cpu, mem].iter(), process_rows)
|
||||||
|
.block(
|
||||||
|
Block::default()
|
||||||
|
.title("Processes")
|
||||||
|
.borders(Borders::ALL)
|
||||||
|
.border_style(match app_state.current_application_position {
|
||||||
|
app::ApplicationPosition::PROCESS => highlighted_border_style,
|
||||||
|
_ => border_style,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.header_style(Style::default().fg(Color::LightBlue))
|
||||||
|
.widths(&[(width * 0.2) as u16, (width * 0.35) as u16, (width * 0.2) as u16, (width * 0.2) as u16])
|
||||||
|
.render(&mut f, bottom_chunks[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user