refactor: FrameData

This commit is contained in:
Jack Wills
2024-12-03 23:25:30 +00:00
parent 356ea5549b
commit 57781701ff
3 changed files with 28 additions and 19 deletions
+3 -3
View File
@@ -627,11 +627,11 @@ impl AppData {
}
/// Get mutable Vec of current containers logs
pub fn get_logs(&mut self) -> Vec<ListItem<'static>> {
pub fn get_logs(&self) -> Vec<ListItem<'static>> {
self.containers
.state
.selected()
.and_then(|i| self.containers.items.get_mut(i))
.and_then(|i| self.containers.items.get(i))
.map_or(vec![], |i| i.logs.to_vec())
}
@@ -1739,7 +1739,7 @@ mod tests {
assert_eq!(
app_data.get_filter(),
(FilterBy::All, Some(&"image_2".to_string()))
(FilterBy::All, Some(&"x".to_string()))
);
app_data.filter_containers();