Skip to content

firstbatchxyz/dnet-tui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnet-tui

A terminal user interface (TUI) application built with Rust for dnet.

Installation

Install using cargo:

cargo install --git https://github.com/firstbatchxyz/dnet-tui.git

You can install from source as well:

git clone https://github.com/firstbatchxyz/dnet-tui.git
cd dnet-tui
cargo build --release

Usage

Run the application:

dnet-tui

To run from source:

cargo run

Testing

Run unit tests with:

cargo test

We also have window-specific tests under tests folder.

Tip

To print logs, you can run the program with

cargo run 2> debug.log

Or, open another terminal and run the tty command, which returns something like /dev/pts/0. Then, forward to logs there:

cargo run 2> /dev/pts/0

Contributions

The code is structured so that all "windows" are thought of as their own modules, and they implement the required methods via impl App within their own file, with respect to visibility. Each window should also have a *View enum (for the sub-windows if required) and a *State struct that is an attribute of AppState.

Within each impl App we expect the following methods:

  • draw_* to handle drawing on screen (called via terminal.draw)
  • tick_* to handle ticks (effect within the running loop)
  • handle_* to handle inputs from the user

License

See the LICENSE file for details.

About

TUI for dnet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages