mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
feat: implement draft management system for concurrent editing and committing of data
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use super::{Draft, IClashTemp, IProfiles, IRuntime, IVerge};
|
||||
use super::{IClashTemp, IProfiles, IRuntime, IVerge};
|
||||
use crate::{
|
||||
config::{PrfItem, profiles_append_item_safe},
|
||||
core::{CoreManager, handle},
|
||||
enhance, logging,
|
||||
utils::{dirs, help, logging::Type},
|
||||
utils::{Draft, dirs, help, logging::Type},
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
use backoff::{Error as BackoffError, ExponentialBackoff};
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
mod clash;
|
||||
#[allow(clippy::module_inception)]
|
||||
mod config;
|
||||
mod draft;
|
||||
mod encrypt;
|
||||
mod prfitem;
|
||||
pub mod profiles;
|
||||
mod runtime;
|
||||
mod verge;
|
||||
|
||||
pub use self::{
|
||||
clash::*, config::*, draft::*, encrypt::*, prfitem::*, profiles::*, runtime::*, verge::*,
|
||||
};
|
||||
pub use self::{clash::*, config::*, encrypt::*, prfitem::*, profiles::*, runtime::*, verge::*};
|
||||
|
||||
pub const DEFAULT_PAC: &str = r#"function FindProxyForURL(url, host) {
|
||||
return "PROXY 127.0.0.1:%mixed-port%; SOCKS5 127.0.0.1:%mixed-port%; DIRECT;";
|
||||
|
||||
@@ -8,7 +8,7 @@ mod enhance;
|
||||
mod feat;
|
||||
mod module;
|
||||
mod process;
|
||||
mod utils;
|
||||
pub mod utils;
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::utils::window_manager::WindowManager;
|
||||
use crate::{
|
||||
|
||||
@@ -109,7 +109,7 @@ impl<T: Clone + ToOwned> Draft<Box<T>> {
|
||||
|
||||
#[test]
|
||||
fn test_draft_box() {
|
||||
use super::IVerge;
|
||||
use crate::config::IVerge;
|
||||
|
||||
// 1. 创建 Draft<Box<IVerge>>
|
||||
let verge = Box::new(IVerge {
|
||||
@@ -1,5 +1,6 @@
|
||||
pub mod autostart;
|
||||
pub mod dirs;
|
||||
pub mod draft;
|
||||
pub mod format;
|
||||
pub mod help;
|
||||
pub mod i18n;
|
||||
@@ -12,3 +13,5 @@ pub mod server;
|
||||
pub mod singleton;
|
||||
pub mod tmpl;
|
||||
pub mod window_manager;
|
||||
|
||||
pub use draft::Draft;
|
||||
|
||||
@@ -61,6 +61,12 @@ pub struct NetworkManager {
|
||||
connection_error_count: Mutex<usize>,
|
||||
}
|
||||
|
||||
impl Default for NetworkManager {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl NetworkManager {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user