refactor: logger fetch logic

This commit is contained in:
huzibaca
2024-11-18 05:58:06 +08:00
parent 824325a2eb
commit 9ebd96611a
9 changed files with 50 additions and 126 deletions

View File

@@ -8,7 +8,7 @@ use crate::{ret_err, wrap_err};
use anyhow::{Context, Result};
use network_interface::NetworkInterface;
use serde_yaml::Mapping;
use std::collections::{HashMap, VecDeque};
use std::collections::HashMap;
use sysproxy::{Autoproxy, Sysproxy};
type CmdResult<T = ()> = Result<T, String>;
use reqwest_dav::list_cmd::ListFile;
@@ -216,11 +216,6 @@ pub fn get_auto_proxy() -> CmdResult<Mapping> {
Ok(map)
}
#[tauri::command]
pub fn get_clash_logs() -> CmdResult<VecDeque<String>> {
Ok(logger::Logger::global().get_log())
}
#[tauri::command]
pub fn open_app_dir() -> CmdResult<()> {
let app_dir = wrap_err!(dirs::app_home_dir())?;