refactor: app_data methods re-ordered & renamed

This commit is contained in:
Jack Wills
2023-01-29 01:52:38 +00:00
parent 690bd01ba1
commit c0bb5355d6
5 changed files with 226 additions and 218 deletions
+4 -5
View File
@@ -230,10 +230,10 @@ pub fn logs<B: Backend>(
let logs = app_data.lock().get_logs();
if logs.is_empty() {
let paragraph = Paragraph::new("no logs found")
.block(block())
.alignment(Alignment::Center);
f.render_widget(paragraph, area);
let paragraph = Paragraph::new("no logs found")
.block(block())
.alignment(Alignment::Center);
f.render_widget(paragraph, area);
} else {
let items = List::new(logs)
.block(block())
@@ -244,7 +244,6 @@ pub fn logs<B: Backend>(
if let Some(i) = app_data.lock().get_log_state() {
f.render_stateful_widget(items, area, i);
}
}
}
}
+2 -2
View File
@@ -60,7 +60,7 @@ pub async fn create_ui(
terminal.show_cursor()?;
if let Err(err) = res {
println!("{err}");
println!("error: {err}");
}
std::io::stdout().flush().unwrap_or(());
Ok(())
@@ -141,7 +141,7 @@ fn ui<B: Backend>(
let height = if height < 12 { height + 4 } else { 12 };
let column_widths = app_data.lock().get_width();
let has_containers = !app_data.lock().has_containers();
let has_containers = app_data.lock().get_container_len() > 0;
let has_error = app_data.lock().get_error();
let sorted_by = app_data.lock().get_sorted();