|
@@ -16,7 +16,7 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
|
|
|
.split(f.size());
|
|
.split(f.size());
|
|
|
|
|
|
|
|
let nodes: Vec<ListItem> = app
|
|
let nodes: Vec<ListItem> = app
|
|
|
- .node_list
|
|
|
|
|
|
|
+ .id_list
|
|
|
.node_id
|
|
.node_id
|
|
|
.iter()
|
|
.iter()
|
|
|
.map(|id| {
|
|
.map(|id| {
|
|
@@ -29,18 +29,18 @@ pub fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
|
|
|
.block(Block::default().borders(Borders::ALL))
|
|
.block(Block::default().borders(Borders::ALL))
|
|
|
.highlight_style(Style::default().fg(Color::LightCyan).add_modifier(Modifier::BOLD));
|
|
.highlight_style(Style::default().fg(Color::LightCyan).add_modifier(Modifier::BOLD));
|
|
|
|
|
|
|
|
- f.render_stateful_widget(nodes, slice[0], &mut app.node_list.state);
|
|
|
|
|
|
|
+ f.render_stateful_widget(nodes, slice[0], &mut app.id_list.state);
|
|
|
|
|
|
|
|
- let index = app.node_info.index;
|
|
|
|
|
|
|
+ let index = app.info_list.index;
|
|
|
|
|
|
|
|
render_info(app, f, index, slice);
|
|
render_info(app, f, index, slice);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fn render_info<B: Backend>(app: &mut App, f: &mut Frame<B>, index: usize, slice: Vec<Rect>) {
|
|
fn render_info<B: Backend>(app: &mut App, f: &mut Frame<B>, index: usize, slice: Vec<Rect>) {
|
|
|
- let id = &app.node_info.infos[index].id;
|
|
|
|
|
- let connections = app.node_info.infos[index].connections;
|
|
|
|
|
- let is_active = app.node_info.infos[index].is_active;
|
|
|
|
|
- let message = &app.node_info.infos[index].last_message;
|
|
|
|
|
|
|
+ let id = &app.info_list.infos[index].id;
|
|
|
|
|
+ let connections = app.info_list.infos[index].connections;
|
|
|
|
|
+ let is_active = app.info_list.infos[index].is_active;
|
|
|
|
|
+ let message = &app.info_list.infos[index].last_message;
|
|
|
let span = vec![
|
|
let span = vec![
|
|
|
Spans::from(format!("NodeId: {}", id)),
|
|
Spans::from(format!("NodeId: {}", id)),
|
|
|
Spans::from(format!("Number of connections: {}", connections)),
|
|
Spans::from(format!("Number of connections: {}", connections)),
|