Commit Graph

22 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🏳️‍⚧️
5db1253ab8 fix: termux compatibility (#495) 2024-07-26 22:31:17 +08:00
lollipopkit🏳️‍⚧️
87b3b76b0b feat: display cpu model (#477) 2024-07-23 12:03:10 +08:00
lollipopkit
336b11b808 chore: change dart pkg id 2024-06-11 22:06:29 +08:00
lollipopkit
991d91b636 opt.: only calc cpu0 2024-04-09 16:51:00 +08:00
lollipopkit
4fd82afade new: hideTitlebar & cupertinoRoute 2024-04-08 23:43:24 +08:00
lollipopkit
7d2fbde2fe opt.: cpu line chart 2024-04-08 21:31:00 +08:00
lollipopkit
819c53df7e new: cpu line chart 2024-04-08 21:24:00 +08:00
lollipopkit
3c7bb77f3e new: FIFO list impl 2024-04-07 22:55:00 +08:00
lollipopkit
602ef60bf0 opt.: replace first with firstOrNull 2024-03-06 15:33:00 +08:00
lollipopkit
4e6ea086e3 new: only calc non-virt net iface (#295) 2024-03-06 14:59:37 +08:00
lollipopkit
43fb481aee fix: follow system color scheme 2024-01-05 21:00:00 +08:00
lollipopkit
3a3ba4de37 opt. & rm: server detail cards seq 2023-12-25 14:02:46 +08:00
lollipopkit
eb158e63a2 opt.: mem usage 2023-09-13 15:22:48 +08:00
lollipopkit
3475e6ec91 opt.: bsd cpu 2023-08-22 21:18:46 +08:00
lollipopkit
417cb4c89d #43 new: bsd base support 2023-08-22 21:07:17 +08:00
lollipopkit
fe51669369 chore: update l10n 2023-08-18 16:33:16 +08:00
lollipopkit
46cffb836c new & opt.
- new: ssh discontinuity test
- opt.: server cmds
- opt.: check ssh client status before exec cmds
- new: #124 notify on discontinuity
2023-08-17 21:36:00 +08:00
lollipopkit
3405172d76 #90 #91 fix 2023-08-05 12:23:29 +08:00
lollipopkit
1163f2e418 opt.: TimeSeq 2023-07-28 20:21:15 +08:00
lollipopkit
eef38f0949 #74 probably fix 2023-07-21 16:56:50 +08:00
lollipopkit
06be4503ca #24 #25 #33 new: sftp file edit 2023-05-28 18:21:03 +08:00