-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
top: implement TUI #292
base: main
Are you sure you want to change the base?
top: implement TUI #292
Conversation
cool, that's very exciting! |
Thank you, and I'm available for the discussion of the data refresh flow. Until then, I'm working on the row scrolling using the up and down arrow keys. |
fn render_top_info() -> Vec<String> { | ||
let info = "top - 04:30:13 up 6:02, 3 users, load average: 0.40, 0.89, 1.24 | ||
Tasks: 260 total, 3 running, 257 sleeping, 0 stopped, 0 zombie | ||
%Cpu(s): 1.9 us, 0.3 sy, 0.0 ni, 97.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st | ||
MiB Mem : 3911.6 total, 190.6 free, 2549.1 used, 1171.9 buff/cache | ||
MiB Swap: 2048.0 total, 692.0 free, 1356.0 used. 1017.7 avail Mem"; | ||
|
||
info.lines().map(String::from).collect() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For refreshing, I think it can be done asynchronously? Like refreshing every 3 seconds in the background and then reading the refresh here? And all data can be refreshed in background too, I think this is the easiest way to implement it, via multithreading or smol(or tokio)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea! let me try this... will update the PR soon
Resolves #191
Changes Made:
To Do:
Screencast.2024-12-30.03.29.52.mp4