feat: finish some features

This commit is contained in:
GyDi
2021-12-08 23:40:52 +08:00
parent df435fc9df
commit c13a755eb6
6 changed files with 219 additions and 76 deletions

View File

@@ -1,4 +1,16 @@
use tauri::api::process::CommandChild;
use crate::clash;
use tauri::api::process::kill_children;
#[tauri::command]
fn set_clash_port(process: Option<CommandChild>, port: i32) {}
pub fn restart_sidebar() {
kill_children();
clash::run_clash_bin();
}
#[tauri::command]
pub async fn get_config_data(url: String) -> Result<String, String> {
match clash::fetch_url(&url).await {
Ok(_) => Ok(String::from("success")),
Err(_) => Err(String::from("error")),
}
}