diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ffad00c1..0ff1902b 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 = 638; + CURRENT_PROJECT_VERSION = 640; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -596,7 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -730,7 +730,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -758,7 +758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; 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.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; 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.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; 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.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -902,7 +902,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -943,7 +943,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.638; + MARKETING_VERSION = 1.0.640; 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 = 638; + CURRENT_PROJECT_VERSION = 640; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -981,7 +981,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.638; + MARKETING_VERSION = 1.0.640; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/data/provider/docker.dart b/lib/data/provider/docker.dart index 28b6a62a..312fcf33 100644 --- a/lib/data/provider/docker.dart +++ b/lib/data/provider/docker.dart @@ -149,7 +149,7 @@ class DockerProvider extends ChangeNotifier { runLog = ''; final errs = []; - final code = await client!.execWithPwd( + final code = await client?.execWithPwd( _wrap(cmd), context: context, onStdout: (data, _) { diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index c140ff68..b1ab0e03 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 = 638; + static const int build = 640; static const String engine = "3.13.9"; - static const String buildAt = "2023-11-12 17:32:24"; - static const int modifications = 2; + static const String buildAt = "2023-11-13 10:47:51"; + static const int modifications = 1; static const int script = 26; } diff --git a/lib/data/store/setting.dart b/lib/data/store/setting.dart index 3402c3ef..9be29f0f 100644 --- a/lib/data/store/setting.dart +++ b/lib/data/store/setting.dart @@ -224,6 +224,13 @@ class SettingStore extends PersistentStore { late final serverFuncBtnsDisplayName = StoreProperty(box, 'serverFuncBtnsDisplayName', true); + /// Disk view: amount / IO + late final serverTabPreferDiskAmount = StoreProperty( + box, + 'serverTabPreferDiskAmount', + false, + ); + // Never show these settings for users // // ------BEGIN------ diff --git a/lib/view/page/full_screen.dart b/lib/view/page/full_screen.dart index 21265b0f..f83b0010 100644 --- a/lib/view/page/full_screen.dart +++ b/lib/view/page/full_screen.dart @@ -216,8 +216,7 @@ class _FullScreenPageState extends State with AfterLayoutMixin { Text( spi.name, style: - const TextStyle(fontWeight: FontWeight.bold, fontSize: 19), - textScaleFactor: 1.0, + const TextStyle(fontWeight: FontWeight.bold, fontSize: 19,), textAlign: TextAlign.center, ), const Icon( @@ -244,7 +243,6 @@ class _FullScreenPageState extends State with AfterLayoutMixin { return Text( topRightStr, style: UIs.textSize11Grey, - textScaleFactor: 1.0, ); } @@ -255,7 +253,6 @@ class _FullScreenPageState extends State with AfterLayoutMixin { text, style: const TextStyle(fontSize: 13), textAlign: TextAlign.center, - textScaleFactor: 1.0, ), ); } @@ -315,14 +312,12 @@ class _FullScreenPageState extends State with AfterLayoutMixin { up, style: statusTextStyle, textAlign: TextAlign.center, - textScaleFactor: 1.0, ), const SizedBox(height: 3), Text( down, style: statusTextStyle, textAlign: TextAlign.center, - textScaleFactor: 1.0, ) ], ), @@ -352,7 +347,6 @@ class _FullScreenPageState extends State with AfterLayoutMixin { '${percent.toStringAsFixed(1)}%', textAlign: TextAlign.center, style: const TextStyle(fontSize: 15), - textScaleFactor: 1.0, ), ), ), diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index 2c10ae32..ca56e018 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -36,7 +36,7 @@ class _ServerDetailPageState extends State late MediaQueryData _media; final Order _cardsOrder = []; - late final _textFactor = Stores.setting.textFactor.fetch(); + late final _textFactor = TextScaler.linear(Stores.setting.textFactor.fetch()); late final _cardBuildMap = Map.fromIterables( Defaults.detailCardOrder, @@ -161,12 +161,12 @@ class _ServerDetailPageState extends State Text( '${percent.toStringAsFixed(1)}%', style: const TextStyle(fontSize: 13), - textScaleFactor: _textFactor, + textScaler: _textFactor, ), Text( timeType, style: const TextStyle(fontSize: 10, color: Colors.grey), - textScaleFactor: _textFactor, + textScaler: _textFactor, ), ], ); @@ -207,12 +207,12 @@ class _ServerDetailPageState extends State Text( ss.sysVer, style: UIs.textSize11, - textScaleFactor: _textFactor, + textScaler: _textFactor, ), Text( ss.uptime, style: UIs.textSize11, - textScaleFactor: _textFactor, + textScaler: _textFactor, ), ], ), @@ -334,13 +334,13 @@ class _ServerDetailPageState extends State title: Text( disk.dev, style: UIs.textSize11Bold, - textScaleFactor: _textFactor, + textScaler: _textFactor, ), contentPadding: const EdgeInsets.symmetric(horizontal: 17), subtitle: Text( text, style: UIs.textSize11Grey, - textScaleFactor: _textFactor, + textScaler: _textFactor, ), trailing: SizedBox( height: 37, @@ -429,7 +429,7 @@ class _ServerDetailPageState extends State Text( device, style: UIs.textSize11Bold, - textScaleFactor: _textFactor, + textScaler: _textFactor, maxLines: 1, overflow: TextOverflow.fade, textAlign: TextAlign.left, @@ -437,7 +437,7 @@ class _ServerDetailPageState extends State Text( '${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}', style: UIs.textSize11Grey, - textScaleFactor: _textFactor, + textScaler: _textFactor, ) ], ), @@ -490,7 +490,7 @@ class _ServerDetailPageState extends State key: key, text, style: style, - textScaleFactor: _textFactor, + textScaler: _textFactor, ), transitionBuilder: (child, animation) => FadeTransition( opacity: animation, diff --git a/lib/view/page/server/tab.dart b/lib/view/page/server/tab.dart index afdb3b2c..32812443 100644 --- a/lib/view/page/server/tab.dart +++ b/lib/view/page/server/tab.dart @@ -373,7 +373,6 @@ class _ServerPageState extends State Text( spi.name, style: UIs.textSize13Bold, - textScaleFactor: 1.0, ), const Icon( Icons.keyboard_arrow_right, @@ -406,14 +405,12 @@ class _ServerPageState extends State child: Text( l10n.viewErr, style: UIs.textSize11Grey, - textScaleFactor: 1.0, ), ); } return Text( topRightStr, style: UIs.textSize11Grey, - textScaleFactor: 1.0, ); } @@ -434,7 +431,7 @@ class _ServerPageState extends State Widget _buildDisk(ServerStatus ss, String id) { final rootDisk = findRootDisk(ss.disk); - final isSpeed = _diskViewSpeed[id] ?? true; + final isSpeed = _diskViewSpeed[id] ?? !Stores.setting.serverTabPreferDiskAmount.fetch(); final (r, w) = ss.diskIO.getAllSpeed(); @@ -490,14 +487,12 @@ class _ServerPageState extends State up, style: UIs.textSize9Grey, textAlign: TextAlign.center, - textScaleFactor: 1.0, ), const SizedBox(height: 3), Text( down, style: UIs.textSize9Grey, textAlign: TextAlign.center, - textScaleFactor: 1.0, ) ], ); @@ -531,7 +526,6 @@ class _ServerPageState extends State '${percent.toStringAsFixed(1)}%', textAlign: TextAlign.center, style: UIs.textSize11, - textScaleFactor: 1.0, ), ), ), diff --git a/lib/view/page/ssh/page.dart b/lib/view/page/ssh/page.dart index f36fabea..5660dca5 100644 --- a/lib/view/page/ssh/page.dart +++ b/lib/view/page/ssh/page.dart @@ -353,7 +353,7 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { _terminal.buffer.setCursor(0, 0); _terminal.onOutput = (data) { - session.write(utf8.encode(data) as Uint8List); + session.write(utf8.encode(data)); }; _terminal.onResize = (width, height, pixelWidth, pixelHeight) { session.resizeTerminal(width, height); diff --git a/lib/view/page/storage/local.dart b/lib/view/page/storage/local.dart index 465f4429..5f4997c1 100644 --- a/lib/view/page/storage/local.dart +++ b/lib/view/page/storage/local.dart @@ -78,7 +78,7 @@ class _LocalStoragePageState extends State { ), body: FadeIn( key: UniqueKey(), - child: _wrapPopScope(), + child: _buildBody(), ), bottomNavigationBar: SafeArea(child: _buildPath()), ); @@ -122,21 +122,6 @@ class _LocalStoragePageState extends State { ); } - Widget _wrapPopScope() { - return WillPopScope( - onWillPop: () async { - if (_path == null) return true; - if (_path!.canBack) { - _path!.update('..'); - setState(() {}); - return false; - } - return true; - }, - child: _buildBody(), - ); - } - Widget _buildBody() { if (_path == null) { return const Center( diff --git a/lib/view/page/storage/sftp.dart b/lib/view/page/storage/sftp.dart index fae944ca..1e289cfa 100644 --- a/lib/view/page/storage/sftp.dart +++ b/lib/view/page/storage/sftp.dart @@ -69,24 +69,11 @@ class _SftpPageState extends State with AfterLayoutMixin { ), ], ), - body: _buildBody(), + body: _buildFileView(), bottomNavigationBar: _buildBottom(), ); } - Widget _buildBody() { - return WillPopScope( - onWillPop: () async { - if (_status.path == null || _status.path?.path == '/') { - return true; - } - await _backward(); - return false; - }, - child: _buildFileView(), - ); - } - Widget _buildBottom() { final children = widget.isSelect ? [ diff --git a/lib/view/widget/tag.dart b/lib/view/widget/tag.dart index 20e8e183..ecff7df3 100644 --- a/lib/view/widget/tag.dart +++ b/lib/view/widget/tag.dart @@ -28,7 +28,6 @@ class TagBtn extends StatelessWidget { Text( content, textAlign: TextAlign.center, - textScaleFactor: 1.0, style: isEnable ? UIs.textSize13 : UIs.textSize13Grey, ), onTap: onTap, @@ -106,7 +105,6 @@ class _TagEditorState extends State { '#$tag', textAlign: TextAlign.center, style: isAdd ? UIs.textSize13Grey : UIs.textSize13, - textScaleFactor: 1.0, ), const SizedBox(width: 4.0), Icon( diff --git a/pubspec.lock b/pubspec.lock index c7383658..12f96c02 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -190,10 +190,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -651,10 +651,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -968,18 +968,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1008,10 +1008,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" timing: dependency: transitive description: @@ -1145,10 +1145,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1207,5 +1207,5 @@ packages: source: hosted version: "0.0.6" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0"