Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

top: implement TUI#292

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
r3yc0n1c wants to merge1 commit intouutils:main
base:main
Choose a base branch
Loading
fromr3yc0n1c:tui_for_top
Open

Conversation

r3yc0n1c
Copy link

@r3yc0n1cr3yc0n1c commentedDec 30, 2024
edited
Loading

Resolves#191

Changes Made:

  • Dynamically pulled all other data from the main top.rs file
  • Added an exit feature by pressing 'q'
  • Implemented a static top block (pending implementation in top.rs)

To Do:

  • Implement data refresh functionality for the table and the top block
Screencast.2024-12-30.03.29.52.mp4

@Krysztal112233
Copy link
Collaborator

cool, that's very exciting!

r3yc0n1c reacted with heart emoji

@Krysztal112233Krysztal112233 changed the titlefeat: tui for top commandtop: implement TUIDec 30, 2024
@r3yc0n1c
Copy link
Author

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.

Comment on lines +35 to +43
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()
}
Copy link
Collaborator

@Krysztal112233Krysztal112233Dec 31, 2024
edited
Loading

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)?

Copy link
Author

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

Krysztal112233 reacted with thumbs up emoji
@sylvestre
Copy link
Contributor

please fix the tests :)

@r3yc0n1c
Copy link
Author

working on it :p

@BluemangooBluemangoo mentioned this pull requestMar 11, 2025
7 tasks
@Krysztal112233
Copy link
Collaborator

Hi@r3yc0n1c ,the pr#306 has been merged, you can continue your contribute :)

@r3yc0n1c
Copy link
Author

hi, i'll start working on it ASAP

Krysztal112233 reacted with hooray emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Krysztal112233Krysztal112233Krysztal112233 left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add TUI for commandtop
3 participants
@r3yc0n1c@Krysztal112233@sylvestre

[8]ページ先頭

©2009-2025 Movatter.jp