mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:03:45 +08:00
fix: build front cannot find IvergeConfig.enable_lite_mode and macos port switching causes crash (#2691)
* fix: macos switch protocol port or enable protocol port causes crash * fix: build time front cannot find IVergeConfig attribute enable_lite_mode
This commit is contained in:
parent
6b14c2b763
commit
daf0398750
@ -98,6 +98,7 @@ impl CoreManager {
|
|||||||
|
|
||||||
/// 启动核心
|
/// 启动核心
|
||||||
pub async fn start_core(&self) -> Result<()> {
|
pub async fn start_core(&self) -> Result<()> {
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
// 检查端口占用
|
// 检查端口占用
|
||||||
self.health_checker.check_ports().await?;
|
self.health_checker.check_ports().await?;
|
||||||
|
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use anyhow::Result;
|
||||||
use sysinfo::{Pid, System};
|
use sysinfo::{Pid, System};
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::core::service;
|
use crate::core::service;
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
use port_scanner::local_port_available;
|
use port_scanner::local_port_available;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@ -12,6 +17,7 @@ impl HealthChecker {
|
|||||||
Self
|
Self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
pub async fn check_ports(&self) -> Result<()> {
|
pub async fn check_ports(&self) -> Result<()> {
|
||||||
let verge = Config::verge();
|
let verge = Config::verge();
|
||||||
let verge_config = verge.latest();
|
let verge_config = verge.latest();
|
||||||
|
1
src/services/types.d.ts
vendored
1
src/services/types.d.ts
vendored
@ -709,6 +709,7 @@ interface IVergeConfig {
|
|||||||
tun_tray_icon?: boolean;
|
tun_tray_icon?: boolean;
|
||||||
enable_tray_speed?: boolean;
|
enable_tray_speed?: boolean;
|
||||||
enable_tun_mode?: boolean;
|
enable_tun_mode?: boolean;
|
||||||
|
enable_lite_mode?: boolean;
|
||||||
enable_auto_launch?: boolean;
|
enable_auto_launch?: boolean;
|
||||||
enable_silent_start?: boolean;
|
enable_silent_start?: boolean;
|
||||||
enable_system_proxy?: boolean;
|
enable_system_proxy?: boolean;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user