Skip to content

Commit

Permalink
chore: assign optional deps to web_dashboard feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mcharytoniuk committed Nov 22, 2024
1 parent a5b17b2 commit cdf122c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ env_logger = "0.11.5"
futures = "0.3.31"
futures-util = { version = "0.3.31", features = ["tokio-io"] }
log = "0.4.22"
mime_guess = "2.0.5"
mime_guess = { version = "2.0.5", optional = true }
pingora = { version = "0.4.0", features = ["proxy"] }
ratatui = { version = "0.29.0", optional = true }
reqwest = { version = "0.12.9", features = ["json", "stream"] }
rust-embed = "8.5.0"
rust-embed = { version = "8.5.0", optional = true }
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.132"
thiserror = "2.0.3"
Expand All @@ -34,7 +34,7 @@ url = { version = "2.5.3", features = ["serde"] }
uuid = { version = "1.11.0", features = ["serde", "v4"] }

[features]
default = ["statsd_reporter"]
default = ["ratatui_dashboard", "statsd_reporter"]
ratatui_dashboard = ["dep:crossterm", "dep:ratatui"]
statsd_reporter = ["dep:cadence"]
web_dashboard = []
web_dashboard = ["dep:mime_guess", "dep:rust-embed"]
9 changes: 4 additions & 5 deletions src/cmd/dashboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ pub mod tui;

async fn ratatui_main(management_addr: &SocketAddr) -> Result<()> {
let mut app = App::new(management_addr);

let backend = CrosstermBackend::new(io::stdout());
let terminal = Terminal::new(backend)?;

let mut ticker = interval(Duration::from_millis(100));
let mut tui = Tui::new(terminal);

ticker.set_missed_tick_behavior(MissedTickBehavior::Delay);

let mut reader = EventStream::new();

let backend = CrosstermBackend::new(io::stdout());
let terminal = Terminal::new(backend)?;
let mut tui = Tui::new(terminal);

tui.init()?;

while app.running {
Expand Down

0 comments on commit cdf122c

Please sign in to comment.