Commit Graph

67 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 b9831357e462e0f308d11a9a53cb718f98ae1295.

* 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
wonfen
628de70e89 chore: remove unused imports 2025-06-23 00:09:17 +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
wonfen
5a0eb56f70 feat: add AppDataProvider for centralized app data management and optimized refresh logic 2025-03-26 13:26:32 +08:00
wonfen
f18202a3a4 refactor: improve webSocket connection handling and error recovery 2025-03-09 04:22:01 +08:00
wonfen
f948da748e fix: connections page traffic calculation 2025-02-19 02:24:21 +08:00
wonfen
0122e2bdcf feat: Add persistent column width settings for connection table & process filtering 2025-02-18 11:04:22 +08:00
wonfen
f0331ec2d9 feat: Add pause/resume functionality for connection tracking 2025-02-18 08:14:09 +08:00
wonfen
3b4013a1b0 fix: resolve deprecated warnings in console 2025-02-18 07:10:28 +08:00
wonfen
db593fb188 feat: Optimize UI layout and page hierarchy 2025-02-07 09:13:30 +08:00
huzibaca
2737fb2d87 fix: when the window is hidden, close the websocket connection, reduce the risk of memory leaks 2024-12-07 16:47:41 +08:00
huzibaca
922020c57a Merge branch 'fix-migrate-tauri2-errors'
* fix-migrate-tauri2-errors: (288 commits)

# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.yml
2024-11-24 00:14:46 +08:00
huzibaca
95c6578911 fix incorrect usage of useCustomTheme 2024-10-29 09:07:08 +08:00
dongchengjie
753395965a chore: tooltips and locales 2024-06-26 05:33:06 +08:00
Sukka
b6ea73af83 fix(#1226): missing conn unsub (#1228) 2024-06-17 13:36:35 +08:00
Sukka
1fa3ffb1ff refactor(connections): use swr subscription (#1226) 2024-06-17 13:14:36 +08:00
dongchengjie
e70249cb2e chore: missing locale 2024-06-11 16:19:25 +08:00
Sukka
3a9a1439d9 refactor: simplify useConnectionSetting (#1141) 2024-06-07 17:23:53 +08:00
Sukka
2725322fd5 refactor: replace recoil (#1137) 2024-06-07 12:27:37 +08:00
dongchengjie
224b2ef952 chore: improve UI in connections page 2024-06-02 21:52:31 +08:00
aixiao0621
90a83dc753 fix: a display error on the connections page 2024-06-02 17:26:23 +08:00
dongchengjie
a371cd1d79 chore: update locale in connection 2024-05-20 13:42:45 +08:00
dongchengjie
4a67e1021a chore: fix select component bg in connection 2024-05-18 18:42:51 +08:00
dongchengjie
4f740acabd chore: use search-box in logs and connections 2024-05-17 19:44:42 +08:00
dongchengjie
0686781359 feat: Clash配置、Merge配置提供JSON Schema语法支持、[连接]界面调整 (#887) 2024-04-17 21:19:37 +08:00
cismous
ca8e3179bb Style filter input (#724)
* refactor: reduce duplicate code

* style: add a white background to the light color theme to avoid the gray text being too light
2024-03-30 01:14:03 +08:00
wonfen
5c3dab3466 Sytle: A little tweak 2024-03-13 14:09:08 +08:00
MystiPanda
7186575cb1 style: fix styles 2024-03-10 23:47:12 +08:00
MystiPanda
a5aec2d9fa Adjust styles 2024-03-10 11:12:54 +08:00
wonfen
8781c5db8d Sytle: UI improvement 2024-01-20 16:05:01 +08:00
MystiPanda
8fc4b338c2 Revert Use Tauri Websocket 2024-01-15 10:17:00 +08:00
MystiPanda
6d3ea19ac5 fix: Fix connections sort issue and add total traffic info 2024-01-15 00:46:19 +08:00
MystiPanda
71103bb7b9 refactor: Use Tauri WebSocket 2024-01-14 17:30:18 +08:00
wonfen
7a7f5cd4a8 Style: UI improvement & 1.4.6 ready 2024-01-09 13:57:53 +08:00
wonfen
ac1fa7209c update clashmeta core, Imporve UI, merge PR, reset icons, fix CI 2023-11-28 07:49:44 +08:00
wonfen
ec50b1d67a chore: UI adjustment, add translation, fix CI 2023-11-22 14:52:14 +08:00
wonfen
bd39e98c66 Merge remote-tracking branch 'nyanpasu/main' 2023-11-22 06:48:30 +08:00
GyDi
1950cf5f99 fix: page null exception, close #821 2023-10-30 00:53:24 +08:00
keiko233
c8cf179ed9 feat: add Connections Info to ConnectionsPage
*Add Upload Traffic, Download Traffic and Active Connections to ConnectionsPage.
*IConnections uploadTotal and downloadTotal data missing not displayed, add it to ConnectionsPage interface here.
2023-10-10 17:05:31 +08:00
GyDi
2ce944034d feat: supports show connection detail 2023-08-05 16:52:14 +08:00
GyDi
5a65a07a39 fix: connections is null 2023-06-30 09:02:17 +08:00
GyDi
7bc7bc7c49 fix: encodeURIComponent secret 2023-06-29 14:15:57 +08:00
GyDi
1e5b5193fe fix: adjust style 2023-03-16 19:32:59 +08:00
GyDi
16490541e4 fix: infinite retry when websocket error 2023-03-16 17:03:00 +08:00
GyDi
5e626e2cc5 feat: add use clash hook 2022-11-23 17:44:40 +08:00
GyDi
dace993c21 refactor: adjust base components export 2022-11-20 22:03:55 +08:00
GyDi
5fb1afc681 chore: adjust type 2022-11-19 17:22:29 +08:00
GyDi
2cdc11c2ad fix: icon button color inherit 2022-10-16 14:40:45 +08:00
GyDi
18edf06a20 fix: disable spell check 2022-09-28 14:15:22 +08:00
GyDi
008b92acb2 feat: show connections with table layout 2022-09-25 01:35:21 +08:00