Skip to content

Commit

Permalink
move from tui-rs to Ratatui (#437)
Browse files Browse the repository at this point in the history
This moves us to the same version that we use in Omicron.
  • Loading branch information
bcantrill authored Jan 3, 2024
1 parent 4f3eb2c commit 121f57c
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 40 deletions.
123 changes: 93 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ postcard = "0.7.0"
proc-macro2 = "1.0"
quote = "1.0"
rand = "0.8"
ratatui = "0.23.0"
raw-cpuid = { version = "11.0.0", features = ["display"] }
rayon = "1.7"
reedline = "0.11.0"
Expand All @@ -259,7 +260,6 @@ termios = "0.3" # not usable on windows!
thiserror = "1.0"
toml = "0.5"
trycmd = "0.13.2"
tui = { version = "0.16", default-features = false }
winapi = "0.3.9"
zerocopy = "0.6.1"
zip = "0.6.4"
Expand Down
2 changes: 1 addition & 1 deletion cmd/dashboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ anyhow.workspace = true
parse_int.workspace = true
idol.workspace = true
crossterm.workspace = true
tui = { workspace = true, features = ["crossterm"] }
ratatui.workspace = true

humility.workspace = true
humility-cmd.workspace = true
Expand Down
16 changes: 8 additions & 8 deletions cmd/dashboard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ use humility_cli::{ExecutionContext, Subcommand};
use humility_cmd::{Archive, Attach, Command, CommandKind, Validate};
use humility_hiffy::*;
use humility_idol::{self as idol, HubrisIdol};
use std::fs::File;
use std::io;
use std::io::Write;
use std::time::{Duration, Instant};
use tui::{
use ratatui::{
backend::{Backend, CrosstermBackend},
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Color, Modifier, Style},
symbols,
text::{Span, Spans},
text::{Line, Span},
widgets::{
Axis, Block, Borders, Chart, Dataset, List, ListItem, ListState,
Paragraph,
},
Frame, Terminal,
};
use std::fs::File;
use std::io;
use std::io::Write;
use std::time::{Duration, Instant};

#[derive(Parser, Debug)]
#[clap(name = "dashboard", about = env!("CARGO_PKG_DESCRIPTION"))]
Expand Down Expand Up @@ -1007,7 +1007,7 @@ fn draw_graph<B: Backend>(f: &mut Frame<B>, parent: Rect, graph: &mut Graph) {
Some(Some(val)) => graph.attributes.legend_value((*val).into()),
};

rows.push(ListItem::new(Spans::from(vec![
rows.push(ListItem::new(Line::from(vec![
Span::styled(
format!("{:<20}", s.name),
Style::default().fg(s.color),
Expand Down Expand Up @@ -1082,7 +1082,7 @@ fn draw_status<B: Backend>(
}
}

let text = vec![Spans::from(bar)];
let text = vec![Line::from(bar)];

let para = Paragraph::new(text)
.alignment(Alignment::Right)
Expand Down

0 comments on commit 121f57c

Please sign in to comment.