Update server_status_interval_edit view

This commit is contained in:
LollipopKit
2021-10-26 16:05:40 +08:00
parent ad0638b5b3
commit dd3c07f39d
11 changed files with 107 additions and 43 deletions

View File

@@ -73,11 +73,10 @@ class ServerProvider extends BusyProvider {
}
Future<void> startAutoRefresh() async {
Timer.periodic(
Duration(
seconds: locator<SettingStore>()
.serverStatusUpdateInterval
.fetch()!), (_) async {
final duration =
locator<SettingStore>().serverStatusUpdateInterval.fetch()!;
if (duration == 0) return;
Timer.periodic(Duration(seconds: duration), (_) async {
await refreshData();
});
}
@@ -86,12 +85,14 @@ class ServerProvider extends BusyProvider {
_servers.add(genInfo(info));
locator<ServerStore>().put(info);
notifyListeners();
refreshData();
}
void delServer(ServerPrivateInfo info) {
_servers.removeWhere((e) => e.info == info);
locator<ServerStore>().delete(info);
notifyListeners();
refreshData();
}
void updateServer(ServerPrivateInfo old, ServerPrivateInfo newInfo) {
@@ -100,6 +101,7 @@ class ServerProvider extends BusyProvider {
_servers[idx].client = genClient(newInfo);
locator<ServerStore>().update(old, newInfo);
notifyListeners();
refreshData();
}
Future<ServerStatus> _getData(ServerPrivateInfo info, int idx) async {

View File

@@ -3,7 +3,8 @@
class BuildData {
static const String name = "ToolBox";
static const int build = 23;
static const String engine = "Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 18116933e7 (11 days ago) • 2021-10-15 10:46:35 -0700\nEngine • revision d3ea636dc5\nTools • Dart 2.14.4\n";
static const String engine =
"Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 18116933e7 (11 days ago) • 2021-10-15 10:46:35 -0700\nEngine • revision d3ea636dc5\nTools • Dart 2.14.4\n";
static const String buildAt = "2021-10-26 14:18:53.461371";
static const int modifications = 4;
}