Commit Graph

48 Commits

Author SHA1 Message Date
GT610
d14e97485f refactor: Optimize process page (#1017)
* refactor(process): Optimize the sorting logic of the process list and add a data integrity check flag

Add the `_checkedIncompleteData` flag to avoid repeatedly checking data integrity

Change `_sortModes` to a final variable and initialize it using `List.from`

Remove unnecessary calls to `_timer.cancel`

* refactor(process): Remove unused focus states and refactor process item operations

Move the stop operation of the process item to the tail button, and remove the focus state-related code that is no longer used

* fix(process): Fix the layout of the process page and the stop confirmation dialog box

Adjust the spacing condition between CPU and memory display, and only add spacing when both are present

Modify the confirmation dialog for stopping the process, and add a cancel button to provide a better user experience

* refactor(process): Merge duplicate sorting mode removal logic

Combine two separate `removeWhere` calls into one, simplifying the code and enhancing readability
2026-01-22 00:22:23 +08:00
lollipopkit🏳️‍⚧️
da8517bcf7 migrate: riverpod 3 2025-10-08 17:03:13 +08:00
lollipopkit🏳️‍⚧️
3b7fdf36fb opt. 2025-08-31 23:59:53 +08:00
lollipopkit🏳️‍⚧️
53a7c0d8ff migrate: riverpod + freezed (#870) 2025-08-31 00:55:54 +08:00
lollipopkit🏳️‍⚧️
9c9648656d fix: macOS ssh term unusable (#838) 2025-08-08 18:59:25 +08:00
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🏳️‍⚧️
7127c960f7 opt.: server detail page columns 2025-06-04 17:29:03 +08:00
lollipopkit🏳️‍⚧️
28e34e2183 opt.: editor lang parse 2025-05-14 16:19:26 +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
lollipopkit🏳️‍⚧️
eab06abcaf opt. 2024-09-21 23:12:15 +08:00
lollipopkit🏳️‍⚧️
38366a2ef3 refactors (#539) 2024-08-16 01:24:43 +08:00
lollipopkit🏳️‍⚧️
267b0b0a69 opt.: sftp home & back (#533) 2024-08-14 19:01:44 +08:00
lollipopkit🏳️‍⚧️
e3c885483b opt.: use ssh term to decompress (#519) 2024-08-04 11:40:38 +08:00
lollipopkit🏳️‍⚧️
ea7c8caf14 bug: color seed setting not working (#516) 2024-08-03 23:17:18 +08:00
lollipopkit🏳️‍⚧️
9db04a60c2 opt.: l10n & fix: write script (#514) 2024-08-03 22:44:21 +08:00
lollipopkit🏳️‍⚧️
7a359588db opt.: input field suggestion 2024-07-22 22:03:56 +08:00
lollipopkit🏳️‍⚧️
255abe8b11 rollback: write script to /dev/shm (#474) 2024-07-21 17:58:14 +08:00
lollipopkit🏳️‍⚧️
b0936c5e6e fix: termux compatibility (#472) 2024-07-20 20:35:30 +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
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
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
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
eb158e63a2 opt.: mem usage 2023-09-13 15:22:48 +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
b55b8bf831 opt.: performance 2023-09-07 18:41:18 +08:00
lollipopkit
d9c26e01f4 #148 fix 2023-08-28 19:26:17 +08:00
lollipopkit
e20f2d32e8 #148 fix: alpine process 2023-08-28 17:11:58 +08:00
lollipopkit
e1284feae6 opt.: more params of editor page 2023-08-28 15:22:12 +08:00
lollipopkit
b5c705a1fe feat: no titlebar on macOS
Fixes #136
2023-08-18 20:01:18 +08:00
lollipopkit
c512a6a274 opt. 2023-08-09 23:58:38 +08:00
lollipopkit
693eef8f7e new: animation for process page 2023-08-08 15:21:22 +08:00
lollipopkit
d37a1fbea7 feat: use native ssh terminal on desktop
Implement #109
2023-08-07 16:27:00 +08:00
lollipopkit
2142ae3e1c new: kill process 2023-08-07 15:01:58 +08:00
lollipopkit
fefd3f9701 #54 run multiple snippets 2023-07-08 00:12:15 +08:00
lollipopkit
6d6048bc5c fix 2023-06-27 14:40:10 +08:00
lollipopkit
9ffe5583fd #64 opt. for process page 2023-06-27 12:27:16 +08:00
lollipopkit
f0b31a9b08 #65 new: custom keyboard type 2023-06-23 16:59:27 +08:00
lollipopkit
743e5bfbff #64 new: process page 2023-06-23 14:30:35 +08:00