Commit Graph

38 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🏳️‍⚧️
ec4bf3df24 opt.: sftp dl 2025-07-21 16:20:27 +08:00
lollipopkit🏳️‍⚧️
7127c960f7 opt.: server detail page columns 2025-06-04 17:29:03 +08:00
lollipopkit🏳️‍⚧️
ddd32e82d4 opt.: migrate to new fl_lib (#649)
Fixes #648
2024-12-02 21:06:44 +08:00
lollipopkit🏳️‍⚧️
eb83d05c81 fix: ssh alter url (#554) 2024-08-27 15:22:26 +08:00
lollipopkit🏳️‍⚧️
931c5f0bf6 opt.: alterUrl (#550) 2024-08-25 22:52:47 +08:00
lollipopkit🏳️‍⚧️
38366a2ef3 refactors (#539) 2024-08-16 01:24:43 +08:00
lollipopkit🏳️‍⚧️
195ddd2bcc refactor: SSHClientX.exec 2024-08-15 11:27:22 +08:00
lollipopkit🏳️‍⚧️
267b0b0a69 opt.: sftp home & back (#533) 2024-08-14 19:01:44 +08:00
lollipopkit
336b11b808 chore: change dart pkg id 2024-06-11 22:06:29 +08:00
lollipopkit
faacbe088b feat: auto hide fab 2024-05-09 12:31:59 +08:00
lollipopkit
d0523c1e54 feat: keyboard-interactive auth (#349) 2024-05-07 15:22:31 +08:00
lollipopkit
23764f8c93 readd: jump server 2024-04-21 00:42:00 +08:00
lollipopkit
6c08b7b45d fix: sftp download/upload (#255) 2024-01-26 16:54:48 +08:00
lollipopkit
e57b63a76f opt.: multi process 2024-01-21 15:30:50 +08:00
lollipopkit
1a49c7870c fix: temporarily disable jump server 2023-11-19 14:47:27 +08:00
lollipopkit
f2edd14117 fix: sftp mission error display 2023-10-31 18:50:37 +08:00
lollipopkit
bff799afd9 fix: jump server (#190) 2023-10-30 17:10:29 +08:00
lollipopkit
2b52e8e6ee fix (#195) & opt.
- fix: debug provider color
- fix: can't write script through SFTP (#195)
- opt.: go next refresh only after current refresh task is done
2023-10-30 12:01:07 +08:00
lollipopkit
02be466954 opt.: linux/win window size & server reconnect 2023-10-22 15:47:22 +08:00
lollipopkit
86c6b149d7 fix: windows bakup (#188) 2023-10-22 14:27:31 +08:00
lollipopkit
307ec25524 new: jump serevr (#190) 2023-10-22 14:20:13 +08:00
lollipopkit
eb158e63a2 opt.: mem usage 2023-09-13 15:22:48 +08:00
lollipopkit
f4b6326652 new: custom timeout 2023-08-30 19:07:32 +08:00
lollipopkit
1af7271a06 fix: alterUrl will change spi's props 2023-08-13 21:19:16 +08:00
lollipopkit
3405172d76 #90 #91 fix 2023-08-05 12:23:29 +08:00
lollipopkit
91967e6ce3 #87 new: auto ask add system key (~/.ssh/id_rsa) 2023-08-04 21:46:44 +08:00
lollipopkit
e13c5910ec #78 opt.: alter url 2023-07-29 16:53:57 +08:00
lollipopkit
6045e7e7f0 fix: sftp dl 2023-07-28 19:08:34 +08:00
lollipopkit
389d1753c4 #78 new: alter host 2023-07-28 13:59:32 +08:00
lollipopkit
92ffed6541 #25 new: sftp upload 2023-05-30 19:49:54 +08:00
lollipopkit
b4f3fce64a #30 fix: context.pop() 2023-05-09 19:49:31 +08:00
lollipopkit
19baff5dde opt. & fix.
fix: setting page update item display issue.
fix: `bgRun` condition issue.
opt: `r_upgrade` use 0.3.8+2
2023-04-04 17:38:00 +08:00
lollipopkit
58b950f814 #14 add ssh log 2023-03-15 13:37:19 +08:00
lollipopkit
5666a23e00 #12 new: custom theme mode 2023-02-25 19:58:37 +08:00
lollipopkit
2986f80f89 opt: auto rm pwd in key page for safe 2023-02-21 17:12:01 +08:00
lollipopkit
2faea10d61 server connect: max try 7 times 2023-02-01 13:34:45 +08:00
lollipopkit
4d741ac82a fix & opt
fix: android in-app upgrade
fmt: proj struct
opt: fetch primaryColor
2023-02-01 12:52:40 +08:00