updated the readme, and fixed the tui logic to display the running
operations progress better, also fixed a bug in project promotion where the project files path and notes path wasn't being added right.
This commit is contained in:
+37
-9
@@ -282,25 +282,53 @@ pub fn run_tui(
|
||||
.wrap(ratatui::widgets::Wrap { trim: false });
|
||||
f.render_widget(info_paragraph, progress_section[0]);
|
||||
let mut progress_lines = Vec::new();
|
||||
let mut color_differnt = false;
|
||||
state.progress_bars.iter().for_each(|progress| {
|
||||
if let Ok(status) = progress.read() {
|
||||
let percentage = status.complete / status.total * 100;
|
||||
if percentage == 100 {
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!("{}:)", status.name),
|
||||
Style::default().fg(Color::Green),
|
||||
)));
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!(
|
||||
"{} - {}/{} ({}%)",
|
||||
status.name, status.complete, status.total, percentage
|
||||
" {}/{} ({}%)",
|
||||
status.complete, status.total, percentage
|
||||
),
|
||||
Style::default().fg(Color::Green),
|
||||
)));
|
||||
} else {
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!(
|
||||
"{} - {}/{} ({}%)",
|
||||
status.name, status.complete, status.total, percentage
|
||||
),
|
||||
Style::default().fg(Color::Magenta),
|
||||
)));
|
||||
match color_differnt {
|
||||
true => {
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!("{}:)", status.name),
|
||||
Style::default().fg(Color::Cyan),
|
||||
)));
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!(
|
||||
" {}/{} ({}%)",
|
||||
status.complete, status.total, percentage
|
||||
),
|
||||
Style::default().fg(Color::Cyan),
|
||||
)));
|
||||
color_differnt = false;
|
||||
}
|
||||
false => {
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!("{}:)", status.name),
|
||||
Style::default().fg(Color::Magenta),
|
||||
)));
|
||||
progress_lines.push(Line::from(Span::styled(
|
||||
format!(
|
||||
" {}/{} ({}%)",
|
||||
status.complete, status.total, percentage
|
||||
),
|
||||
Style::default().fg(Color::Magenta),
|
||||
)));
|
||||
color_differnt = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user