Commit Graph

36 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🏳️‍⚧️
9547d92ac5 migrate: flutter 3.32 2025-05-25 17:05:46 +08:00
lollipopkit🏳️‍⚧️
8627ff823f optimization: desktop UI (#747) 2025-05-13 04:57:37 +08:00
lollipopkit🏳️‍⚧️
24d64b835d opt.: app bar
Fixes #727
2025-03-20 20:20:13 +08:00
Noo6
0ae0241800 opt: window title bar (#672)
* opt: window title bar

* rm: `VirtualWindowFrame` on `SettingsPage`
2025-01-10 15:19:03 +08:00
Noo6
d706886343 fix: sftp open file on windows (#633) 2024-11-14 14:24:57 +08:00
lollipopkit🏳️‍⚧️
c062c12a0e opt.: redesigned settings page (#587) 2024-09-21 22:37:42 +08:00
lollipopkit🏳️‍⚧️
38366a2ef3 refactors (#539) 2024-08-16 01:24:43 +08:00
lollipopkit🏳️‍⚧️
e3c885483b opt.: use ssh term to decompress (#519) 2024-08-04 11:40:38 +08:00
lollipopkit🏳️‍⚧️
9db04a60c2 opt.: l10n & fix: write script (#514) 2024-08-03 22:44:21 +08:00
lollipopkit🏳️‍⚧️
432d76f024 fix: builtin editor (#503) 2024-07-28 15:06:34 +08:00
lollipopkit🏳️‍⚧️
d785209eb6 opt.: share on desktop (#405) 2024-06-22 22:50:17 +08:00
lollipopkit
336b11b808 chore: change dart pkg id 2024-06-11 22:06:29 +08:00
lollipopkit
1a3cb09ca2 fix: ssh term (#365) 2024-05-27 11:32:52 +08:00
lollipopkit
04dfede535 opt.: migrate fl_lib 2024-05-14 22:29:37 +08:00
lollipopkit
50d6ed919b opt.: disk size (#252) 2024-01-21 18:01:11 +08:00
lollipopkit
4a93b326db new: more battery data & fix: auto reload 2023-12-20 17:26:04 +08:00
lollipopkit
ee18b85108 opt.: tag switcher 2023-12-15 12:01:55 +08:00
lollipopkit
73752bffc3 opt.: backup & titlebar 2023-12-09 18:48:22 +08:00
lollipopkit
8a3fd342c6 opt.: upgrade linter & fix lint issues 2023-12-06 11:09:05 +08:00
lollipopkit
f2edd14117 fix: sftp mission error display 2023-10-31 18:50:37 +08:00
lollipopkit
6579190ae4 opt: Shares 2023-10-26 10:18:37 +08:00
lollipopkit
8ce2cc579c new: icloud manual 2023-10-17 20:03:55 +08:00
lollipopkit
ef144e27cb opt.: confirm of suspend & etc. 2023-10-05 17:08:21 +08:00
lollipopkit
4d06a52e99 new & opt.
- new: support suspend and WOL #172
- opt.: `execWithPwd` when cancel
- opt.: extentions
2023-09-25 18:51:14 +08:00
lollipopkit
5a9fd74470 opt. 2023-09-23 10:54:42 +08:00
lollipopkit
e928a29353 opt.: no app restart required 2023-09-21 20:08:54 +08:00
lollipopkit
c07958fa73 new: Providers 2023-09-14 15:13:11 +08:00
lollipopkit
278d5984b2 opt. 2023-09-13 14:28:02 +08:00
lollipopkit
269c2a0a10 opt.: backup 2023-09-13 13:05:19 +08:00
lollipopkit
e1284feae6 opt.: more params of editor page 2023-08-28 15:22:12 +08:00
lollipopkit
7abadfb5a6 new & fix
- new: switch of sftp `rm -rf` dir
- fix: sftp upload
- fix: sftp uploading progress
- opt.: editor will save content if is editing file
2023-08-27 00:10:01 +08:00
lollipopkit
536fbedda2 opt.: use new routes 2023-08-23 21:51:50 +08:00
lollipopkit
b5c705a1fe feat: no titlebar on macOS
Fixes #136
2023-08-18 20:01:18 +08:00
lollipopkit
173b7f6362 fix: typo 2023-08-08 18:43:17 +08:00
lollipopkit
0f83d10bfa opt.: cancel sftp mission 2023-07-29 18:24:22 +08:00