** RatatuiUi **

displays a preset list of hosts and their response state

Updates format of input file to CSV with <host ip>,<host name> as the format.
UI now has red/green for down/up hosts
duration_to_string now in lib
improves display of how long ago change happened
log events are now displayed on the monitoring page to show when a host comes up/goes down
Modularize ui better
Adds ability to return to monitoring or quit from editing page
table in place for displaying hosts

WIP: start of being able to go up/down through the list of hosts to eventually edit them.
This commit is contained in:
2025-04-23 13:21:56 -04:00
parent 6d55d96ca7
commit 7d830c4e3b
17 changed files with 890 additions and 11 deletions
+4 -8
View File
@@ -17,6 +17,8 @@ use std::{env, error::Error, ffi::OsString, process};
use color_eyre::owo_colors::OwoColorize;
use crossterm::style::Stylize;
use log::debug;
use pp::app_settings::AppSettings;
const SECONDS_IN_MINUTE: u32 = 60;
const SECONDS_IN_HOUR: u32 = SECONDS_IN_MINUTE * 60;
const SECONDS_IN_DAY: u32 = SECONDS_IN_HOUR * 24;
@@ -117,7 +119,7 @@ impl PPState {
}
pub fn build_targets_from_file(filename: Option<PathBuf>) -> BTreeMap<String, TargetState> {
PPState::get_default_targets();
// PPState::get_default_targets();
if let Some(file) = filename {
let mut working = BTreeMap::new();
if !&file.exists() {
@@ -155,13 +157,7 @@ impl PPState {
}
/// Simple program to greet a person
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct AppSettings {
/// File of list of hosts
#[arg(short, long)]
ping_host_file: Option<PathBuf>,
}
fn main() {
// Get App Settings