diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 2792aad4..0122adcf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -470,7 +470,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -478,7 +478,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -602,7 +602,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -610,7 +610,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -628,7 +628,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -636,7 +636,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -657,7 +657,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -670,7 +670,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -696,7 +696,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -709,7 +709,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -732,7 +732,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -745,7 +745,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index e7383ea0..b3c1bd7f 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,8 +2,8 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 423; + static const int build = 425; static const String engine = "3.10.6"; - static const String buildAt = "2023-08-05 21:13:42.622817"; + static const String buildAt = "2023-08-05 21:55:28.557439"; static const int modifications = 7; } diff --git a/lib/data/res/misc.dart b/lib/data/res/misc.dart index 3269127e..cc461534 100644 --- a/lib/data/res/misc.dart +++ b/lib/data/res/misc.dart @@ -37,6 +37,7 @@ const participants = { 'wxdjs', 'Aeorq', 'allonmymind', + 'Yuuki-Rin', 'LittleState', 'karuboniru', 'whosphp', diff --git a/lib/view/page/storage/local.dart b/lib/view/page/storage/local.dart index c708fcc7..799ffbd9 100644 --- a/lib/view/page/storage/local.dart +++ b/lib/view/page/storage/local.dart @@ -65,31 +65,31 @@ class _LocalStoragePageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( + leading: IconButton( + icon: const BackButtonIcon(), + onPressed: () { + if (_path != null) { + _path!.update('/'); + } + context.pop(); + }, + ), title: Text(_s.download), actions: [ IconButton( icon: const Icon(Icons.downloading), - onPressed: () => - AppRoute(const SftpMissionPage(), 'sftp downloading') - .go(context), + onPressed: () => AppRoute( + const SftpMissionPage(), + 'sftp downloading', + ).go(context), ) ], ), body: FadeIn( key: UniqueKey(), - child: _buildBody(), + child: _wrapPopScope(), ), bottomNavigationBar: SafeArea(child: _buildPath()), - floatingActionButton: FloatingActionButton( - onPressed: () async { - final path = await pickOneFile(); - if (path == null) return; - final name = getFileName(path) ?? 'imported'; - await File(path).copy(pathJoin(_path!.path, name)); - setState(() {}); - }, - child: const Icon(Icons.add), - ), ); } @@ -99,13 +99,53 @@ class _LocalStoragePageState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - const Divider(), (_path?.path ?? _s.loadingFiles).omitStartStr(), + _buildBtns(), ], ), ); } + Widget _buildBtns() { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + onPressed: () { + _path?.update('..'); + setState(() {}); + }, + icon: const Icon(Icons.arrow_back), + ), + IconButton( + onPressed: () async { + final path = await pickOneFile(); + if (path == null) return; + final name = getFileName(path) ?? 'imported'; + await File(path).copy(pathJoin(_path!.path, name)); + setState(() {}); + }, + icon: const Icon(Icons.add), + ), + ], + ); + } + + 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( @@ -114,27 +154,10 @@ class _LocalStoragePageState extends State { } final dir = Directory(_path!.path); final files = dir.listSync(); - final canGoBack = _path!.canBack; - if (files.isEmpty) { - return const Center( - child: Text('~'), - ); - } return ListView.builder( - itemCount: canGoBack ? files.length + 1 : files.length, + itemCount: files.length, padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 7), itemBuilder: (context, index) { - if (index == 0 && canGoBack) { - return RoundRectCard(ListTile( - leading: const Icon(Icons.keyboard_arrow_left), - title: const Text('..'), - onTap: () { - _path!.update('..'); - setState(() {}); - }, - )); - } - index = canGoBack ? index - 1 : index; var file = files[index]; var fileName = file.path.split('/').last; var stat = file.statSync(); diff --git a/lib/view/page/storage/sftp.dart b/lib/view/page/storage/sftp.dart index af4be49a..dd321cb0 100644 --- a/lib/view/page/storage/sftp.dart +++ b/lib/view/page/storage/sftp.dart @@ -76,6 +76,15 @@ class _SftpPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( + leading: IconButton( + icon: const BackButtonIcon(), + onPressed: () { + if (_status.path != null) { + _status.path!.update('/'); + } + context.pop(); + }, + ), centerTitle: true, title: TwoLineText(up: 'SFTP', down: widget.spi.name), actions: [ @@ -277,6 +286,12 @@ class _SftpPageState extends State { return centerLoading; } + if (_status.files!.isEmpty) { + return const Center( + child: Text('~'), + ); + } + return RefreshIndicator( child: FadeIn( key: Key(widget.spi.name + _status.path!.path), diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index ce8b4a63..1f78bdcc 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -475,9 +475,9 @@ baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -490,9 +490,9 @@ baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -505,9 +505,9 @@ baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 423; + CURRENT_PROJECT_VERSION = 425; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.423; + MARKETING_VERSION = 1.0.425; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/make.dart b/make.dart index 5f935431..4b858c40 100755 --- a/make.dart +++ b/make.dart @@ -146,12 +146,6 @@ Future flutterBuildAndroid() async { } Future scp2CDN() async { - print('scp2CDN? (Y/n)'); - final str = stdin.readLineSync() ?? ''; - if (str.isNotEmpty) { - print('skip scp2CDN'); - return; - } final result = await Process.run( 'scp', [apkPath, 'hk:/var/www/res/serverbox/apks/$build.apk'],