Compare commits

..

No commits in common. "7c6a4bf70ee675a9402f7961f16aaa13ac276492" and "067112ae2d5abe0659cc1e6143fb5b845c92e2cf" have entirely different histories.

2 changed files with 42 additions and 1 deletions

View File

@ -23,6 +23,7 @@ use crossterm::terminal::{
use ratatui::backend::{Backend, CrosstermBackend};
use ratatui::Terminal;
use std::error::Error;
use std::io::Write;
use std::io::{self, stderr};
fn main() -> Result<(), Box<dyn Error>> {
@ -38,7 +39,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let config = Config::from_file("test.ini".to_string());
// Run the app
let _res = run_app(&mut terminal, &mut app, &config);
let res = run_app(&mut terminal, &mut app, &config);
disable_raw_mode()?;
execute!(
@ -47,6 +48,33 @@ fn main() -> Result<(), Box<dyn Error>> {
DisableMouseCapture
)?;
terminal.show_cursor()?;
// Clear screen
// print!("{}[2J", 27 as char);
//
// loop {
// let mut domain = String::new();
// print!("Enter domain name: ");
// io::stdout().flush().expect("Failed to flush buffer");
// match io::stdin().read_line(&mut domain) {
// Ok(_n) => {
// domain = String::from(domain.trim());
// match domain.as_ref() {
// "q" => break,
// "" => continue,
// _ => {
// let mut dns = Domain::new(domain.clone());
// dns.apply_config(&config);
// dns.lookup_all_records();
// let whois = WhoisData::new(domain);
// println!("DNS: {}\n\n\nWhois: {}", dns, whois); // Replace this with fancy UI render update command
// }
// }
// }
// Err(err) => {
// println!("{}", err);
// }
// }
// }
Ok(())
}

View File

@ -51,6 +51,19 @@ pub fn ui(f: &mut Frame, app: &App) {
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)])
.split(chunks[1]);
// let whois_block = Block::default()
// .borders(Borders::RIGHT)
// .style(Style::default());
// let whois_text = Paragraph::new(Text::styled(
// "Whois data in
// style
// with
// multiline support",
// Style::default().fg(Color::Green),
// ))
// .block(whois_block);
// Whois list
let mut whois_list_items = Vec::<ListItem>::new();
for record in &app.whois_info {