Commit Graph
65 Commits
Author SHA1 Message Date
Tunglies 36142656a4 refactor(timer): improve timer management with robust error handling
This commit improves the timer management system with the following enhancements:

Replace Mutex with RwLock for better read concurrency in timer state
Add structured TimerTask type to store task metadata
Use atomic boolean for initialization flag instead of mutex
Implement comprehensive error handling with detailed logging
Add rollback capability when task operations fail
Reduce lock contention by generating task diffs outside locks
Add timing metrics for task execution
Improve code organization and documentation
2025-03-15 18:58:12 +08:00
Tunglies d6a48deb5a refactor(config): use bitflags for tracking update operations
Replace multiple boolean variables with a bitflag approach for tracking
required update operations in the patch_verge function. This improves
code maintainability and potentially performance by:

1. Using a single integer variable with bit operations instead of multiple booleans
2. Defining clear flags as enum variants for better code readability
3. Simplifying flag checks with bitwise operations

The UpdateFlags enum provides a clear and type-safe way to represent
different types of updates needed when patching Verge configuration.
2025-03-15 18:42:57 +08:00
Tunglies e98ce0c2ae Optimize hotkey management to reduce lock contention and improve performance
- Minimize mutex lock durations in update() by processing data outside critical sections
- Pre-allocate collections to avoid unnecessary reallocations
- Replace forEach-style loops with more efficient for loops
- Add defensive null checks when accessing app_handle
- Improve error handling with more robust Option unwrapping
- Enhance code readability with descriptive comments
2025-03-15 17:52:14 +08:00
Tunglies 8118fc754c structure: move out crate_mihomo_api 2025-03-15 14:47:02 +08:00
Tunglies 1ec7a0f23c refactor: update request method handling to use reqwest::Method enum
fix: duplicated checks tray menu
2025-03-15 13:23:17 +08:00
Tunglies 488e8ef1d5 fix: optimize speed rate update logic for small values 2025-03-14 22:40:56 +08:00
Tunglies c25015ed54 Revert "feat: add trigger updater workflow to GitHub actions for release and alpha workflows"
This reverts commit aaefc5b479.
2025-03-14 02:00:55 +08:00
Tunglies aaefc5b479 feat: add trigger updater workflow to GitHub actions for release and alpha workflows 2025-03-14 01:31:19 +08:00
Tunglies d4012bace9 chore: remove tray icon configuration from Linux app settings 2025-03-13 19:03:27 +08:00
Tunglies af7660686d fix: increase request timeout to 60 seconds for better reliability 2025-03-13 15:16:54 +08:00
Tunglies b57c6e408a chore: git hooks for linter and formatter 2025-03-13 12:51:20 +08:00
Tunglies 692deb6012 fix: windows unmatched tray 2025-03-12 13:55:11 +08:00
Tunglies 8ec499f631 fix: windows different tray icon display 2025-03-12 13:28:04 +08:00
Tunglies 2bcd653a56 feat: update systray creation to use TrayIconBuilder and pass app reference
fix: macos systray duplicated icon
2025-03-12 13:04:15 +08:00
Tunglies 0f10952979 feat: add alpha update endpoints to tauri configuration 2025-03-11 01:31:31 +08:00
Tunglies 58fa67100f feat: add support for alpha updates and enhance updater functionality
feat: improve release handling by adding creation logic for non-existent releases
2025-03-11 01:27:17 +08:00
Tunglies 8e294916c4 rm: label issues workflow 2025-03-10 01:01:12 +08:00
Tunglies 6877e0c95d chore: rename "DNS Settings" to "DNS Overwrite" in UI for consistency
This change updates the label for the DNS toggle setting from "DNS Settings" to "DNS Overwrite"
in the ClashVerge settings interface. The change provides better consistency with the translation
keys and more clearly communicates the function of the setting, which is to override system DNS.
The corresponding translation keys have been updated in both English and Chinese localization files.
2025-03-10 00:57:55 +08:00
Tunglies 37a333a023 feat: add scheduled workflow and commit change check to alpha build 2025-03-09 17:42:13 +08:00
Tunglies 48f1da963a refactor: update MihomoManager to handle traffic WebSocket URL and authorization 2025-03-09 14:44:15 +08:00
Tunglies 18f86874ee refactor: migrate clash client info retrieval to MihomoManager 2025-03-09 00:40:16 +08:00
Tunglies e6686e0b82 rm: clash-api dead code 2025-03-09 00:29:14 +08:00
Tunglies 4bf166986d refactor: improve request handling and response processing in MihomoManager 2025-03-09 00:27:12 +08:00
Tunglies 0f60d84f6c refactor: streamline clash delay test and improve API interactions 2025-03-09 00:04:48 +08:00
Tunglies 15e54df67c refactor: streamline clash mode handling and improve API interactions 2025-03-08 22:41:14 +08:00
Tunglies 805b54d81e Update dependencies and refactor encryption logic
Updates multiple dependencies to their latest versions in Cargo.lock and Cargo.toml.
Refactors encryption logic to use updated getrandom API.
Improves tray speed rate display by using ab_glyph for font rendering.
2025-03-06 18:56:31 +08:00
Tunglies 6c96724dce feat(mihomo): refactor MihomoManager for global access and improve proxy retrieval (#2906) 2025-03-05 10:58:54 +08:00
Tunglies 1a51a92b70 test: crate_mihomo_api additional headers 2025-03-05 08:14:37 +08:00
Tunglies 5760f16272 fix: extern controler api secert with headers 2025-03-05 08:09:42 +08:00
Tunglies 4ed36f6223 refacture: Mihomo API integration (#2900)
* feat: add mihomo_api crate as a workspace member

Added a new mihomo_api crate to handle interactions with the Mihomo API. This modular approach provides a dedicated interface for fetching and managing proxy data from Mihomo servers. The implementation includes functionality to refresh and retrieve both proxies and provider proxies with proper error handling and timeouts. Added this crate as a workspace member and included it as a dependency in the main project.

* Refactors Mihomo API integration

Simplifies proxy fetching by removing the MihomoManager structure.

Updates the get_proxies and get_providers_proxies functions to directly use the mihomo_api module.

Removes unused Mihomo API related files and modules for cleaner codebase.

Enhances overall maintainability and performance.
2025-03-05 00:45:08 +08:00
Tunglies 1ee8786ab7 feat(sysinfo): Add diagnostic information enhancements (#2880)
Enhanced the PlatformSpecification struct with additional diagnostic information including:
- Added Verge version information to diagnostic output
- Added running mode information (Service/Sidecar/Not Running)
- Improved Debug implementation to display all diagnostic fields
- Implemented asynchronous detection of core running mode

This change helps users provide more complete system information when reporting issues.
2025-03-04 11:52:22 +08:00
Tunglies 1ba688727e feat(proxy): add proxy commands and integrate with API
Add new proxy.rs module with get_proxies and get_providers_proxies commands.
Update mod.rs and lib.rs to re-export and register proxy commands.
Update API.ts to use invoke for proxy commands.
Minor formatting improvements in module/mihomo.rs.
2025-03-04 01:01:24 +08:00
Tunglies 3b69465016 feat: add Mihomo API modules and manager (#2869)
• Introduce new API caller implementations for Mihomo in model and module layers.
• Add configuration and API integration files under /src-tauri/src/config/api and /src-tauri/src/model/api.
• Implement a singleton MihomoAPICaller with async API call support and integration tests.
• Create a new MihomoManager module to refresh and fetch proxies from the API.
• Update Cargo.lock and Cargo.toml with additional dependencies (async-trait, env_logger, mockito, tempfile, etc.) related to the Mihomo API support.
2025-03-03 19:31:44 +08:00
Tunglies a18efb0e71 fix: speed format runns by docs 2025-03-03 11:36:21 +08:00
Tunglies de1c825ad3 Revert "style: update box styling in settings page for improved layout (#2857)"
This reverts commit de2cff824e.
2025-03-03 08:00:10 +08:00
Tunglies de2cff824e style: update box styling in settings page for improved layout (#2857) 2025-03-03 06:38:32 +08:00
Tunglies aff504bddc feat: add export diagnostic info functionality (#2856) 2025-03-03 05:58:12 +08:00
Tunglies fdcefe458e fix: windows/linux runtime crash 2025-03-03 02:27:45 +08:00
Tunglies 97d683541d Revert "chore: alpha ci should remove old builds"
This reverts commit 9f7ffb80e1.
2025-03-03 00:16:17 +08:00
Tunglies 9f7ffb80e1 chore: alpha ci should remove old builds 2025-03-02 23:46:20 +08:00
Tunglies c957ea7b24 feat: fish env export support 2025-03-02 23:20:10 +08:00
Tunglies 181fce16b1 version: 2.1.3 a 2025-03-02 20:46:53 +08:00
Tunglies 825f023505 version: 2.1.3 alpha 2025-03-02 20:43:54 +08:00
Tunglies 347ea53b32 version: 2.1.3 alpha (#2851)
* version: 2.1.3 alpha
2025-03-02 19:08:27 +08:00
Tunglies d525e0dd70 chore: automatically label issues (#2844) 2025-03-02 18:50:31 +08:00
Tunglies 365e844b83 docs: add fast build and clean commands to contributing guide (#2842)
docs: add fast build and clean commands to contributing guide

- Added documentation for the `pnpm build:fast` command which uses Rust's fast-release profile to reduce compilation time
- Added explanation that fast builds disable optimization and LTO, resulting in larger but quicker builds
- Added documentation for the `pnpm clean` command to clean Rust build files
2025-03-02 15:13:17 +08:00
Tunglies 44bdeb555a chore: fast-dev and fast-build profile (#2841)
* refactor: improve proxy group UI and spacing

- Increased spacing in proxy-groups.tsx by adjusting the right position
  of the alphabet selector to provide better visual separation
- Enhanced spacing in proxy-render.tsx with larger margins and padding
  - Increased group item margins from 8px to 10px with 16px horizontal spacing
  - Expanded border radius from 8px to 10px for smoother appearance
  - Improved ProxyHead component spacing with pl: 3, pr: 3.5
  - Enhanced grid spacing in proxy collection items from 1 to 1.5
  - Adjusted padding for better visual hierarchy

These changes create a more polished, spacious layout with improved
readability and touch targets.

* - Update package.json with improved dev and build scripts:
  - Add fast-dev profile to development scripts
  - Configure build:fast with fast-release profile
  - Add clean command for cargo cleaning
2025-03-02 14:58:59 +08:00
Tunglies 520c33557e refactor: improve proxy group UI and spacing (#2835)
- Increased spacing in proxy-groups.tsx by adjusting the right position
  of the alphabet selector to provide better visual separation
- Enhanced spacing in proxy-render.tsx with larger margins and padding
  - Increased group item margins from 8px to 10px with 16px horizontal spacing
  - Expanded border radius from 8px to 10px for smoother appearance
  - Improved ProxyHead component spacing with pl: 3, pr: 3.5
  - Enhanced grid spacing in proxy collection items from 1 to 1.5
  - Adjusted padding for better visual hierarchy

These changes create a more polished, spacious layout with improved
readability and touch targets.
2025-03-02 05:36:18 +08:00
Tunglies bfad5ac091 fix: macos frameless title 2025-03-02 04:30:58 +08:00
Tunglies 625cf1a803 feat: add fast compilation options for development and release (#2831)
- Added fast compilation profiles in Cargo.toml
  - fast-dev profile with max codegen units and disabled optimizations
  - fast-release profile with debugging support and faster build time
- Added new npm scripts for quick development iterations
  - dev:fast command for standard development without extra features
  - build:fast command for quick release builds
- Updated default dev command to use verge-dev feature flag
- Both profiles retain debug symbols and disable stripping for better debugging
2025-03-02 00:40:07 +08:00
Tunglies 9ee011514a refactor: rename cmds module to cmd for better consistency (#2830)
- Renamed `cmds` module to `cmd` for better naming consistency
- Reorganized command modules into separate files under src/cmd/
- Updated all imports and references to use the new module name
- Fixed missing dependency in webdav.rs to reference core::backup
- Updated tray module to use new cmd namespace
- Improved uwp.rs module structure using platform-specific implementations
- Removed unnecessary imports from various command files
2025-03-01 22:52:43 +08:00
Tunglies 184fd4a1ba refactor: reorganize feat.rs into modular structure (#2827)
Split the monolithic feat.rs file into specialized modules:
- backup.rs: WebDAV backup and restore functions
- clash.rs: Core management and testing functions
- config.rs: Configuration handling
- profile.rs: Profile management
- proxy.rs: Proxy and TUN mode controls
- window.rs: Dashboard window management

This improves code organization, readability, and maintainability
by grouping related functionality into logical modules.
2025-03-01 20:44:35 +08:00
Tunglies 1cdba297fb add: issues type template 2025-03-01 19:12:12 +08:00
Tunglies 1ed6743bbb Issues label options template (#2820)
* fix: macos dock display icon and text

* add: issues label option template
2025-03-01 02:46:16 -08:00
Tunglies 41c42bba32 fix: macos dock display icon and text (#2818) 2025-03-01 02:29:40 -08:00
Tunglies ae7f456011 feat: better setting UI layout (#2814) 2025-03-01 01:29:23 +08:00
Tunglies 5906e0126d feat: better setting layout ui (#2809) 2025-03-01 01:29:23 +08:00
Tunglies dce1395af1 feat: quiting when enable tun mode no more blocking system network (#2805) 2025-03-01 01:29:23 +08:00
Tunglies 76be5d8469 feat: macos display colorful icon with speed rate (#2771) 2025-02-27 01:51:52 +08:00
Tunglies 8b25d45109 rm dead code (#2718)
* rm: verge service takes full control of mihomo process. no more required.

* rm: dead code
2025-02-19 01:13:52 +08:00
Tunglies bdb178d893 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
2025-02-12 18:14:13 -08:00
Tunglies ebe0899eb1 perf: imporve clash mode switching performance on the main window (#2667) 2025-02-09 07:45:46 +08:00
Tunglies a3d0a38b1e feat: option to enable global hotkey (#2665) 2025-02-09 07:45:22 +08:00
Tunglies 63bd0c87b2 fix: duplicate checked tray menu when profile name are same (#2660) 2025-02-08 09:36:04 +08:00
Tunglies 6c54f5e9b4 Feature: Switch Proxy Profile from Tray Menu (#2644) 2025-02-05 08:52:47 +08:00