mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-13 13:30:31 +08:00
18 lines
401 B
Rust
18 lines
401 B
Rust
use crate::clash;
|
|
use crate::import;
|
|
use tauri::api::process::kill_children;
|
|
|
|
#[tauri::command]
|
|
pub fn cmd_restart_sidebar() {
|
|
kill_children();
|
|
clash::run_clash_bin();
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn cmd_import_profile(url: String) -> Result<String, String> {
|
|
match import::import_profile(&url).await {
|
|
Ok(_) => Ok(String::from("success")),
|
|
Err(_) => Err(String::from("error")),
|
|
}
|
|
}
|