|
@@ -36,37 +36,10 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
|
|
|
|
|
|
|
|
f.render_stateful_widget(nodes, slice[0], &mut app.node_list.state);
|
|
f.render_stateful_widget(nodes, slice[0], &mut app.node_list.state);
|
|
|
|
|
|
|
|
- // TODO render node info as box
|
|
|
|
|
- //let node_info: Vec<ListItem> = app
|
|
|
|
|
- // .node_list
|
|
|
|
|
- // .node_info
|
|
|
|
|
- // .info
|
|
|
|
|
- // .iter()
|
|
|
|
|
- // .map(|i| {
|
|
|
|
|
- // let line1 = Spans::from(i.to_string());
|
|
|
|
|
- // ListItem::new(vec![line1]).style(Style::default())
|
|
|
|
|
- // })
|
|
|
|
|
- // .collect();
|
|
|
|
|
-
|
|
|
|
|
- //let node_info = List::new(node_info)
|
|
|
|
|
- // .block(Block::default().borders(Borders::ALL))
|
|
|
|
|
- // .highlight_style(Style::default().fg(Color::LightCyan).add_modifier(Modifier::BOLD));
|
|
|
|
|
-
|
|
|
|
|
- //f.render_stateful_widget(node_info, slice[1], &mut app.node_list.state);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// TODO: rename to frame2
|
|
|
|
|
-pub fn render_selected(n: &NodeInfo) {
|
|
|
|
|
- //let slice = Layout::default()
|
|
|
|
|
- // .direction(Direction::Horizontal)
|
|
|
|
|
- // .margin(2)
|
|
|
|
|
- // .constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
|
|
|
|
|
- // .split(f.size());
|
|
|
|
|
-
|
|
|
|
|
- let text: Vec<Spans> = n.info.iter().map(|i| Spans::from(i.to_string())).collect();
|
|
|
|
|
|
|
+ let text: Vec<Spans> = app.node_info.info.iter().map(|i| Spans::from(i.to_string())).collect();
|
|
|
let graph = Paragraph::new(text)
|
|
let graph = Paragraph::new(text)
|
|
|
.block(Block::default().borders(Borders::ALL))
|
|
.block(Block::default().borders(Borders::ALL))
|
|
|
.style(Style::default().fg(Color::LightCyan).add_modifier(Modifier::BOLD));
|
|
.style(Style::default().fg(Color::LightCyan).add_modifier(Modifier::BOLD));
|
|
|
|
|
|
|
|
- //f.render_widget(graph, slice[1]);
|
|
|
|
|
|
|
+ f.render_widget(graph, slice[1]);
|
|
|
}
|
|
}
|