From e16d319b72be180421c7035bb08b016b880c501e Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Tue, 18 Feb 2025 17:17:27 +0300 Subject: [PATCH] remove listen address from a default flow, navigation through hotkey Signed-off-by: Uncle Stretch --- Cargo.toml | 2 +- src/components/validator/mod.rs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e8c0b17..d82e535 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ghost-eye" authors = ["str3tch "] description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost" -version = "0.3.38" +version = "0.3.39" edition = "2021" [dependencies] diff --git a/src/components/validator/mod.rs b/src/components/validator/mod.rs index 5183d56..3490120 100644 --- a/src/components/validator/mod.rs +++ b/src/components/validator/mod.rs @@ -116,15 +116,15 @@ impl Validator { CurrentTab::Peers => self.current_tab = CurrentTab::Withdrawals, CurrentTab::Withdrawals => self.current_tab = CurrentTab::History, CurrentTab::History => self.current_tab = CurrentTab::NominatorsByValidator, - CurrentTab::NominatorsByValidator => self.current_tab = CurrentTab::ListenAddresses, + CurrentTab::ListenAddresses => self.current_tab = CurrentTab::NominatorsByValidator, _ => {} } } fn move_right(&mut self) { match self.current_tab { - CurrentTab::Nothing => self.current_tab = CurrentTab::ListenAddresses, CurrentTab::ListenAddresses => self.current_tab = CurrentTab::NominatorsByValidator, + CurrentTab::Nothing => self.current_tab = CurrentTab::NominatorsByValidator, CurrentTab::NominatorsByValidator => self.current_tab = CurrentTab::History, CurrentTab::History => self.current_tab = CurrentTab::Withdrawals, CurrentTab::Withdrawals => self.current_tab = CurrentTab::Peers, @@ -250,6 +250,13 @@ impl Component for Validator { component.set_active(self.current_tab.clone()); } }, + KeyCode::Char('L') => { + self.previous_tab = self.current_tab; + self.current_tab = CurrentTab::ListenAddresses; + for component in self.components.iter_mut() { + component.set_active(self.current_tab.clone()); + } + }, _ => { for component in self.components.iter_mut() { component.handle_key_event(key)?; @@ -264,7 +271,7 @@ impl Component for Validator { match action { Action::SetActiveScreen(Mode::Validator) => { self.is_active = true; - self.current_tab = CurrentTab::ListenAddresses; + self.current_tab = CurrentTab::NominatorsByValidator; } Action::PayoutValidatorPopup(_, _) => { self.previous_tab = self.current_tab;