Skip to content

Commit

Permalink
adapt to breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neuronull committed Oct 23, 2023
1 parent bb8c09e commit 6b3c085
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/top/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crossterm::{
use num_format::{Locale, ToFormattedString};
use number_prefix::NumberPrefix;
use ratatui::{
backend::{Backend, CrosstermBackend},
backend::CrosstermBackend,
layout::{Alignment, Constraint, Layout, Rect},
style::{Color, Modifier, Style},
text::{Line, Span},
Expand Down Expand Up @@ -164,12 +164,7 @@ impl<'a> Widgets<'a> {
}

/// Renders a title and the URL the dashboard is currently connected to.
fn title<B: Backend>(
&'a self,
f: &mut Frame<B>,
area: Rect,
connection_status: &ConnectionStatus,
) {
fn title(&'a self, f: &mut Frame, area: Rect, connection_status: &ConnectionStatus) {
let mut text = vec![
Span::from(self.url_string),
Span::styled(
Expand All @@ -195,7 +190,7 @@ impl<'a> Widgets<'a> {

/// Renders a components table, showing sources, transforms and sinks in tabular form, with
/// statistics pulled from `ComponentsState`,
fn components_table<B: Backend>(&self, f: &mut Frame<B>, state: &state::State, area: Rect) {
fn components_table(&self, f: &mut Frame, state: &state::State, area: Rect) {
// Header columns
let header = HEADER
.iter()
Expand Down Expand Up @@ -301,7 +296,7 @@ impl<'a> Widgets<'a> {
}

/// Alerts the user to resize the window to view columns
fn components_resize_window<B: Backend>(&self, f: &mut Frame<B>, area: Rect) {
fn components_resize_window(&self, f: &mut Frame, area: Rect) {
let block = Block::default().borders(Borders::ALL).title("Components");
let w = Paragraph::new("Expand the window to > 80 chars to view metrics")
.block(block)
Expand All @@ -311,7 +306,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) {
fn quit_box(&self, f: &mut Frame, area: Rect) {
let text = vec![Line::from("To quit, press ESC or 'q'")];

let block = Block::default()
Expand All @@ -326,7 +321,7 @@ impl<'a> Widgets<'a> {
}

/// Draw a single frame. Creates a layout and renders widgets into it.
fn draw<B: Backend>(&self, f: &mut Frame<B>, state: state::State) {
fn draw(&self, f: &mut Frame, state: state::State) {
let size = f.size();
let rects = Layout::default()
.constraints(self.constraints.clone())
Expand Down

0 comments on commit 6b3c085

Please sign in to comment.