fix: Mark child sections as Completed when all items inside are completed
This commit is contained in:
parent
20b5755c4c
commit
021080d763
2 changed files with 11 additions and 1 deletions
|
|
@ -701,6 +701,16 @@ impl AppGenerator {
|
|||
item.duration_seconds = Some((Utc::now() - started).num_seconds() as u64);
|
||||
}
|
||||
child.current_step += 1;
|
||||
|
||||
// Check if all items in child are completed, then mark child as completed
|
||||
let all_completed = child.items.iter().all(|i| i.status == crate::auto_task::ItemStatus::Completed);
|
||||
if all_completed && !child.items.is_empty() {
|
||||
child.status = SectionStatus::Completed;
|
||||
child.completed_at = Some(Utc::now());
|
||||
if let Some(started) = child.started_at {
|
||||
child.duration_seconds = Some((Utc::now() - started).num_seconds() as u64);
|
||||
}
|
||||
}
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -922,7 +922,7 @@ fn build_progress_log_from_web_json(manifest: &serde_json::Value) -> String {
|
|||
html
|
||||
}
|
||||
|
||||
fn build_status_section_html(manifest: &TaskManifest, title: &str, runtime: &str) -> String {
|
||||
fn build_status_section_html(manifest: &TaskManifest, _title: &str, runtime: &str) -> String {
|
||||
let mut html = String::new();
|
||||
|
||||
let current_action = manifest.current_status.current_action.as_deref().unwrap_or("Processing...");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue