Commit Graph

57 Commits

Author SHA1 Message Date
Tunglies
1176f8c863 feat: refactor app data provider and context for improved data management and performance 2025-10-04 21:20:31 +08:00
Tunglies
8a4f2de887 Revert "Refactor components to remove forwardRef and simplify props handling"
This reverts commit 1cd013fb94.
2025-09-30 18:13:02 +08:00
Tunglies
1cd013fb94 Refactor components to remove forwardRef and simplify props handling
- Updated multiple components to remove the use of forwardRef, simplifying the props structure.
- Adjusted imports and component definitions accordingly.
- Ensured consistent handling of refs and props across various viewer components.
- Improved readability and maintainability of the codebase.
2025-09-30 14:26:40 +08:00
Tunglies
627119bb22 Refactor imports and improve code organization across multiple components and hooks
- Consolidated and reordered imports in various files for better readability and maintainability.
- Removed unused imports and ensured consistent import styles.
- Enhanced the structure of components by grouping related imports together.
- Updated the layout and organization of hooks to streamline functionality.
- Improved the overall code quality by following best practices in import management.
2025-09-18 23:34:38 +08:00
Tunglies
475a09bb54 feat: comprehensive oxlint cleanup - remove unused code
🧹 Cleanup Summary:
- Fixed 83 oxlint warnings across 50+ files
- Removed unused imports, variables, and functions
- Maintained all functional code and error handling
- Improved bundle size and code maintainability

📝 Key Changes:
- Cleaned unused React hooks (useState, useEffect, useClashInfo)
- Removed unused Material-UI imports (useTheme, styled components)
- Deleted unused interfaces and type definitions
- Fixed spread operator usage and boolean casting
- Simplified catch parameters where appropriate

🎯 Files Modified:
- React components: home.tsx, settings, profiles, etc.
- Custom hooks: use-*.ts files
- Utility functions and type definitions
- Configuration files

 Result: 0 oxlint warnings (from 83 warnings)
🔧 All functionality preserved
📦 Reduced bundle size through dead code elimination
2025-08-22 18:48:56 +08:00
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
fee08f3826 fix: correct address display error caused by async system proxy retrieval 2025-06-22 23:19:11 +08:00
wonfen
034885d810 feat: introduce event-driven proxy manager and optimize proxy config updates 2025-06-21 21:56:15 +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
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
dc798fe2dd chore: update deps & replace deprecated elements 2025-05-05 00:26:04 +08:00
wonfen
8296675574 refactor: notification system 2025-05-04 22:17:08 +08:00
wonfen
dbfcc80afe perf: optimize system proxy settings update logic 2025-04-30 23:09:19 +08:00
逐雁南飛
ffc0693afc [修复]修改代理设置后,如果修改之前代理是开启状态,自动重新应用代理设置。 (#3391)
* [修复]修改代理设置后,如果修改之前代理是开启状态,自动重新应用代理设置。

* chore: update sysproxy version

---------

Co-authored-by: Tunglies <tunglies.dev@outlook.com>
2025-04-24 01:10:01 +08:00
逐雁南飛
ae4067aee6 [feat]取消使用默认绕过且当绕过设置为空的时候使用默认绕过填充绕过配置以便用户基于默认配置修改。 (#3365) 2025-04-17 17:12:58 +08:00
逐雁南飛
b70cad537c 添加代理主机的设置,允许代理设置为其他IP(非127.0.0.1) (#2963)
允许下拉选择ip地址(支持IPv6)、localhost、以及当前系统的主机名,同时兼容手工输入
2025-04-17 16:47:21 +08:00
huzibaca
a51191c661 chore: update default_bypass
1. add 172.29.0.0/16
2024-12-23 06:06:46 +08:00
huzibaca
4f4fe4c41c feat: improve system bypass settings 2024-12-10 14:37:11 +08:00
huzibaca
2a4a3c8250 chore: enable default proxy bypass and hide custom bypass settings 2024-12-10 13:59:13 +08:00
lollapalooza
78c2a1694f feat: add bypass check feature (#2272) 2024-12-03 16:18:07 +08:00
wonfen
9696c7cec0 style: Increased light color contrast to prevent blurring on some displays 2024-11-26 01:05:30 +08:00
MystiPanda
6853b3c531 fix(#1335): support cidr 2024-07-16 12:22:11 +08:00
MystiPanda
c67eee57d6 Revert "fix: try to fix abnormal stuck"
This reverts commit 7edbae7b4c.
2024-07-14 12:49:06 +08:00
Sukka
607aa78059 fix(#1387): avoid catastrophic backtracking (#1396) 2024-07-14 12:26:02 +08:00
MystiPanda
7edbae7b4c fix: try to fix abnormal stuck
#1387
2024-07-13 21:41:04 +08:00
MystiPanda
d9d9ca67cd chore: unified icon style 2024-07-13 19:01:16 +08:00
MystiPanda
a865465514 feat: get network interface 2024-07-07 18:13:10 +08:00
MystiPanda
8690b91632 chore: disable browser autocomplete 2024-07-07 11:16:59 +08:00
MystiPanda
46ee783f99 fix: bypass reg error
#1335
2024-07-06 18:23:23 +08:00
dongchengjie
bf158b3bf0 refactor: editor-viewer using react-monaco-editor 2024-07-02 21:02:29 +08:00
MystiPanda
c424e9dec8 chore: disable autocomplete 2024-07-02 19:02:05 +08:00
MystiPanda
d81ef1d67c feat: allow set bypass without using default value 2024-07-01 22:53:32 +08:00
dongchengjie
80d3c9e96f feat: reactive after save when profile content changes 2024-06-29 09:21:50 +08:00
dongchengjie
4f1b8094a3 chore: cleanup 2024-06-26 08:24:43 +08:00
dongchengjie
c89ccf7185 refactor: extract tooltip icon as component 2024-06-26 08:10:18 +08:00
dongchengjie
753395965a chore: tooltips and locales 2024-06-26 05:33:06 +08:00
MystiPanda
3083ab74a6 fix: reg error 2024-06-17 16:38:30 +08:00
MystiPanda
973e269f46 fix: fix bypass check regex 2024-06-14 21:23:58 +08:00
MystiPanda
bf35c92c14 feat: check bypass format 2024-06-09 13:37:47 +08:00
dongchengjie
46dc40149e chore: missing locale 2024-06-09 11:16:13 +08:00
wonfen
6c6ccda6b3 Style: modify proxy pages 2024-06-07 10:32:27 +08:00
MystiPanda
a88d149dad fix: auto proxy changed by guard 2024-05-26 19:07:14 +08:00
MystiPanda
b9ec94d835 feat: Support PAC Mode 2024-05-26 17:59:39 +08:00
dongchengjie
16b11fee31 chore: text overflow word-wrap & cleanup 2024-05-20 12:38:41 +08:00
dongchengjie
a8a27aeadd chore: current bypass wrap 2024-05-15 22:59:53 +08:00
RikudouPatrickstar
2f7c3cf21e chore: update notification message and zh translation (#1011) 2024-05-12 14:40:18 +08:00
dongchengjie
c545521cd9 chore: Proxy Bypass placeholder (#901) 2024-04-20 19:27:17 +08:00
Amnesiash
3a0429d049 refactor: Upgrade to the new UI (#521)
Co-authored-by: MystiPanda <mystipanda@proton.me>
2024-03-09 21:37:21 +08:00
MystiPanda
ef9bbaca19 revert: Support both registry and api for windows sysproxy 2024-01-20 12:16:46 +08:00
MystiPanda
cb155707cd feat: Support both registry and api for windows sysproxy 2024-01-16 15:11:53 +08:00