feat: add logging module and update running mode terminology

This commit is contained in:
Tunglies
2025-03-25 23:05:09 +08:00
parent 12065330e1
commit df5424d55e
10 changed files with 547 additions and 1031 deletions

View File

@@ -1,9 +1,8 @@
use super::CmdResult;
use crate::{core::CoreManager, module::mihomo::MihomoManager};
use crate::module::mihomo::MihomoManager;
#[tauri::command]
pub async fn get_proxies() -> CmdResult<serde_json::Value> {
CoreManager::global().ensure_running_core().await;
let mannager = MihomoManager::global();
let proxies = mannager
.refresh_proxies()
@@ -15,7 +14,6 @@ pub async fn get_proxies() -> CmdResult<serde_json::Value> {
#[tauri::command]
pub async fn get_providers_proxies() -> CmdResult<serde_json::Value> {
CoreManager::global().ensure_running_core().await;
let mannager = MihomoManager::global();
let providers = mannager
.refresh_providers_proxies()

View File

@@ -47,7 +47,7 @@ pub async fn get_system_info() -> CmdResult<String> {
pub async fn get_running_mode() -> Result<String, String> {
match CoreManager::global().get_running_mode().await {
core::RunningMode::Service => Ok("service".to_string()),
core::RunningMode::Sidecar => Ok("sidecar".to_string()),
core::RunningMode::Sidecar => Ok("standalone".to_string()),
core::RunningMode::NotRunning => Ok("not_running".to_string()),
}
}