handle * ip, ui refac, fix #1 to handle .conf
This commit is contained in:
@@ -3,6 +3,8 @@ pub mod entry;
|
||||
mod settings;
|
||||
|
||||
pub mod status;
|
||||
use std::{thread::sleep, time::Duration};
|
||||
|
||||
use crate::app::{
|
||||
entry::Entry,
|
||||
settings::Settings,
|
||||
@@ -102,13 +104,13 @@ impl AppState {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn print(&self) {
|
||||
let tempEntry = &self.entries[0];
|
||||
let res = serde_json::to_string(tempEntry).unwrap();
|
||||
println!("{res}");
|
||||
let resString = tempEntry.to_string();
|
||||
println!("{resString}");
|
||||
}
|
||||
// pub fn print(&self) {
|
||||
// let tempEntry = &self.entries[0];
|
||||
// let res = serde_json::to_string(tempEntry).unwrap();
|
||||
// println!("{res}");
|
||||
// let resString = tempEntry.to_string();
|
||||
// println!("{resString}");
|
||||
// }
|
||||
|
||||
pub fn saveConfigToScript(&self) {
|
||||
let mut outputString: String = String::new();
|
||||
@@ -120,6 +122,12 @@ impl AppState {
|
||||
))
|
||||
}
|
||||
outputString.push_str("\nwait");
|
||||
// for o in 0..1 {
|
||||
// println!("test {o}");
|
||||
// sleep(Duration::from_secs(1));
|
||||
// }
|
||||
println!("Writing config to system");
|
||||
sleep(Duration::from_millis(100));
|
||||
let _ = std::fs::write("./forward.sh", outputString);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user