Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed Jun 8, 2024
2 parents 6d34de1 + 9f34021 commit 46b98df
Show file tree
Hide file tree
Showing 19 changed files with 276 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test.dart

# Linux release
linux.AppDir
ServerBox-x86_64.AppImage
**/*.AppImage

untranlated.json

Expand Down
36 changes: 18 additions & 18 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
Expand All @@ -700,7 +700,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -826,7 +826,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
Expand All @@ -836,7 +836,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -854,7 +854,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
Expand All @@ -864,7 +864,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -885,7 +885,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -898,7 +898,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
Expand All @@ -924,7 +924,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -937,7 +937,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -960,7 +960,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -973,7 +973,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -996,7 +996,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1008,7 +1008,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
Expand Down Expand Up @@ -1037,7 +1037,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1049,7 +1049,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
Expand All @@ -1075,7 +1075,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 936;
CURRENT_PROJECT_VERSION = 943;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1087,7 +1087,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.936;
MARKETING_VERSION = 1.0.943;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
Expand Down
2 changes: 1 addition & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
_setup(context);
return ListenableBuilder(
listenable: RebuildNodes.app,
listenable: RNodes.app,
builder: (context, _) {
if (!Stores.setting.useSystemPrimaryColor.fetch()) {
UIs.colorSeed = Color(Stores.setting.primaryColor.fetch());
Expand Down
2 changes: 1 addition & 1 deletion lib/data/model/app/backup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class Backup {
}

Pros.reload();
RebuildNodes.app.rebuild();
RNodes.app.build();

_logger.info('Restore success');
}
Expand Down
5 changes: 0 additions & 5 deletions lib/data/model/app/github_id.dart

This file was deleted.

23 changes: 0 additions & 23 deletions lib/data/model/app/rebuild.dart

This file was deleted.

7 changes: 3 additions & 4 deletions lib/data/model/container/ps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ final class DockerPs implements ContainerPs {
@override
bool get running {
if (state?.contains('Exited') == true) return false;
if (state?.contains('Up') == true) return true;
return true;
}

Expand All @@ -162,9 +161,9 @@ final class DockerPs implements ContainerPs {
final parts = raw.split(Miscs.multiBlankreg);
return DockerPs(
id: parts[0],
names: parts[1],
image: parts[2],
state: parts[3].trim(),
state: parts[1],
names: parts[2],
image: parts[3].trim(),
);
}
}
6 changes: 5 additions & 1 deletion lib/data/provider/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,13 @@ enum ContainerCmdType {
return switch (this) {
ContainerCmdType.version => '$prefix version $_jsonFmt',
ContainerCmdType.ps => switch (type) {
/// TODO: Rollback to json format when permformance recovers.
/// Use [_jsonFmt] in Docker will cause the operation to slow down.
ContainerType.docker => '$prefix ps -a --format "table {{printf \\"'
'%-15.15s ${"%-30.30s " * 3}\\" .ID .Names .Image .Status}}"',
'%-15.15s '
'%-30.30s '
'${"%-50.50s " * 2}\\"'
' .ID .Status .Names .Image}}"',
ContainerType.podman => '$prefix ps -a $_jsonFmt',
},
ContainerCmdType.stats =>
Expand Down
6 changes: 3 additions & 3 deletions lib/data/res/build_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class BuildData {
static const String name = "ServerBox";
static const int build = 936;
static const int build = 943;
static const String engine = "3.22.1";
static const String buildAt = "2024-06-06 16:18:25";
static const int modifications = 2;
static const String buildAt = "2024-06-08 19:28:01";
static const int modifications = 7;
static const int script = 48;
}
8 changes: 6 additions & 2 deletions lib/data/res/github_id.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:toolbox/data/model/app/github_id.dart';

abstract final class GithubIds {
// Thanks
// If you want to change your Github ID, please open an issue.
Expand Down Expand Up @@ -75,3 +73,9 @@ abstract final class GithubIds {
'Jasonzhu1207',
};
}

typedef GhId = String;

extension GhIdX on GhId {
String get url => 'https://github.com/$this';
}
7 changes: 4 additions & 3 deletions lib/data/res/rebuild.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:toolbox/data/model/app/rebuild.dart';
import 'package:fl_lib/fl_lib.dart';

abstract final class RebuildNodes {
static final app = RebuildNode();
abstract final class RNodes {
static final app = RNode();
static final dark = false.vn;
}
3 changes: 2 additions & 1 deletion lib/view/page/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import 'package:toolbox/core/channel/home_widget.dart';
import 'package:toolbox/core/extension/build.dart';
import 'package:toolbox/core/extension/context/locale.dart';
import 'package:toolbox/core/route.dart';
import 'package:toolbox/data/model/app/github_id.dart';
import 'package:toolbox/data/model/app/tab.dart';
import 'package:toolbox/data/res/build_data.dart';
import 'package:toolbox/data/res/github_id.dart';
import 'package:toolbox/data/res/misc.dart';
import 'package:toolbox/data/res/provider.dart';
import 'package:toolbox/data/res/store.dart';
import 'package:toolbox/data/res/url.dart';
import 'package:toolbox/view/page/ssh/page.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

part 'appbar.dart';
Expand Down Expand Up @@ -151,6 +151,7 @@ class _HomePageState extends State<HomePage>
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (_, index) => AppTab.values[index].page,
onPageChanged: (value) {
SSHPage.focusNode.unfocus();
if (!_switchingPage) {
_selectIndex.value = value;
}
Expand Down
14 changes: 7 additions & 7 deletions lib/view/page/setting/entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class _SettingPageState extends State<SettingPage> {
_setting.primaryColor.put(color.value);
context.pop();
context.pop();
RebuildNodes.app.rebuild();
RNodes.app.build();
}

// Widget _buildLaunchPage() {
Expand Down Expand Up @@ -393,7 +393,7 @@ class _SettingPageState extends State<SettingPage> {
);
if (selected != null) {
_setting.themeMode.put(selected);
RebuildNodes.app.rebuild();
RNodes.app.build();
}
},
trailing: ValBuilder(
Expand Down Expand Up @@ -442,7 +442,7 @@ class _SettingPageState extends State<SettingPage> {
onPressed: () {
_setting.fontPath.delete();
context.pop();
RebuildNodes.app.rebuild();
RNodes.app.build();
},
child: Text(l10n.clear),
)
Expand All @@ -466,7 +466,7 @@ class _SettingPageState extends State<SettingPage> {
}

context.pop();
RebuildNodes.app.rebuild();
RNodes.app.build();
}

Widget _buildTermFontSize() {
Expand Down Expand Up @@ -536,7 +536,7 @@ class _SettingPageState extends State<SettingPage> {
if (selected != null) {
_setting.locale.put(selected.code);
context.pop();
RebuildNodes.app.rebuild();
RNodes.app.build();
}
},
trailing: ListenBuilder(
Expand Down Expand Up @@ -609,7 +609,7 @@ class _SettingPageState extends State<SettingPage> {
subtitle: Text(l10n.fullScreenTip, style: UIs.textGrey),
trailing: StoreSwitch(
prop: _setting.fullScreen,
callback: (_) => RebuildNodes.app.rebuild(),
callback: (_) => RNodes.app.build(),
),
);
}
Expand Down Expand Up @@ -820,7 +820,7 @@ class _SettingPageState extends State<SettingPage> {
return;
}
_setting.textFactor.put(val);
RebuildNodes.app.rebuild();
RNodes.app.build();
context.pop();
}

Expand Down
Loading

0 comments on commit 46b98df

Please sign in to comment.