Skip to content

Commit

Permalink
chore(deps): Swap tui crate for ratatui (vectordotdev#18225)
Browse files Browse the repository at this point in the history
* chore(deps): Swap tui crate for ratatui

The `tui` crate is unmaintained and points to `ratatui` as the mantained fork.

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* Spelling

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* Regenerate license file

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

---------

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
  • Loading branch information
jszwedko authored Aug 11, 2023
1 parent 8bbe6a6 commit 8838faf
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 43 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ qwe
raboof
rande
RANDFILE
ratatui
rawconfig
rawstring
rdkafka
Expand Down
48 changes: 17 additions & 31 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ itertools = { version = "0.11.0", default-features = false, optional = true }
crossterm = { version = "0.26.1", default-features = false, features = ["event-stream"], optional = true }
num-format = { version = "0.4.4", default-features = false, features = ["with-num-bigint"], optional = true }
number_prefix = { version = "0.4.0", default-features = false, features = ["std"], optional = true }
tui = { version = "0.19.0", optional = true, default-features = false, features = ["crossterm"] }
ratatui = { version = "0.22.0", optional = true, default-features = false, features = ["crossterm"] }

# Datadog Pipelines

Expand Down Expand Up @@ -443,7 +443,7 @@ api-client = [
"dep:crossterm",
"dep:num-format",
"dep:number_prefix",
"dep:tui",
"dep:ratatui",
"vector-core/api",
"dep:vector-api-client",
]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ rand_chacha,https://github.com/rust-random/rand,MIT OR Apache-2.0,"The Rand Proj
rand_distr,https://github.com/rust-random/rand,MIT OR Apache-2.0,The Rand Project Developers
rand_hc,https://github.com/rust-random/rand,MIT OR Apache-2.0,The Rand Project Developers
rand_xorshift,https://github.com/rust-random/rngs,MIT OR Apache-2.0,"The Rand Project Developers, The Rust Project Developers"
ratatui,https://github.com/tui-rs-revival/ratatui,MIT,"Florian Dehau <work@fdehau.com>, The Ratatui Developers"
raw-cpuid,https://github.com/gz/rust-cpuid,MIT,Gerd Zellweger <mail@gerdzellweger.com>
raw-window-handle,https://github.com/rust-windowing/raw-window-handle,MIT OR Apache-2.0 OR Zlib,Osspial <osspial@gmail.com>
rdkafka,https://github.com/fede1024/rust-rdkafka,MIT,Federico Giraud <giraud.federico@gmail.com>
Expand Down Expand Up @@ -568,7 +569,6 @@ treediff,https://github.com/Byron/treediff-rs,MIT OR Apache-2.0,Sebastian Thiel
trust-dns-proto,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
trust-dns-resolver,https://github.com/bluejekyll/trust-dns,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur <sean@seanmonstar.com>
tui,https://github.com/fdehau/tui-rs,MIT,Florian Dehau <work@fdehau.com>
tungstenite,https://github.com/snapview/tungstenite-rs,MIT OR Apache-2.0,"Alexey Galakhov, Daniel Abramov"
twox-hash,https://github.com/shepmaster/twox-hash,MIT,Jake Goulding <jake.goulding@gmail.com>
typed-builder,https://github.com/idanarye/rust-typed-builder,MIT OR Apache-2.0,"IdanArye <idanarye@gmail.com>, Chris Morgan <me@chrismorgan.info>"
Expand Down
14 changes: 7 additions & 7 deletions src/top/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ use crossterm::{
};
use num_format::{Locale, ToFormattedString};
use number_prefix::NumberPrefix;
use std::io::stdout;
use tokio::sync::oneshot;
use tui::{
use ratatui::{
backend::{Backend, CrosstermBackend},
layout::{Alignment, Constraint, Layout, Rect},
style::{Color, Modifier, Style},
text::{Span, Spans},
text::{Line, Span},
widgets::{Block, Borders, Cell, Paragraph, Row, Table, Wrap},
Frame, Terminal,
};
use std::io::stdout;
use tokio::sync::oneshot;

use super::{
events::capture_key_press,
Expand Down Expand Up @@ -180,7 +180,7 @@ impl<'a> Widgets<'a> {
];
text.extend(connection_status.as_ui_spans());

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

let block = Block::default().borders(Borders::ALL).title(Span::styled(
self.title,
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<'a> Widgets<'a> {
.into_iter()
.map(Cell::from)
.collect::<Vec<_>>();
data[1] = Cell::from(id.as_ref());
data[1] = Cell::from(id.as_str());
data[5] = Cell::from(sent_events_metric);
items.push(Row::new(data).style(Style::default()));
}
Expand Down Expand Up @@ -312,7 +312,7 @@ impl<'a> Widgets<'a> {

/// Renders a box showing instructions on how to exit from `vector top`.
fn quit_box<B: Backend>(&self, f: &mut Frame<B>, area: Rect) {
let text = vec![Spans::from("To quit, press ESC or 'q'")];
let text = vec![Line::from("To quit, press ESC or 'q'")];

let block = Block::default()
.borders(Borders::ALL)
Expand Down
4 changes: 2 additions & 2 deletions src/top/state.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::collections::{BTreeMap, HashMap};

use chrono::{DateTime, Local};
use tokio::sync::mpsc;
use tui::{
use ratatui::{
style::{Color, Style},
text::Span,
};
use tokio::sync::mpsc;
use vector_core::internal_event::DEFAULT_OUTPUT;

use crate::config::ComponentKey;
Expand Down

0 comments on commit 8838faf

Please sign in to comment.