feat: runtime config viewer

This commit is contained in:
GyDi
2022-07-25 01:20:13 +08:00
parent 7633f9f88b
commit a9bf32919e
7 changed files with 119 additions and 8 deletions

View File

@@ -174,6 +174,13 @@ pub fn get_clash_info(core: State<'_, Core>) -> CmdResult<ClashInfo> {
Ok(clash.info.clone())
}
/// get the running clash config string
#[tauri::command]
pub fn get_running_config(core: State<'_, Core>) -> CmdResult<Option<String>> {
let clash = core.clash.lock();
Ok(clash.running_config.clone())
}
/// update the clash core config
/// after putting the change to the clash core
/// then we should save the latest config