Files
flutter_server_box/README_zh.md
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

4.1 KiB
Raw Blame History

简体中文 | English

Flutter Server Box

donate 语言 license Ask DeepWiki

使用 Flutter 开发的 Linux, Unix, Windows 服务器工具箱,提供服务器状态图表和管理工具。
特别感谢 dartssh2 & xterm.dart

🏙️ 截屏

📥 安装

平台 下载
iOS / macOS AppStore
Android GitHub / CDN / F-Droid / OpenAPK
Linux / Windows GitHub / CDN

请从 信任 的来源下载!

🔖 特点

  • 状态图表CPU、传感器、GPU 等), SSH 终端, SFTP, Docker & 进程 & Systemd 管理,S.M.A.R.T...
  • 特殊支持:生物认证推送桌面小部件watchOS App跟随系统颜色...
  • 本地化

🆘 帮助

qq donate discord
  • 为了可以在不使用 ServerBox app 时获取服务器状态(例如:桌面小部件、推送服务),你需要在你的服务器上安装 ServerBoxMonitor,详情见 wiki
  • 常见问题 可以在 app wiki 查看。

反馈前须知:

  1. 反馈问题请附带 log点击首页右上角并以 bug 模版提交。
  2. 反馈问题前请检查是否是 serverbox 的问题。
  3. 欢迎所有有效、正面的反馈主观比如你觉得其他UI更好看的反馈不一定会接受

🧱 贡献

任何正面的贡献都欢迎。

开发

  1. 安装 Flutter
  2. 克隆这个仓库, 运行 flutter run 启动应用
  3. 运行 dart run fl_build -p PLATFORM 构建应用

翻译

指南 可在我的博客中找到。

💡 我的其它 Apps

  • GPT Box - 支持 OpenAI API 的 第三方全平台客户端。
  • 更多 - 工具 & etc.

📝 协议

GPL v3 lollipopkit