diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ef741242..14943cee 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -87,4 +87,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 7fb15c416f8685fca4966867a8da218ec592ec2e -COCOAPODS: 1.12.1 +COCOAPODS: 1.13.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 21b80522..8a698cad 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -586,7 +586,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -596,7 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -720,7 +720,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -730,7 +730,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -748,7 +748,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -758,7 +758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -779,7 +779,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -792,7 +792,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -818,7 +818,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -831,7 +831,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -854,7 +854,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -867,7 +867,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -890,7 +890,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -902,7 +902,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -931,7 +931,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -943,7 +943,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -969,7 +969,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -981,7 +981,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/StatusWidgetExtension.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/StatusWidgetExtension.xcscheme index 4f3f08c5..71c5376f 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/StatusWidgetExtension.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/StatusWidgetExtension.xcscheme @@ -90,6 +90,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/lib/data/model/app/shell_func.dart b/lib/data/model/app/shell_func.dart index 6cd66382..120a2e1b 100644 --- a/lib/data/model/app/shell_func.dart +++ b/lib/data/model/app/shell_func.dart @@ -192,7 +192,7 @@ const _statusCmds = [ 'uptime', 'cat /proc/net/snmp', 'df -h', - 'cat /proc/meminfo', + 'cat /proc/meminfo | grep Mem', 'cat /sys/class/thermal/thermal_zone*/type', 'cat /sys/class/thermal/thermal_zone*/temp', 'hostname', diff --git a/lib/data/model/server/memory.dart b/lib/data/model/server/memory.dart index 7cd152a4..c2f75489 100644 --- a/lib/data/model/server/memory.dart +++ b/lib/data/model/server/memory.dart @@ -1,13 +1,11 @@ class Memory { final int total; final int free; - final int cache; final int avail; const Memory({ required this.total, required this.free, - required this.cache, required this.avail, }); @@ -46,16 +44,6 @@ Memory parseMem(String raw) { '0', ) ?? 0; - final cached = int.tryParse( - items - .firstWhere( - (e) => e?.group(1) == 'Cached:', - orElse: () => null, - ) - ?.group(2) ?? - '0', - ) ?? - 0; final available = int.tryParse( items .firstWhere( @@ -70,7 +58,6 @@ Memory parseMem(String raw) { return Memory( total: total, free: free, - cache: cached, avail: available, ); } diff --git a/lib/data/model/server/system.dart b/lib/data/model/server/system.dart index d5719f34..ce41cada 100644 --- a/lib/data/model/server/system.dart +++ b/lib/data/model/server/system.dart @@ -20,12 +20,14 @@ enum SystemType { return null; } - bool isSegmentsLenMatch(int len) { + bool isSegmentsLenMatch(int len) => len == segmentsLen; + + int get segmentsLen { switch (this) { case SystemType.linux: - return len == StatusCmdType.values.length; + return StatusCmdType.values.length; case SystemType.bsd: - return len == BSDStatusCmdType.values.length; + return BSDStatusCmdType.values.length; } } } diff --git a/lib/data/provider/server.dart b/lib/data/provider/server.dart index 7e962b1a..639e4923 100644 --- a/lib/data/provider/server.dart +++ b/lib/data/provider/server.dart @@ -313,7 +313,8 @@ class ServerProvider extends ChangeNotifier { } /// Keep [finished] state, or the UI will be refreshed to [loading] state - /// instead of the 'Temp & Uptime'. + /// instead of the '$Temp | $Uptime'. + /// eg: '32C | 7 days' if (s.state != ServerState.finished) { _setServerState(s, ServerState.loading); } @@ -330,7 +331,8 @@ class ServerProvider extends ChangeNotifier { final systemType = SystemType.parse(segments[0]); if (systemType == null || !systemType.isSegmentsLenMatch(segments.length)) { _limiter.inc(sid); - s.status.failedInfo = 'Segments not match: ${segments.length}'; + s.status.failedInfo = + 'Segments not match: expect ${systemType?.segmentsLen}, got ${segments.length}'; _setServerState(s, ServerState.failed); return; } diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index b6a518f9..77deb8b4 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 580; + static const int build = 585; static const String engine = "3.13.6"; - static const String buildAt = "2023-10-05 19:51:55"; - static const int modifications = 4; - static const int script = 19; + static const String buildAt = "2023-10-13 11:50:42"; + static const int modifications = 8; + static const int script = 20; } diff --git a/lib/data/res/status.dart b/lib/data/res/status.dart index 0e8cdfed..a52df3f8 100644 --- a/lib/data/res/status.dart +++ b/lib/data/res/status.dart @@ -40,7 +40,6 @@ class InitStatus { mem: const Memory( total: 1, free: 1, - cache: 0, avail: 1, ), sysVer: 'Loading...', diff --git a/lib/view/page/editor.dart b/lib/view/page/editor.dart index 43e289ad..cc5f333d 100644 --- a/lib/view/page/editor.dart +++ b/lib/view/page/editor.dart @@ -60,9 +60,9 @@ class _EditorPageState extends State { if (Stores.setting.editorHighlight.fetch()) { _langCode = widget.langCode ?? Highlights.getCode(widget.path); } - _controller = CodeController( - language: Highlights.all[_langCode], - ); + _controller = CodeController( + language: Highlights.all[_langCode], + ); /// TODO: This is a temporary solution to avoid the loading stuck Future.delayed(const Duration(milliseconds: 377)).then((value) async { diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index a6dd7b6e..ea0934ff 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -476,9 +476,9 @@ baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -491,9 +491,9 @@ baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -506,9 +506,9 @@ baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 580; + CURRENT_PROJECT_VERSION = 585; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.580; + MARKETING_VERSION = 1.0.585; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0;