map: renamed NodeInfoView and NodeIdList to InfoPanel and IdPanel

This commit is contained in:
lunar-mining
2022-02-02 10:59:19 +01:00
parent 0f07155950
commit 533ee4a63c
3 changed files with 8 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
use crate::{
list::NodeIdList,
list::IdPanel,
node_info::{NodeInfo, NodeInfoView},
};
//use smol::Timer;
@@ -10,7 +10,7 @@ use crate::{
// arc reference
#[derive(Clone)]
pub struct App {
pub node_list: NodeIdList,
pub node_list: IdPanel,
pub node_info: NodeInfoView,
}
@@ -59,13 +59,13 @@ impl App {
infos[4].id.clone(),
];
let node_list = NodeIdList::new(ids);
let node_list = IdPanel::new(ids);
//let infos = Vec::new();
//let ids = Vec::new();
//let node_info = NodeInfoView::new(infos);
//let node_list = NodeIdList::new(ids);
//let node_list = IdPanel::new(ids);
App { node_list, node_info }
}

View File

@@ -2,14 +2,14 @@
use tui::widgets::ListState;
#[derive(Clone)]
pub struct NodeIdList {
pub struct IdPanel {
pub state: ListState,
pub node_id: Vec<String>,
}
impl NodeIdList {
pub fn new(node_id: Vec<String>) -> NodeIdList {
NodeIdList { state: ListState::default(), node_id }
impl IdPanel {
pub fn new(node_id: Vec<String>) -> IdPanel {
IdPanel { state: ListState::default(), node_id }
}
pub fn next(&mut self) {

View File

@@ -78,11 +78,7 @@ async fn main() -> Result<()> {
terminal.clear()?;
// let current_state = get_current_state.await;
// let mut app = app.lock();
// app.current_state = current_state;
let app = Arc::new(Mutex::new(App::new()));
//let app = App::new();
let nthreads = num_cpus::get();
let (signal, shutdown) = async_channel::unbounded::<()>();