feat: better service status and TUN mode usable checks in Setting Page

This commit is contained in:
Tunglies
2025-05-12 19:04:08 +08:00
parent d587ed09a5
commit 5b6c9be99f
14 changed files with 127 additions and 88 deletions

View File

@@ -1,4 +1,4 @@
use std::fmt;
use std::fmt::{self, write};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Type {
@@ -16,6 +16,7 @@ pub enum Type {
Backup,
Lightweight,
Network,
ProxyMode,
}
impl fmt::Display for Type {
@@ -35,6 +36,7 @@ impl fmt::Display for Type {
Type::Backup => write!(f, "[Backup]"),
Type::Lightweight => write!(f, "[Lightweight]"),
Type::Network => write!(f, "[Network]"),
Type::ProxyMode => write!(f, "[ProxMode]"),
}
}
}

View File

@@ -1,8 +1,10 @@
use anyhow::Result;
use lazy_static::lazy_static;
use reqwest::{Client, ClientBuilder, Proxy, RequestBuilder, Response};
use std::sync::{Arc, Mutex, Once};
use std::time::{Duration, Instant};
use std::{
sync::{Arc, Mutex, Once},
time::{Duration, Instant},
};
use tokio::runtime::{Builder, Runtime};
use crate::{config::Config, logging, utils::logging::Type};