Commit Graph

267 Commits

Author SHA1 Message Date
Tunglies
15a1770ee9 feat: migrate mihomo to use kode-bridge IPC on Windows and Unix (#4051)
* Refactor Mihomo API integration and remove crate_mihomo_api

- Removed the `mihomo_api` crate and its dependencies from the project.
- Introduced `IpcManager` for handling IPC communication with Mihomo.
- Implemented IPC methods for managing proxies, connections, and configurations.
- Updated `MihomoManager` to utilize `IpcManager` instead of the removed crate.
- Added platform-specific IPC socket path handling for macOS, Linux, and Windows.
- Cleaned up related tests and configuration files.

* fix: remove duplicate permission entry in desktop capabilities

* refactor: replace MihomoManager with IpcManager and remove Mihomo module

* fix: restore tempfile dependency in dev-dependencies

* fix: update kode-bridge dependency to use git source from the dev branch

* feat: migrate mihomo to use kode-bridge IPC on Windows

This commit implements a comprehensive migration from legacy service IPC to the kode-bridge library for Windows IPC communication. Key changes include:

Replace service_ipc with kode-bridge IpcManager for all mihomo communications
Simplify proxy commands using new caching mechanism with ProxyRequestCache
Add Windows named pipe (\.\pipe\mihomo) and Unix socket IPC endpoint configuration
Update Tauri permissions and dependencies (dashmap, tauri-plugin-notification)
Add IPC logging support and improve error handling
Fix Windows IPC path handling in directory utilities
This migration enables better cross-platform IPC support and improved performance for mihomo proxy core communication.

* doc: add IPC communication with Mihomo kernel, removing Restful API dependency

* fix: standardize logging type naming from IPC to Ipc for consistency

* refactor: clean up and optimize code structure across multiple components and services

- Removed unnecessary comments and whitespace in various files.
- Improved code readability and maintainability by restructuring functions and components.
- Updated localization files for consistency and accuracy.
- Enhanced performance by optimizing hooks and utility functions.
- General code cleanup in settings, pages, and services to adhere to best practices.

* fix: simplify URL formatting in test_proxy_delay method

* fix: update kode-bridge dependency to version 0.1.3 and change source to crates.io

* fix: update macOS target versions in development workflow

* Revert "fix: update macOS target versions in development workflow"

This reverts commit b9831357e4.

* feat: enhance IPC path handling for Unix systems and improve directory safety checks

* feat: add conditional compilation for Unix-specific IPC path handling

* chore: update cagro.lock

* feat: add external controller configuration and UI support

* Refactor proxy and connection management to use IPC-based commands

- Updated `get_proxies` function in `proxy.rs` to call the new IPC command.
- Renamed `get_refresh_proxies` to `get_proxies` in `ipc/general.rs` for consistency.
- Added new IPC commands for managing proxies, connections, and configurations in `cmds.ts`.
- Refactored API calls in various components to use the new IPC commands instead of HTTP requests.
- Improved error handling and response management in the new IPC functions.
- Cleaned up unused API functions in `api.ts` and redirected relevant calls to `cmds.ts`.
- Enhanced connection management features including health checks and updates for proxy providers.

* chore: update dependencies and improve error handling in IPC manager

* fix: downgrade zip dependency from 4.3.0 to 4.2.0

* feat: Implement traffic and memory data monitoring service

- Added `TrafficService` and `TrafficManager` to manage traffic and memory data collection.
- Introduced commands to get traffic and memory data, start and stop the traffic service.
- Integrated IPC calls for traffic and memory data retrieval in the frontend.
- Updated `AppDataProvider` and `EnhancedTrafficStats` components to utilize new data fetching methods.
- Removed WebSocket connections for traffic and memory data, replaced with IPC polling.
- Added logging for better traceability of data fetching and service status.

* refactor: unify external controller handling and improve IPC path resolution

* fix: replace direct IPC path retrieval with guard function for external controller

* fix: convert external controller IPC path to string for proper insertion in config map

* fix: update dependencies and improve IPC response handling

* fix: remove unnecessary unix conditional for ipc path import

* Refactor traffic and memory monitoring to use IPC stream; remove TrafficService and TrafficManager. Introduce new IPC-based data retrieval methods for traffic and memory, including formatted data and system overview. Update frontend components to utilize new APIs for enhanced data display and management.

* chore: bump crate rand version to 0.9.2

* feat: Implement enhanced traffic monitoring system with data compression and sampling

- Introduced `useTrafficMonitorEnhanced` hook for advanced traffic data management.
- Added `TrafficDataSampler` class for handling raw and compressed traffic data.
- Implemented reference counting to manage data collection based on component usage.
- Enhanced data validation with `SystemMonitorValidator` for API responses.
- Created diagnostic tools for monitoring performance and error tracking.
- Updated existing hooks to utilize the new enhanced monitoring features.
- Added utility functions for generating and formatting diagnostic reports.

* feat(ipc): improve URL encoding and error handling for IPC requests

- Add percent-encoding for URL paths to handle special characters properly
- Enhance error handling in update_proxy with proper logging
- Remove excessive debug logging to reduce noise
- Update kode-bridge dependency to v0.1.5
- Fix JSON parsing error handling in PUT requests

Changes include:
- Proper URL encoding for connection IDs, proxy names, and test URLs
- Enhanced error handling with fallback responses in updateProxy
- Comment out verbose debug logs in traffic monitoring and data validation
- Update dependency version for improved IPC functionality

* feat: major improvements in architecture, traffic monitoring, and data validation

* Refactor traffic graph components: Replace EnhancedTrafficGraph with EnhancedCanvasTrafficGraph, improve rendering performance, and enhance visual elements. Remove deprecated code and ensure compatibility with global data management.

* chore: update UPDATELOG.md for v2.4.0 release, refine traffic monitoring system details, and enhance IPC functionality

* chore: update UPDATELOG.md to reflect removal of deprecated MihomoManager and unify IPC control

* refactor: remove global traffic service testing method from cmds.ts

* Update src/components/home/enhanced-canvas-traffic-graph.tsx

* Update src/hooks/use-traffic-monitor-enhanced.ts

* Update src/components/layout/layout-traffic.tsx

* refactor: remove debug state management from LayoutTraffic component

---------
2025-07-24 00:49:55 +08:00
Dyna
f580409ade add: Verge Version copy button (#4164) 2025-07-23 11:11:34 +08:00
Dyna
5047b0f614 fix: the problem of inconsistent color of system theme window (#4133)
* fix-title

* Update UPDATELOG.md
2025-07-22 11:01:23 +08:00
Dyna
f2317c7816 fix: log levels will not display their respective logs correctly (#4074)
* fix-log levels will not display their respective logs correctly

* fix-logs

* Update UPDATELOG.md

* Update UPDATELOG.md
2025-07-15 18:55:53 +08:00
Tunglies
077f3e79f8 fix: unify startup shortcut name to "Clash Verge" on Windows 2025-07-14 04:22:06 +08:00
Dyna
1d49d79af2 fix: the crash when inputting special characters in the search box (#4026)
* add special character escapes

* update logs
2025-07-10 13:34:37 +08:00
Dyna
4ccb17dde6 fix: the problem that the DNS override nameserver-policy field cannot correctly recognize multiple writing methods (#4011)
* fix: the problem that the DNS override nameserver-policy field cannot correctly recognize multiple writing methods

* update logs

* fix-dns-viewer.tsx
2025-07-08 17:05:17 +08:00
Dyna
d36c3a83a9 fix:DNS override server support is left blank by default (#3997)
* fix:DNS server support being left blank by default

* update logs
2025-07-06 11:01:05 +08:00
Dyna
553438d219 fix windows installer (#3979)
* add loop detection Clash Verge Lnk

* add delete the window-state.json file .window-state.json file

* add cycle through the registry and delete useless registry entries

* add delete the specified registry path

* update logs
2025-07-04 12:28:15 +08:00
Sukka
954ff53d9b refactor: use React in its intended way (#3963)
* refactor: replace `useEffect` w/ `useLocalStorage`

* refactor: replace `useEffect` w/ `useSWR`

* refactor: replace `useEffect` and `useSWR`. clean up `useRef`

* refactor: use `requestIdleCallback`

* refactor: replace `useEffect` w/ `useMemo`

* fix: clean up `useEffect`

* refactor: replace `useEffect` w/ `useSWR`

* refactor: remove unused `useCallback`

* refactor: enhance performance and memory management in frontend processes

* refactor: improve pre-push script structure and readability

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
Co-authored-by: Tunglies <tunglies.dev@outlook.com>
2025-07-02 23:34:13 +08:00
Tunglies
6e3313f00d chore: remove redundant bug fix section from UPDATELOG.md 2025-06-30 21:11:01 +08:00
Dyna
7b5afb7afe Add cors (#3909)
* add external `cors` control panel

* optimize format

* fix-script.rs

* fix-service.rs

* fix-rs

async_proxy_query.rs

event_driven_proxy.rs

service_ipc.rs

service.rs

sysopt.rs

* lower the prettier version number to 3.5.3

* Revert "lower the prettier version number to 3.5.3"

This reverts commit 0f1c3dfa8a.

* fix: prttier erros

* add developer environment detection and controlled the display of development environment URL

* submit required

* fix-external-controller-cors

* use the custom component ToggleButton to ensure a uniform button style

* fix-tsx

hotkey-viewer.tsx

external-controller-cors.tsx

* fix-bug_report.yml

* remove the annoying title

* fix-write overload problem

* Individual button settings

* fix-setting-clash.tsx

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
Co-authored-by: Tunglies <tunglies.dev@outlook.com>
2025-06-30 20:48:20 +08:00
Tunglies
18ef7f0272 feat: enhance proxy management with caching and refresh logic 2025-06-30 20:14:04 +08:00
Tunglies
47416dd3f8 chore: update UPDATELOG 2025-06-28 20:03:30 +08:00
Tunglies
c11bdd81e9 chore(i18n): add "Saved Successfully" message to English and Chinese locales 2025-06-27 00:32:37 +08:00
Tunglies
f1192c95a8 feat: add notification system with hotkey events and permission handling (#3867)
* feat: add notification system with hotkey events and permission handling

* Add macOS-specific handling for AppHidden notification

Introduces conditional support for the AppHidden notification event,
enabling macOS-specific behavior. Updates the enum and notification
logic to include this platform-specific feature.

Improves macOS user experience by accommodating system-level
application hiding events.

* Implement feature X to enhance user experience and fix bug Y in module Z

* refactor(notification): update notification keys for consistency and clarity

* chore(deps): update dependencies to latest versions
2025-06-26 23:09:07 +08:00
Tunglies
0a8d6e5147 fix: add validation for profile URL format during import 2025-06-23 23:30:33 +08:00
希亚的西红柿
6d519dac1e fix: auto light-weight mode doesn't take effect in silent-start mode (#3875)
* fix: auto light-weight mode does not take effect when silent-start mode is enabled

* refactor: streamline window state retrieval and hiding logic

* fix: add checks for remote name and existence before format check in pre-push hook

* fix: simplify remote checks in pre-push hook to enhance clarity and maintainability

---------

Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
2025-06-23 23:13:31 +08:00
Tunglies
e7461fccab refactor: remove unused macOS tray speed display and improve tray icon handling (#3862)
* refactor: remove unused macOS tray speed display and improve tray icon handling

* refactor: disable macOS specific logging during core initialization

* feat: add linux elevator function to determine privilege escalation command
2025-06-22 16:28:06 +08:00
wonfen
a92872c831 fix: resolve race condition freeze on rapid tray icon clicks in lightweight mode 2025-06-22 15:44:09 +08:00
Tunglies
094feb74ec feat: add new monochrome tray icons for system and tunnel 2025-06-22 15:32:33 +08:00
wonfen
41fc13cfe2 fix: format & update 2025-06-21 22:39:12 +08:00
Dyna
abe914d446 fix the issue that CSS cannot customize background (#3854)
* fixed the issue that css background cannot be used

* update logs

* fix logs
2025-06-21 16:53:10 +08:00
wonfen
cc65ce6812 chore: update to 2.3.2 2025-06-21 10:09:22 +08:00
Just want to protect you
b72f397369 fix the issue of system proxy port being out of sync (#3841)
* repair system proxy port real-time response

* update logs

* fix-logs
2025-06-21 10:03:06 +08:00
wonfen
c423fe90e2 Release 2.3.1 2025-06-18 20:42:13 +08:00
Just want to protect you
623461b649 about tray and silent startup + automatic startup light repair and optimization (#3814)
* fixed the issue that the tray does not display in light mode

* add show main window after exiting light mode

* fix: the issue where other selections could not respond in real time

* Refactored the original silent + self-starting lightweight #3708

* update logs

* fix formatting issues

* fix

* fix nesting

* repair previous formatting issues

* fix: resolve issue with tray not restoring from lightweight mode

* remove the tray display that should not exist

* fix translation field issue

---------

Co-authored-by: Ahao <108321411+xuanyuan0408@users.noreply.github.com>
Co-authored-by: Tunglies <selenvow+github@gmail.com>
2025-06-18 20:00:33 +08:00
Tunglies
c40c1960ed feat: add window-state management and recovery functionality (#3792)
* feat: add window-state management and recovery functionality

* fix: correct file name reference for window-state.json in uninstall section

* fix: remove unused tauri_plugin_window_state import
2025-06-18 02:21:00 +08:00
Tunglies
72c4b9de8a doc: clarify macOS Intel X86 architecture build error message 2025-06-18 01:30:05 +08:00
wonfen
e7d3d7e0ae chore: update changelog 2025-06-17 22:05:03 +08:00
wonfen
9b46c1a991 refactor: unify log output format 2025-06-16 21:03:45 +08:00
wonfen
26acce94a4 feat: add clash_core config validation & auto-fix to default; fixed "No such file or directory (os error 2)" 2025-06-16 20:27:02 +08:00
wonfen
2a0e1e206e Release 2.3.0 2025-06-16 12:01:14 +08:00
Tunglies
032e5bf32e fix: add macOS specific activation policy handling for silent start (#3740)
* fix: add macOS specific activation policy handling for silent start

* fix: resolve abnormal Dock icon launch during macOS silent startup
2025-06-15 05:10:15 +08:00
Just want to protect you
77fb40506f fix the JS script error when escaping special characters to prevent special airport names from causing the script to fail to work (#3717)
* fix the JS script error

* update logs

* remove unused references

* update logs

* fix special escape test

* optimize:unescape of special characters in JS strings

* fix unaligned annotations

---------

Co-authored-by: Ahao <108321411+xuanyuan0408@users.noreply.github.com>
2025-06-13 22:59:48 +08:00
Tunglies
07738dd82d feat: implement lightweight mode state management and initialization #3344, d05952e945 2025-06-11 04:20:50 +08:00
Tunglies
0ebc482698 refactor: update UPDATELOG.md for clarity and organization, enhance security recommendations, and improve known issues section 2025-06-07 10:42:43 +08:00
Tunglies
09969d95de feat: add rustfmt configuration and CI workflow for code formatting
refactor: streamline formatting workflow by removing unused taplo steps and clarifying directory change

refactor: remove unnecessary directory change step in formatting workflow
2025-06-06 22:13:11 +08:00
Tunglies
c3d8ed28a2 fix: update fallback language to English in i18n configuration 2025-06-05 19:34:22 +08:00
Tunglies
7763abf6c2 Revert TCP concurrency
Revert "Added controller translation for TCP concurrency"

This reverts commit c9589fc75d.

Revert "add:tcp concurrency"

This reverts commit 6440f856a2.
2025-06-02 21:44:43 +08:00
Tunglies
9978182cae chore: update version to 2.3.0 and revise release notes 2025-06-02 14:24:02 +08:00
Tunglies
1bcb6646c4 fix: unify default latency test URL and update workflows/backend logic
- All delay test logic, Rust MihomoManager, API, cmds, delay.ts, settings, and group editor now use the Cloudflare 204 test URL
- Fixed outdated URLs in docs and comments
- Fix Github Actions workflow: unexpected neeeds run
2025-06-02 14:07:54 +08:00
Tunglies
b150eb7e64 chore: update CHANGELOG formatting and improve clarity of known issues, fixes, features, optimizations, and removals 2025-06-02 12:50:03 +08:00
Tunglies
d5c0b09a2f fix: update default latency test URL to use HTTPS 2025-06-02 12:41:41 +08:00
Tunglies
a96678caea fix: update Mihomo(Meta) kernel version to 1.19.10 and remove default window size setting 2025-05-31 17:05:55 +08:00
Tunglies
1d4d8aeb2b chore: update UPDATELOG 2025-05-30 20:57:02 +08:00
Ahao
6440f856a2 add:tcp concurrency 2025-05-30 14:05:59 +08:00
Tunglies
c05bd31f6b fix(sysinfo): update verge_version retrieval to use package_info instead of config 2025-05-28 18:50:03 +08:00
Tunglies
9416de6442 fix(config): auto complete and patch secret field when loading config
- Ensure the 'secret' field is present and non-empty during config loading
- Auto-fill with default value if missing to improve compatibility and security
- Update config guard logic for robustness
2025-05-28 17:26:26 +08:00
Shuqiao Zhang
0621a17d17 feat: update Windows shortcut name (#2973)
* feat: update Windows shortcut name

* chore: UPDATELOG

---------

Co-authored-by: Tunglies <tunglies.dev@outlook.com>
2025-05-25 22:17:06 +08:00