GT610 7693e30cbf opt: Better performance on server refreshing (#999)
* refactor(server): Replace Future.wait with an explicit list of futures to enhance readability

Refactor the nested map and async functions into explicit for loops and future lists to make the code logic clearer

* fix(server): Fixed the auto-refresh logic and concurrency control issues

- Add `_refreshCompleter` to prevent concurrent refreshes
- Fixed the issue where the status was not updated after the automatic refresh timer was canceled
- Remove the invalid check for `duration == 1`

* refactor(server): Optimize the server refresh logic by filtering out servers that do not need to be refreshed in advance

Move the server filtering logic outside the loop and use the `where` method to filter the servers that need to be refreshed, avoiding repeated condition checks within the loop. This improves code readability and reduces redundant condition checks.

* refactor: Optimize server refresh logic to enhance readability

Break down complex conditional checks into clearer steps, separating the logic for server refresh and rate limiter reset. Replace chained calls with explicit loops to make the code easier to maintain and understand.

* refactor(server): Remove `updateFuture` from `ServerState` and use the `_isRefreshing` flag instead

Simplify the server refresh logic, replace Future state tracking with a boolean flag, and avoid unnecessary state updates

* refactor(server_detail): Extract the setting items as local variables to improve performance

Extract the globally set items that are accessed repeatedly as local variables, reduce unnecessary state retrieval operations, and optimize page performance

* refactor: Rename `_displayCpuIndexSetting` to `_displayCpuIndex` for consistency

* refactor(server): Fix the issue of parallel blocking in server refresh

The original code uses Future.wait to wait for all refresh operations to complete, but in fact, there is no need to wait for the results of these operations. Instead, directly calling ignore() to ignore the results can avoid blocking caused by the slowest server

* fix: Adjust the order of logging and default value settings

Ensure to set the default value after recording the invalid duration warning

* refactor(server): Rename _refreshCompleter to _refreshInProgress to enhance readability

Change the variable name from `_refreshCompleter` to `_refreshInProgress`, so that it more accurately reflects the actual purpose of the variable, which is to indicate whether the refresh operation is in progress

* refactor(server): Remove unnecessary refresh progress status management

Simplify the server refresh logic, remove the unused _refreshInProgress state variable and related Completer handling, making the code more concise and straightforward

* chore: Update dependent package versions

Update the following dependent package versions:
- camera_web has been upgraded from 0.3.5 to 0.3.5+3
- ffi has been upgraded from 2.1.4 to 2.1.5
- hive_ce_flutter is upgraded from 2.3.3 to 2.3.4
- watcher is upgraded from 1.1.4 to 1.2.1

* opt.

---------

Co-authored-by: lollipopkit🏳️‍⚧️ <10864310+lollipopkit@users.noreply.github.com>
2026-01-14 13:47:06 +08:00
2024-07-10 15:12:05 +08:00
2023-06-05 16:50:22 +08:00
2026-01-14 13:32:30 +08:00
2025-08-08 16:56:36 +08:00
2026-01-14 13:32:30 +08:00
2025-03-22 01:27:17 +08:00
2025-09-02 19:41:56 +08:00
2024-06-01 22:36:02 +08:00
2025-08-17 17:56:26 +08:00
2025-10-19 13:40:17 +08:00
2025-08-09 12:45:45 +08:00
2026-01-14 13:32:30 +08:00

English | 简体中文

Flutter Server Box

donate lang license Ask DeepWiki

A Flutter project which provides charts to display Linux, Unix and Windows server status and tools to manage servers.
Especially thanks to dartssh2 & xterm.dart.

🏙️ Screenshots

📥 Installation

Platform From
iOS / macOS AppStore
Android GitHub / CDN / F-Droid / OpenAPK
Linux / Windows GitHub / CDN

Please only download pkgs from the source that you trust!

🔖 Features

  • Status chart (CPU, Sensors, GPU...), SSH Term, SFTP, Docker & Process & Systemd, S.M.A.R.T...
  • Platform specific: Bio authMsg pushHome widgetwatchOS App...
  • English, 简体中文; Deutsch @its-tom, 繁體中文 @kalashnikov, Indonesian @azkadev, Français @FrancXPT, Dutch @QazCetelic, Türkçe @mikropsoft, Українська мова @CakesTwix; Español, Русский язык, Português, 日本語 (Generated by GPT)

🆘 Help

qq donate discord
  • In order to push server status to your portable device without opening ServerBox app (Such as message push and home widget), you need to install ServerBoxMonitor on your servers, and config it correctly. See wiki for more details.
  • Common issues can be found in app wiki.

Before you open an issue, please read the following:

  1. Paste the entire log (click the top right of the home page) in the issue template.
  2. Make sure whether the issue is caused by ServerBox app.
  3. Welcome all valid and positive feedback, subjective feedback (such as you think other UI is better) may not be accepted.

After you read the above, you can open an issue.

🧱 Contributions

Any positive contribution is welcome.

If I forgot to add your name to the contributors list, please add a comment in the issue or PR you opened to let me know, I will add it as soon as possible.

Development

  1. Setup Flutter environment.
  2. Clone this repo, run flutter run to start the app.
  3. Run dart run fl_build -p PLATFORM to build the app.

Translation

  • Guide can be found in my blog.
  • We need your help! Just feel free to open a PR.

💡 My other apps

  • GPT Box - A third-party GPT Client for OpenAI API on all platforms.
  • More - Tools & etc.

📝 License

AGPL v3 lollipopkit & all contributors

Description
No description provided
Readme AGPL-3.0 23 MiB
Languages
Dart 91.1%
Swift 3.9%
Kotlin 2.1%
C++ 1.5%
CMake 1.1%
Other 0.2%