Skip to content

Commit

Permalink
opt.
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed May 23, 2024
1 parent cf5810d commit eb0100d
Show file tree
Hide file tree
Showing 28 changed files with 137 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class HomeWidget : AppWidgetProvider() {
appWidgetManager.updateAppWidget(appWidgetId, views)
}
} catch (e: Exception) {
println("ServerBoxHomeWidget: ${e.localizedMessage}")
GlobalScope.launch(Dispatchers.Main) main@ {
views.setViewVisibility(R.id.widget_cpu_label, View.INVISIBLE)
views.setViewVisibility(R.id.widget_mem_label, View.INVISIBLE)
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 = 908;
CURRENT_PROJECT_VERSION = 909;
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.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
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.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
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.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
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.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
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.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
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.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1008,7 +1008,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1049,7 +1049,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.908;
MARKETING_VERSION = 1.0.909;
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 = 908;
CURRENT_PROJECT_VERSION = 909;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1087,7 +1087,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.908;
MARKETING_VERSION = 1.0.909;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
Expand Down
8 changes: 6 additions & 2 deletions lib/core/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:toolbox/data/model/server/private_key_info.dart';
import 'package:toolbox/data/model/server/server_private_info.dart';
import 'package:toolbox/data/res/build_data.dart';
import 'package:toolbox/data/res/provider.dart';
import 'package:toolbox/data/res/store.dart';
import 'package:toolbox/view/page/backup.dart';
Expand Down Expand Up @@ -154,8 +155,11 @@ class AppRoutes {
return AppRoutes(
DebugPage(
key: key,
notifier: Pros.debug.widgets,
onClear: Pros.debug.clear,
args: DebugPageArgs(
notifier: Pros.debug.widgets,
onClear: Pros.debug.clear,
title: 'Logs(${BuildData.build})',
),
),
'debug',
);
Expand Down
21 changes: 3 additions & 18 deletions lib/data/model/server/pve.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@ final class PveLxc extends PveResIface implements PveCtrlIface {
@override
String get summary {
if (available) {
return uptime.secondsToDuration().toAgoStr(
day: l10n.day,
hour: l10n.hour,
minute: l10n.minute,
second: l10n.second,
);
return uptime.secondsToDuration().toAgoStr;
}
return l10n.stopped;
}
Expand Down Expand Up @@ -213,12 +208,7 @@ final class PveQemu extends PveResIface implements PveCtrlIface {
@override
String get summary {
if (available) {
return uptime.secondsToDuration().toAgoStr(
day: l10n.day,
hour: l10n.hour,
minute: l10n.minute,
second: l10n.second,
);
return uptime.secondsToDuration().toAgoStr;
}
return l10n.stopped;
}
Expand Down Expand Up @@ -268,12 +258,7 @@ final class PveNode extends PveResIface {

String get topRight {
if (isRunning) {
return uptime.secondsToDuration().toAgoStr(
day: l10n.day,
hour: l10n.hour,
minute: l10n.minute,
second: l10n.second,
);
return uptime.secondsToDuration().toAgoStr;
}
return l10n.stopped;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/data/model/server/wol_cfg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class WakeOnLanCfg {
return (err, valid);
}

Future<void> wake() async {
Future<void> wake() {
if (!validate().$2) {
throw Exception('Invalid WakeOnLanCfg');
}
Expand All @@ -48,7 +48,7 @@ final class WakeOnLanCfg {
final mac_ = MACAddress(mac);
final pwd_ = pwd != null ? SecureONPassword(pwd!) : null;
final obj = WakeOnLAN(ip_, mac_, password: pwd_);
await obj.wake(
return obj.wake(
repeat: 3,
repeatDelay: const Duration(milliseconds: 500),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/data/provider/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ServerProvider extends ChangeNotifier {
// message: 'Wake on lan failed: $e',
// );
// _setServerState(s, ServerConn.failed);
// Loggers.app.warning('Wake on lan failed', e);
Loggers.app.warning('Wake on lan failed', e);
// return;
}
}
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 = 908;
static const int build = 909;
static const String engine = "3.22.0";
static const String buildAt = "2024-05-22 22:25:06";
static const int modifications = 4;
static const String buildAt = "2024-05-23 00:45:04";
static const int modifications = 11;
static const int script = 48;
}
6 changes: 3 additions & 3 deletions lib/view/page/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:toolbox/data/res/store.dart';
import '../../data/model/container/ps.dart';
import '../../data/model/server/server_private_info.dart';
import '../../data/provider/container.dart';
import '../widget/popup_menu.dart';
import '../widget/two_line_text.dart';

class ContainerPage extends StatefulWidget {
Expand Down Expand Up @@ -260,8 +259,9 @@ class _ContainerPageState extends State<ContainerPage> {

Widget _buildMoreBtn(ContainerPs dItem) {
return PopupMenu(
items: ContainerMenu.items(dItem.running),
builder: (e) => PopMenu.build(e, e.icon, e.toStr),
items: ContainerMenu.items(dItem.running)
.map((e) => PopMenu.build(e, e.icon, e.toStr))
.toList(),
onSelected: (item) => _onTapMoreBtn(item, dItem),
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/view/page/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ ${GithubIds.participants.map((e) => '[$e](${e.url})').join(' ')}
build: BuildData.build,
url: '${Urls.cdnBase}/update.json',
context: context,
updateL10n: l10n.update,
);
}
HomeWidgetMC.update();
Expand Down
1 change: 0 additions & 1 deletion lib/view/page/home/wear.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ final class _WearHomeState extends State<WearHome> with AfterLayoutMixin {
build: BuildData.build,
url: '${Urls.cdnBase}/update.json',
context: context,
updateL10n: l10n.update,
);
}
await Pros.server.load();
Expand Down
3 changes: 0 additions & 3 deletions lib/view/page/server/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ class _ServerEditPageState extends State<ServerEditPage> {
onChanged: (p0) => _tags = p0,
allTags: [...Pros.server.tags.value],
onRenameTag: Pros.server.renameTag,
renameL10n: l10n.rename,
tagL10n: l10n.tag,
addL10n: l10n.add,
),
ListTile(
title: Text(l10n.autoConnect),
Expand Down
1 change: 0 additions & 1 deletion lib/view/page/server/tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ class _ServerPageState extends State<ServerPage>
_tag = p0;
}),
initTag: _tag,
allL10n: l10n.all,
);
}

Expand Down
1 change: 0 additions & 1 deletion lib/view/page/setting/entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ class _SettingPageState extends State<SettingPage> {
build: BuildData.build,
url: Urls.updateCfg,
force: BuildMode.isDebug,
updateL10n: l10n.update,
),
),
trailing: StoreSwitch(prop: _setting.autoCheckAppUpdate),
Expand Down
3 changes: 0 additions & 3 deletions lib/view/page/snippet/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ class _SnippetEditPageState extends State<SnippetEditPage>
onRenameTag: (old, n) => setState(() {
Pros.snippet.renameTag(old, n);
}),
renameL10n: l10n.rename,
tagL10n: l10n.tag,
addL10n: l10n.add,
);
},
),
Expand Down
1 change: 0 additions & 1 deletion lib/view/page/snippet/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class _SnippetListPageState extends State<SnippetListPage> {
onTagChanged: (tag) => setState(() => _tag = tag),
initTag: _tag,
width: _media.size.width,
allL10n: l10n.all,
),
footer: UIs.height77,
buildDefaultDragHandles: false,
Expand Down
1 change: 0 additions & 1 deletion lib/view/page/ssh/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:dartssh2/dartssh2.dart';
import 'package:fl_lib/fl_lib.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:provider/provider.dart';
import 'package:toolbox/core/extension/context/locale.dart';
Expand Down
Loading

0 comments on commit eb0100d

Please sign in to comment.