add: RunningMode Display implementation and TypeScript enum

This commit is contained in:
Tunglies
2025-03-26 17:01:48 +08:00
parent d91653b218
commit ca0cf4552c
4 changed files with 25 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ use crate::{
};
use anyhow::Result;
use once_cell::sync::OnceCell;
use std::{path::PathBuf, sync::Arc};
use std::{fmt, path::PathBuf, sync::Arc};
use tauri_plugin_shell::{process::CommandChild, ShellExt};
use tokio::sync::Mutex;
@@ -37,6 +37,16 @@ pub enum RunningMode {
NotRunning,
}
impl fmt::Display for RunningMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
RunningMode::Service => write!(f, "Service"),
RunningMode::Sidecar => write!(f, "Sidecar"),
RunningMode::NotRunning => write!(f, "NotRunning"),
}
}
}
const CLASH_CORES: [&str; 2] = ["verge-mihomo", "verge-mihomo-alpha"];
impl CoreManager {