Commit Graph

14 Commits

Author SHA1 Message Date
lollipopkit🏳️‍⚧️
3a615449e3 feat: Windows compatibility (#836)
* feat: win compatibility

* fix

* fix: uptime parse

* opt.: linux uptime accuracy

* fix: windows temperature fetching

* opt.

* opt.: powershell exec

* refactor: address PR review feedback and improve code quality

### Major Improvements:
- **Refactored Windows status parsing**: Broke down large `_getWindowsStatus` method into 13 smaller, focused helper methods for better maintainability and readability
- **Extracted system detection logic**: Created dedicated `SystemDetector` helper class to separate OS detection concerns from ServerProvider
- **Improved concurrency handling**: Implemented proper synchronization for server updates using Future-based locks to prevent race conditions

### Bug Fixes:
- **Fixed CPU percentage parsing**: Removed incorrect '*100' multiplication in BSD CPU parsing (values were already percentages)
- **Enhanced memory parsing**: Added validation and error handling to BSD memory fallback parsing with proper logging
- **Improved uptime parsing**: Added support for multiple Windows date formats and robust error handling with validation
- **Fixed division by zero**: Added safety checks in Swap.usedPercent getter

### Code Quality Enhancements:
- **Added comprehensive documentation**: Documented Windows CPU counter limitations and approach
- **Strengthened error handling**: Added detailed logging and validation throughout parsing methods
- **Improved robustness**: Enhanced BSD CPU parsing with percentage validation and warnings
- **Better separation of concerns**: Each parsing method now has single responsibility

### Files Changed:
- `lib/data/helper/system_detector.dart` (new): System detection helper
- `lib/data/model/server/cpu.dart`: Fixed percentage parsing and added validation
- `lib/data/model/server/memory.dart`: Enhanced fallback parsing and division-by-zero protection
- `lib/data/model/server/server_status_update_req.dart`: Refactored into 13 focused parsing methods
- `lib/data/provider/server.dart`: Improved synchronization and extracted system detection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: parse & shell fn struct

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-08 16:56:36 +08:00
lollipopkit🏳️‍⚧️
0c1ada0067 fix: cloud sync (#769) 2025-06-04 00:11:31 +08:00
lollipopkit🏳️‍⚧️
7ce3854392 opt.: use json_serializable 2024-08-15 16:44:13 +08:00
lollipopkit🏳️‍⚧️
267b0b0a69 opt.: sftp home & back (#533) 2024-08-14 19:01:44 +08:00
lollipopkit
b55b8bf831 opt.: performance 2023-09-07 18:41:18 +08:00
lollipopkit
806a223e00 fix: tag changed without saving 2023-09-06 20:54:17 +08:00
lollipopkit
d88a078cd6 rm: field password of PrivateKeyInfo 2023-08-04 23:47:22 +08:00
lollipopkit
91967e6ce3 #87 new: auto ask add system key (~/.ssh/id_rsa) 2023-08-04 21:46:44 +08:00
calvin
486b920d6b DRAFT:Add support of reading system privatekey (.ssh/id_rsa) 2023-08-04 18:41:04 +08:00
lollipopkit
20ef9d4575 opt. 2023-05-26 17:01:52 +08:00
lollipopkit
3f9f589178 constraint: share_plus 6.3.2 2023-05-08 17:43:25 +08:00
Junyuan Feng
398c49bb99 使用 Hive Object 2022-11-05 23:08:56 +08:00
LollipopKit
2eb6e19a86 Init snippet page and store 2021-10-31 15:22:05 +08:00
LollipopKit
6db223ec5a Change model dir structure 2021-10-28 21:04:59 +08:00