From 05d774d23b83f16f46a86693296e7b4678d645ca Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 21 Jun 2023 14:56:21 -0400 Subject: [PATCH] log cleanup --- veilid-cli/src/ui.rs | 22 +++++++++++++++---- .../src/network_manager/network_connection.rs | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/veilid-cli/src/ui.rs b/veilid-cli/src/ui.rs index 8ea3ab9e..24fcc803 100644 --- a/veilid-cli/src/ui.rs +++ b/veilid-cli/src/ui.rs @@ -8,6 +8,7 @@ use cursive::event::*; use cursive::theme::*; use cursive::traits::*; use cursive::utils::markup::StyledString; +use cursive::view::SizeConstraint; use cursive::views::*; use cursive::Cursive; use cursive::CursiveRunnable; @@ -504,6 +505,16 @@ impl UI { } } + fn on_focus_peers_table_view(ptv: &mut ResizedView) -> EventResult { + ptv.set_height(SizeConstraint::Full); + EventResult::Ignored + } + + fn on_focus_lost_peers_table_view(ptv: &mut ResizedView) -> EventResult { + ptv.set_height(SizeConstraint::AtLeast(8)); + EventResult::Ignored + } + fn show_connection_dialog(s: &mut Cursive, state: ConnectionState) -> bool { let mut inner = Self::inner_mut(s); @@ -829,10 +840,13 @@ impl UI { .column(PeerTableColumn::TransferDownAvg, "Down", |c| c.width(8)) .column(PeerTableColumn::TransferUpAvg, "Up", |c| c.width(8)); peers_table_view.set_on_submit(UI::on_submit_peers_table_view); - let peers_table_view = peers_table_view - .with_name("peers") - .full_width() - .min_height(8); + let peers_table_view = FocusTracker::new(ResizedView::new( + SizeConstraint::Full, + SizeConstraint::AtLeast(8), + peers_table_view.with_name("peers"), + )) + .on_focus(UI::on_focus_peers_table_view) + .on_focus_lost(UI::on_focus_lost_peers_table_view); // attempt at using Mux. Mux has bugs, like resizing problems. // let mut mux = Mux::new(); diff --git a/veilid-core/src/network_manager/network_connection.rs b/veilid-core/src/network_manager/network_connection.rs index 6c832c42..dfd2e326 100644 --- a/veilid-core/src/network_manager/network_connection.rs +++ b/veilid-core/src/network_manager/network_connection.rs @@ -179,7 +179,7 @@ impl NetworkConnection { } } - #[instrument(level="trace", skip(message, stats), fields(message.len = message.len()), ret, err)] + #[instrument(level="trace", skip(message, stats), fields(message.len = message.len()), ret)] async fn send_internal( protocol_connection: &ProtocolNetworkConnection, stats: Arc>, @@ -194,7 +194,7 @@ impl NetworkConnection { Ok(NetworkResult::Value(out)) } - #[instrument(level="trace", skip(stats), fields(ret.len), err)] + #[instrument(level="trace", skip(stats), fields(ret.len))] async fn recv_internal( protocol_connection: &ProtocolNetworkConnection, stats: Arc>,