mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: netspeed bytes too large
This commit is contained in:
@@ -356,7 +356,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 209;
|
||||
CURRENT_PROJECT_VERSION = 210;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -364,7 +364,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.209;
|
||||
MARKETING_VERSION = 1.0.210;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -486,7 +486,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 209;
|
||||
CURRENT_PROJECT_VERSION = 210;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -494,7 +494,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.209;
|
||||
MARKETING_VERSION = 1.0.210;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -510,7 +510,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 209;
|
||||
CURRENT_PROJECT_VERSION = 210;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -518,7 +518,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.209;
|
||||
MARKETING_VERSION = 1.0.210;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -2,9 +2,9 @@ import 'package:toolbox/core/extension/numx.dart';
|
||||
|
||||
class NetSpeedPart {
|
||||
String device;
|
||||
int bytesIn;
|
||||
int bytesOut;
|
||||
int time;
|
||||
BigInt bytesIn;
|
||||
BigInt bytesOut;
|
||||
BigInt time;
|
||||
NetSpeedPart(this.device, this.bytesIn, this.bytesOut, this.time);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class NetSpeed {
|
||||
_now = newOne;
|
||||
}
|
||||
|
||||
int get timeDiff => _now[0].time - _old[0].time;
|
||||
BigInt get timeDiff => _now[0].time - _old[0].time;
|
||||
|
||||
String speedIn({String? device}) {
|
||||
if (_old[0].device == '' || _now[0].device == '') return '0kb/s';
|
||||
@@ -65,15 +65,15 @@ List<NetSpeedPart> parseNetSpeed(String raw) {
|
||||
return [];
|
||||
}
|
||||
|
||||
final time = int.parse(split[split.length - 1]);
|
||||
final time = BigInt.parse(split[split.length - 1]);
|
||||
final results = <NetSpeedPart>[];
|
||||
for (final item in split.sublist(2, split.length - 1)) {
|
||||
final data = item.trim().split(':');
|
||||
final device = data.first;
|
||||
final bytes = data.last.trim().split(' ');
|
||||
bytes.removeWhere((element) => element == '');
|
||||
final bytesIn = int.parse(bytes.first);
|
||||
final bytesOut = int.parse(bytes[8]);
|
||||
final bytesIn = BigInt.parse(bytes.first);
|
||||
final bytesOut = BigInt.parse(bytes[8]);
|
||||
results.add(NetSpeedPart(device, bytesIn, bytesOut, time));
|
||||
}
|
||||
return results;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 209;
|
||||
static const int build = 210;
|
||||
static const String engine =
|
||||
"Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b06b8b2710 (9 days ago) • 2023-01-23 16:55:55 -0800\nEngine • revision b24591ed32\nTools • Dart 2.19.0 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-02-01 23:33:10.191128";
|
||||
static const int modifications = 2;
|
||||
static const String buildAt = "2023-02-01 23:36:32.789406";
|
||||
static const int modifications = 0;
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ get initCpuStatus => CpuStatus(
|
||||
);
|
||||
get _initNetSpeedPart => NetSpeedPart(
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
BigInt.zero,
|
||||
BigInt.zero,
|
||||
BigInt.zero,
|
||||
);
|
||||
get initNetSpeed => NetSpeed(
|
||||
[_initNetSpeedPart],
|
||||
|
||||
Reference in New Issue
Block a user