mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-08-26 02:04:39 +00:00
tui improvements
This commit is contained in:
@@ -22,8 +22,8 @@ impl Store {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn entries(&self) -> Vec<Vec<Arc<FileMeta>>> {
|
||||
self.internal.iter().map(|k| k.value().clone()).collect()
|
||||
pub fn entries(&self) -> Arc<DashMap<Index, Vec<Arc<FileMeta>>>> {
|
||||
self.internal.clone()
|
||||
}
|
||||
|
||||
pub fn add(&self, index: Index, file: Arc<FileMeta>) {
|
||||
|
||||
@@ -59,8 +59,13 @@ impl Tui {
|
||||
.dupstore
|
||||
.entries()
|
||||
.iter()
|
||||
.flatten()
|
||||
.map(|f| ListItem::new(format!("{}", f.path)))
|
||||
.flat_map(|val| {
|
||||
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>>();
|
||||
|
||||
let list = List::new(listitems.clone());
|
||||
@@ -75,7 +80,7 @@ impl Tui {
|
||||
);
|
||||
|
||||
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],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user