Просмотр исходного кода

map: renamed NodeInfoView and NodeIdList to InfoPanel and IdPanel

lunar-mining 4 лет назад
Родитель
Сommit
533ee4a63c
3 измененных файлов с 8 добавлено и 12 удалено
  1. 4 4
      bin/map/src/app.rs
  2. 4 4
      bin/map/src/list.rs
  3. 0 4
      bin/map/src/main.rs

+ 4 - 4
bin/map/src/app.rs

@@ -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 }
     }
 

+ 4 - 4
bin/map/src/list.rs

@@ -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) {

+ 0 - 4
bin/map/src/main.rs

@@ -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::<()>();