Compare commits

..

No commits in common. "a24a35aa519cfbdf823542995895aa71afa34245" and "0af68ca624c36c3b5d38df68cb9c953eba87bc2a" have entirely different histories.

7 changed files with 10 additions and 51 deletions

View File

@ -2,7 +2,7 @@
name = "ghost-eye"
authors = ["str3tch <stretch@ghostchain.io>"]
description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost"
version = "0.3.56"
version = "0.3.53"
edition = "2021"
homepage = "https://git.ghostchain.io/ghostchain"
repository = "https://git.ghostchain.io/ghostchain/ghost-eye"

View File

@ -36,7 +36,6 @@ pub enum Action {
ClosePopup,
RotateSessionKeys,
PayoutValidatorPopup(u32, bool),
WithdrawValidatorPopup,
BalanceRequest([u8; 32], bool),
BalanceResponse([u8; 32], Option<SystemAccount>),

View File

@ -183,10 +183,7 @@ impl PartialComponent for History {
fn set_active(&mut self, current_tab: CurrentTab) {
match current_tab {
CurrentTab::History => self.is_active = true,
_ => {
self.table_state.select(None);
self.is_active = false;
}
_ => self.is_active = false,
}
}
}
@ -256,19 +253,13 @@ impl Component for History {
era_index_text = era_index_text.add_modifier(Modifier::CROSSED_OUT);
slash_text = slash_text.add_modifier(Modifier::CROSSED_OUT);
reward_text = reward_text.add_modifier(Modifier::CROSSED_OUT);
Row::new(vec![
Cell::from(era_index_text),
Cell::from(slash_text),
Cell::from(reward_text),
]).style(self.palette.create_highlight_style())
} else {
Row::new(vec![
Cell::from(era_index_text),
Cell::from(slash_text),
Cell::from(reward_text),
])
}
Row::new(vec![
Cell::from(era_index_text),
Cell::from(slash_text),
Cell::from(reward_text),
])
}),
[
Constraint::Length(4),
@ -276,7 +267,7 @@ impl Component for History {
Constraint::Fill(1),
],
)
.highlight_style(self.palette.create_basic_style(true))
.highlight_style(self.palette.create_highlight_style())
.column_spacing(1)
.block(Block::bordered()
.border_style(border_style)

View File

@ -244,10 +244,6 @@ impl Component for Validator {
self.previous_tab = self.current_tab;
self.current_tab = CurrentTab::PayoutPopup;
}
Action::WithdrawValidatorPopup => {
self.previous_tab = self.current_tab;
self.current_tab = CurrentTab::WithdrawPopup;
},
Action::ClosePopup => self.current_tab = self.previous_tab,
_ => {},
}

View File

@ -112,7 +112,6 @@ impl Component for PayoutPopup {
}
Ok(())
}
fn handle_key_event(&mut self, key: KeyEvent) -> Result<Option<Action>> {
if self.is_active && key.kind == KeyEventKind::Press {
match key.code {

View File

@ -11,10 +11,9 @@ use ratatui::{
},
Frame
};
use tokio::sync::mpsc::UnboundedSender;
use super::{PartialComponent, Component, CurrentTab};
use crate::types::{ActionTarget, ActionLevel, UnlockChunk};
use crate::types::UnlockChunk;
use crate::{
action::Action,
config::Config,
@ -23,7 +22,6 @@ use crate::{
pub struct Withdrawals {
is_active: bool,
action_tx: Option<UnboundedSender<Action>>,
palette: StylePalette,
scroll_state: ScrollbarState,
table_state: TableState,
@ -45,7 +43,6 @@ impl Withdrawals {
pub fn new() -> Self {
Self {
is_active: false,
action_tx: None,
scroll_state: ScrollbarState::new(0),
table_state: TableState::new(),
palette: StylePalette::default(),
@ -55,21 +52,6 @@ impl Withdrawals {
}
}
fn try_open_popup(&mut self) {
if let Some(action_tx) = &self.action_tx {
if let Some(index) = self.table_state.selected() {
if index == 0 && self.unlockings[0].era > self.current_era {
let _ = action_tx.send(Action::WithdrawValidatorPopup);
} else {
let _ = action_tx.send(Action::EventLog(
"Nothing to be witdrawn yet on the selected unlocking".to_string(),
ActionLevel::Info,
ActionTarget::ValidatorLog));
}
}
}
}
fn first_row(&mut self) {
if self.unlockings.len() > 0 {
self.table_state.select(Some(0));
@ -161,11 +143,6 @@ impl PartialComponent for Withdrawals {
}
impl Component for Withdrawals {
fn register_action_handler(&mut self, tx: UnboundedSender<Action>) -> Result<()> {
self.action_tx = Some(tx);
Ok(())
}
fn register_config_handler(&mut self, config: Config) -> Result<()> {
if let Some(style) = config.styles.get(&crate::app::Mode::Validator) {
self.palette.with_normal_style(style.get("normal_style").copied());
@ -198,7 +175,6 @@ impl Component for Withdrawals {
KeyCode::Down | KeyCode::Char('j') => self.next_row(),
KeyCode::Char('g') => self.first_row(),
KeyCode::Char('G') => self.last_row(),
KeyCode::Enter => self.try_open_popup(),
_ => {},
};
}

View File

@ -2,7 +2,6 @@ use std::sync::mpsc::Sender;
use color_eyre::Result;
use ratatui::{
widgets::Clear,
layout::{Alignment, Constraint, Rect},
text::Text,
widgets::{Block, Cell, Row, Table},
@ -216,7 +215,6 @@ impl Component for CurrentValidatorDetails {
.title_style(self.palette.create_title_style(false))
.title("Validator details"));
frame.render_widget(Clear, place);
frame.render_widget(table, place);
}