mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-09-19 23:36:14 +00:00
tui improvements
This commit is contained in:
+2
-2
@@ -22,8 +22,8 @@ impl Store {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn entries(&self) -> Vec<Vec<Arc<FileMeta>>> {
|
pub fn entries(&self) -> Arc<DashMap<Index, Vec<Arc<FileMeta>>>> {
|
||||||
self.internal.iter().map(|k| k.value().clone()).collect()
|
self.internal.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add(&self, index: Index, file: Arc<FileMeta>) {
|
pub fn add(&self, index: Index, file: Arc<FileMeta>) {
|
||||||
|
|||||||
+8
-3
@@ -59,8 +59,13 @@ impl Tui {
|
|||||||
.dupstore
|
.dupstore
|
||||||
.entries()
|
.entries()
|
||||||
.iter()
|
.iter()
|
||||||
.flatten()
|
.flat_map(|val| {
|
||||||
.map(|f| ListItem::new(format!("{}", f.path)))
|
let mut group = vec![ListItem::new(format!("{:?}", val.key()))];
|
||||||
|
val.value().iter().for_each(|f| {
|
||||||
|
group.push(ListItem::new(format!("|-{}", f.path)));
|
||||||
|
});
|
||||||
|
group
|
||||||
|
})
|
||||||
.collect::<Vec<ListItem>>();
|
.collect::<Vec<ListItem>>();
|
||||||
|
|
||||||
let list = List::new(listitems.clone());
|
let list = List::new(listitems.clone());
|
||||||
@@ -75,7 +80,7 @@ impl Tui {
|
|||||||
);
|
);
|
||||||
|
|
||||||
frame.render_widget(
|
frame.render_widget(
|
||||||
Paragraph::new(format!("{:#?}", listitems)).block(Block::new().borders(Borders::ALL)),
|
Paragraph::new(String::new()).block(Block::new().borders(Borders::ALL)),
|
||||||
layout_chunks[1],
|
layout_chunks[1],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user