mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-27 16:22:11 +08:00
- Add Cargo.toml for workspace management, including dependencies and profiles. - Create clash-verge-draft crate with basic structure, including a benchmark for Draft functionality. - Implement Draft management with shared state and asynchronous modifications. - Add tests for Draft functionality to ensure correctness. - Create clash-verge-logging crate for logging utilities with structured log types and macros. - Update src-tauri to use new crates and remove unnecessary configurations. - Refactor existing code to utilize the new Draft and logging functionalities.
16 lines
445 B
Rust
16 lines
445 B
Rust
use super::CmdResult;
|
|
use crate::{cmd::StringifyErr as _, config::IVerge, feat};
|
|
use clash_verge_draft::SharedBox;
|
|
|
|
/// 获取Verge配置
|
|
#[tauri::command]
|
|
pub async fn get_verge_config() -> CmdResult<SharedBox<IVerge>> {
|
|
feat::fetch_verge_config().await.stringify_err()
|
|
}
|
|
|
|
/// 修改Verge配置
|
|
#[tauri::command]
|
|
pub async fn patch_verge_config(payload: IVerge) -> CmdResult {
|
|
feat::patch_verge(&payload, false).await.stringify_err()
|
|
}
|