46 lines
894 B
Rust
46 lines
894 B
Rust
use ratatui::widgets::ListState;
|
|
|
|
use crate::config::*;
|
|
use crate::logger::*;
|
|
|
|
pub enum AppRenderDir {
|
|
Vertical,
|
|
Horizontal,
|
|
}
|
|
|
|
pub enum MenuState {
|
|
Main,
|
|
List,
|
|
}
|
|
|
|
pub enum CurrentState {
|
|
Lookup,
|
|
Menu,
|
|
}
|
|
|
|
pub struct App {
|
|
pub domain_input: String,
|
|
pub whois_info: Vec<String>,
|
|
pub dns_info: Vec<String>,
|
|
pub render_direction: AppRenderDir,
|
|
pub current_state: CurrentState,
|
|
pub menu_state: MenuState,
|
|
pub config: Config,
|
|
pub state: ListState,
|
|
}
|
|
|
|
impl App {
|
|
pub fn new() -> App {
|
|
App {
|
|
domain_input: String::new(),
|
|
whois_info: vec![],
|
|
dns_info: vec![],
|
|
render_direction: AppRenderDir::Vertical,
|
|
current_state: CurrentState::Lookup,
|
|
menu_state: MenuState::Main,
|
|
config: Config::load(),
|
|
state: ListState::default(),
|
|
}
|
|
}
|
|
}
|