Commit Graph

60 Commits

Author SHA1 Message Date
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 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
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
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
d5c0b09a2f fix: update default latency test URL to use HTTPS 2025-06-02 12:41:41 +08:00
wonfen
af1689ee07 refactor: add debounce to optimize config updates and provider refresh handling 2025-05-25 21:34:48 +08:00
Ahao
7acbb5da4f updated the shuffling algorithm and added a deduplication detection mechanism (#3521) 2025-05-16 12:26:50 +08:00
Ahao
316e1d4268 fixed the issue of IP field assignment conflict (#3513)
Co-authored-by: Ahao <108321411+xuanyuan0408@users.noreply.github.com>
2025-05-14 23:13:52 +08:00
Ahao
4f86f3c0ec refactored IP detection and added zashboard redirect URL (#3510)
* Fixed the language display size issue and updated the translation synchronously!

* Fixed Russian language display issue

* refactored IP detection and added zashboard redirect URL

---------

Co-authored-by: Ahao <108321411+xuanyuan0408@users.noreply.github.com>
2025-05-14 20:32:45 +08:00
wonfen
4f15bdf74d feat: add IP info request retry mechanism to reduce network errors 2025-04-20 10:34:43 +08:00
TianHua Liu
49c81f6201 fix: the first function call creates multiple axios instances (#3273) 2025-04-07 16:50:53 +08:00
wonfen
1f99cee78b feat: home page 2025-03-14 13:31:34 +08:00
wonfen
e1905aced4 feat: enhance latency test logging and error handling 2025-03-09 04:22:34 +08:00
wonfen
73310b466b fix: correct type declarations for getProxiesInner and getProxyProviders 2025-03-04 02:26:26 +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
wonfen
e72e8ea631 release 2.0.0 2024-11-23 11:34:17 +08:00
Christine.
a59fda512c chore: Replace test URL to support iPv4&iPv6 (#2033) 2024-11-18 00:20:21 +08:00
Chenx Dust
aef96f0d27 feat: support mptcp and smux display (#1995)
Corresponding pull request in mihomo: https://github.com/MetaCubeX/mihomo/pull/1646
2024-11-16 01:35:22 +08:00
huzibaca
cb3bff589f feat: add unified delay 2024-11-05 16:24:58 +08:00
dongchengjie
c648dc6c99 feat: support manual memory cleanup when running in debug mode 2024-06-26 17:44:42 +08:00
Sukka
455892b414 fix(#1203): correct types (#1207) 2024-06-15 19:23:58 +08:00
Sukka
4f5227782a perf: replace Array#map Array#filter chain w/ Array#reduce (#1203) 2024-06-15 12:22:33 +08:00
wonfen
a2d8c894fe Revert "chore: change default test url"
This reverts commit a7cf968d04.
2024-06-03 08:25:06 +08:00
MystiPanda
a7cf968d04 chore: change default test url 2024-06-01 23:14:47 +08:00
MystiPanda
7788f5ae4c Revert "refactor: use axios tauri adapter"
This reverts commit 8092e5c3a8.
2024-05-26 21:18:02 +08:00
MystiPanda
8092e5c3a8 refactor: use axios tauri adapter 2024-05-11 21:54:56 +08:00
dongchengjie
4f7e8116cb feat: url-test支持手动选择、节点组fixed节点使用角标展示 (#840)
* feat: allow manual selection of url-test group

* feat: fixed proxy indicator

* fix: try to fix traffic websocket no longer updating

* fixup: group delay test use defined url
2024-04-09 13:15:45 +08:00
MystiPanda
5e1e09d7bf fix: Custom GLOBAL group display error 2024-02-11 18:27:27 +08:00
MystiPanda
cd92b34ef1 feat: Optimizing Provider Support 2024-01-18 01:02:30 +08:00
MystiPanda
b6d748b414 Revert Use Tauri Http Api 2024-01-15 10:18:04 +08:00
MystiPanda
d01ef48bf0 refactor: Use Tauri Http API 2024-01-14 19:35:03 +08:00
MystiPanda
cbccdf5d93 feat: Support hide group
#214
2024-01-11 12:34:05 +08:00
MystiPanda
f048762fd9 Support upgrade alpha core 2023-12-10 15:57:10 +08:00
MystiPanda
bb985f826e feat: Support update geodata
#37
2023-12-10 15:22:04 +08:00
wonfen
01be65a624 chore: delete clash core, update CI, change profile name, change URL test link 2023-11-22 02:56:47 +08:00
GyDi
69b9944b8e feat: increase the concurrency of latency test 2023-11-01 20:52:38 +08:00
GyDi
f1770711cb feat: support proxy provider update 2023-08-05 21:38:44 +08:00
GyDi
198109cd43 fix: adjust swr option 2023-03-16 17:03:12 +08:00
GyDi
90913d2486 chore: adjust code 2022-12-15 12:22:20 +08:00
GyDi
5e626e2cc5 feat: add use clash hook 2022-11-23 17:44:40 +08:00
GyDi
5fb1afc681 chore: adjust type 2022-11-19 17:22:29 +08:00
GyDi
32095daf90 feat: auto close connection when proxy changed 2022-11-10 01:27:05 +08:00
GyDi
94eebb2dd6 feat: change global mode ui, close #226 2022-10-13 11:54:52 +08:00
GyDi
b8b5d1cb09 fix: api error handle 2022-10-11 22:51:18 +08:00
Priestch
37d8a563c0 fix: typo in api.ts (#207) 2022-09-24 18:48:11 +08:00
GyDi
b6a479355e feat: add rule page 2022-09-18 23:19:02 +08:00
GyDi
59c856fc0e feat: compatible with proxy providers health check 2022-09-04 22:55:54 +08:00
GyDi
786ea17f95 refactor: ts path alias 2022-08-06 02:35:11 +08:00
tianyoulan
30f60f87f4 feat: fix typo 2022-04-28 15:35:17 +08:00