We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: drop_events not working
clashctl/src/ui/state.rs
Line 35 in 92076a0
use std::time::Instant; use smart_default::SmartDefault; use crate::{ model::{Traffic, Version}, ui::{ components::{MovableListItem, MovableListState, ProxyTree}, Action, Event, InputEvent, UpdateEvent, }, Result, }; #[derive(Debug, Clone, SmartDefault)] pub struct TuiStates<'a> { pub should_quit: bool, #[default(_code = "Instant::now()")] pub start_time: Instant, pub version: Option<Version>, pub traffics: Vec<Traffic>, pub max_traffic: Traffic, pub events: Vec<Event>, pub all_events_recv: usize, pub page_index: u8, pub show_debug: bool, pub proxy_tree: ProxyTree<'a>, pub debug_state: MovableListState<'a>, pub log_state: MovableListState<'a>, pub con_state: MovableListState<'a>, pub rule_state: MovableListState<'a>, // (upload_size, download_size) pub con_size: (u64, u64), } // TODO fix: drop_events not working impl<'a> TuiStates<'a> { pub const TITLES: &'static [&'static str] = &[ "Status", "Proxies", "Rules", "Conns", "Logs", "Configs", "Debug", ]; pub fn handle(&mut self, event: Event) -> Result<Option<Action>> { self.all_events_recv += 1; if self.events.len() >= 300 { drop(self.drop_events(100)) } self.events.push(event.to_owned()); self.debug_state
ffb00d81ab6e3f629970753180253134ca5908dc
The text was updated successfully, but these errors were encountered:
No branches or pull requests
fix: drop_events not working
clashctl/src/ui/state.rs
Line 35 in 92076a0
ffb00d81ab6e3f629970753180253134ca5908dc
The text was updated successfully, but these errors were encountered: