diff --git a/boot_diags/src/app.rs b/boot_diags/src/app.rs index 61ed244..dd995a3 100644 --- a/boot_diags/src/app.rs +++ b/boot_diags/src/app.rs @@ -236,7 +236,7 @@ impl App { // Late init self.system32 = if cfg!(windows) { if let Ok(path) = env::var("SYSTEMROOT") { - format!("{path}/System32") + format!("{path}\\System32") } else { self.action_tx.send(Action::Error(String::from( "ERROR\n\n\nFailed to find SYSTEMROOT", @@ -400,32 +400,21 @@ impl App { self.action_tx.send(build_right_items(self))?; self.action_tx.send(Action::Select(None, None))?; } - Action::TaskStart(ref task_type) => { + Action::TaskStart(ref title) => { if self.cur_mode == Mode::BootScan { - let title: Option = match task_type { - TaskType::CommandWait(cmd, _args) => { - let cmd_str = cmd.to_string_lossy().into_owned(); - let diag_type = diags::get_type(&cmd_str); - Some(format!("{diag_type}")) - } - TaskType::TestPaths(_) => Some(String::from("Critical Paths")), - _ => None, - }; - if let Some(title) = title { - info!("{:?}", self.task_groups.front()); - if self.task_groups.front().is_some() { - if self.task_groups.front().unwrap().is_some() { - // None here means that we're in the middle of a group of tasks - // i.e. don't start a new diag line - self.action_tx.send(Action::DiagStartLine { - text: title.clone(), - })?; - } - } - if !self.diag_groups.contains(&title) { - self.diag_groups.update(title, None, None); + info!("TaskGroup: {:?}", self.task_groups.front()); + if self.task_groups.front().is_some() { + if self.task_groups.front().unwrap().is_some() { + // None here means that we're in the middle of a group of tasks + // i.e. don't start a new diag line + self.action_tx.send(Action::DiagStartLine { + text: title.clone(), + })?; } } + if !self.diag_groups.contains(&title) { + self.diag_groups.update(title.to_owned(), None, None); + } } } Action::TasksComplete => { @@ -534,12 +523,12 @@ impl App { if passed { self.action_tx.send(Action::DiagEndLine { result: DiagResult::Pass, - text: String::from("Maybe?"), + text: String::from("Pass?"), })?; } else { self.action_tx.send(Action::DiagEndLine { result: DiagResult::Fail, - text: String::from("Nope?"), + text: String::from("Fail?"), })?; }; } @@ -548,14 +537,14 @@ impl App { // If title was set but there wasn't a result self.action_tx.send(Action::DiagEndLine { result: DiagResult::Warn, - text: String::from("Yellow result?"), + text: String::from("Yellow no result?"), })?; } } else { // title was not set self.action_tx.send(Action::DiagEndLine { result: DiagResult::Warn, - text: String::from("Yellow title?"), + text: String::from("Yellow no title?"), })?; } } @@ -910,6 +899,7 @@ fn build_left_items(app: &App) -> Action { let (new_title, _) = get_mode_strings(app.cur_mode); title = new_title; app.diag_groups.get().iter().for_each(|group| { + info!("BootDiags Group: {:?}", group); items.push(if group.passed { group.title.clone() } else { diff --git a/boot_diags/src/components/progress.rs b/boot_diags/src/components/progress.rs index 224fcbe..5719af6 100644 --- a/boot_diags/src/components/progress.rs +++ b/boot_diags/src/components/progress.rs @@ -85,7 +85,10 @@ impl Component for Progress { }); } Action::DiagEndLine { result, text } => { - info!("Caught Action::DiagEndLine"); + info!( + "Caught Action::DiagEndLine {{ {}, \"{}\" }}", + &result, &text + ); if let Some(line) = self.lines.last_mut() { line.result = result; line.text = text; diff --git a/boot_diags/src/diags.rs b/boot_diags/src/diags.rs index 6620261..1cc0641 100644 --- a/boot_diags/src/diags.rs +++ b/boot_diags/src/diags.rs @@ -79,7 +79,7 @@ impl Groups { title.clone(), Line { title, - passed: passed.unwrap_or(false), + passed: passed.unwrap_or(true), info: info_list, }, ); diff --git a/core/src/action.rs b/core/src/action.rs index 5fd0549..7c6aff9 100644 --- a/core/src/action.rs +++ b/core/src/action.rs @@ -44,7 +44,7 @@ pub enum Action { ScanDisks, Select(Option, Option), // indicies for (source, dest) etc SelectRight(Option, Option), // indicies for right info pane - TaskStart(TaskType), + TaskStart(String), TasksComplete, UpdateDiskList(Vec), UpdateFooter(String), diff --git a/core/src/tasks.rs b/core/src/tasks.rs index 5e2015e..386c370 100644 --- a/core/src/tasks.rs +++ b/core/src/tasks.rs @@ -173,8 +173,6 @@ impl Tasks { self.cur_task = self.task_list.pop_front(); if let Some(task) = self.cur_task.take() { let task_tx = self.task_tx.clone(); - self.action_tx - .send(Action::TaskStart(task.task_type.clone()))?; match task.task_type { TaskType::CommandNoWait(ref cmd_path, ref cmd_args) => { self.cur_handle = None; @@ -186,6 +184,8 @@ impl Tasks { cmd_args.clone(), task_tx, )); + self.action_tx + .send(Action::TaskStart(cmd_path.to_string_lossy().into_owned()))?; } TaskType::Diskpart(ref script) => { self.cur_handle = Some(run_task_diskpart(script, task_tx));