mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: finish some features
This commit is contained in:
@@ -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")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user