Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt.: use ssh term to decompress #519

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ class HomeWidget : AppWidgetProvider() {
val views = RemoteViews(context.packageName, R.layout.home_widget)
val sp = context.getSharedPreferences("FlutterSharedPreferences", Context.MODE_PRIVATE)
var url = sp.getString("widget_$appWidgetId", null)
val gUrl = sp.getString("widget_*", null)
if (url.isNullOrEmpty()) {
url = sp.getString("$appWidgetId", null)
}
if (url.isNullOrEmpty()) {
val gUrl = sp.getString("widget_*", null)
url = gUrl
}

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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
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.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
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.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
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.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
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.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
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.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
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.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1008,7 +1008,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1049,7 +1049,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1047;
MARKETING_VERSION = 1.0.1048;
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 = 1047;
CURRENT_PROJECT_VERSION = 1048;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
Expand All @@ -1087,7 +1087,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1047;
MARKETING_VERSION = 1.0.1048;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
Expand Down
6 changes: 4 additions & 2 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class MyApp extends StatelessWidget {
listenable: RNodes.app,
builder: (context, _) {
if (!Stores.setting.useSystemPrimaryColor.fetch()) {
UIs.colorSeed = Color(Stores.setting.colorSeed.fetch());
final colorSeed = Color(Stores.setting.colorSeed.fetch());
UIs.colorSeed = colorSeed;
// Past code uses [UIs.primaryColor] as the primary color
UIs.primaryColor = colorSeed;
return _buildApp(
context,
light: ThemeData(
Expand Down Expand Up @@ -88,7 +91,6 @@ class MyApp extends StatelessWidget {
context.setLibL10n();
final appL10n = AppLocalizations.of(context);
if (appL10n != null) l10n = appL10n;
UIs.primaryColor = Theme.of(context).colorScheme.primary;

final intros = _IntroPage.builders;
if (intros.isNotEmpty) {
Expand Down
3 changes: 2 additions & 1 deletion lib/data/provider/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ class ServerProvider extends ChangeNotifier {
_setServerState(s, ServerConn.failed);
return;
} catch (e) {
TryLimiter.inc(sid);
// If max try times < 2 and can't write script, this will stop the status getting and etc.
// TryLimiter.inc(sid);
final err = SSHErr(type: SSHErrType.writeScript, message: e.toString());
s.status.err = err;
Loggers.app.warning(err);
Expand Down
4 changes: 2 additions & 2 deletions lib/data/res/build_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class BuildData {
static const String name = "ServerBox";
static const int build = 1047;
static const int script = 55;
static const int build = 1048;
static const int script = 56;
}
72 changes: 24 additions & 48 deletions lib/intro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ final class _IntroPage extends StatelessWidget {

static const _builders = {
1: _buildAppSettings,
2: _buildRecommended,
1006: _buildTermLetterCache,
};

@override
Expand All @@ -32,52 +30,6 @@ final class _IntroPage extends StatelessWidget {
);
}

static Widget _buildTermLetterCache(BuildContext context, double padTop) {
return ListView(
padding: _introListPad,
children: [
SizedBox(height: padTop),
IntroPage.title(icon: BoxIcons.bxs_terminal, big: true),
SizedBox(height: padTop),
ListTile(
leading: const Icon(Bootstrap.alphabet),
title: Text(l10n.letterCache),
subtitle: Text(l10n.letterCacheTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.letterCache),
).cardx,
],
);
}

static Widget _buildRecommended(BuildContext context, double padTop) {
return ListView(
padding: _introListPad,
children: [
SizedBox(height: padTop),
IntroPage.title(icon: Bootstrap.stars, big: true),
SizedBox(height: padTop),
ListTile(
leading: const Icon(MingCute.delete_2_fill),
title: const Text('rm -r'),
subtitle: Text(l10n.sftpRmrDirSummary, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.sftpRmrDir),
).cardx,
ListTile(
leading: const Icon(MingCute.chart_line_line, size: _kIconSize),
title: Text(l10n.stat),
subtitle: Text(l10n.parseContainerStatsTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.containerParseStat),
).cardx,
ListTile(
leading: const Icon(OctIcons.cpu),
title: Text(l10n.noLineChartForCpu),
subtitle: Text(l10n.cpuViewAsProgressTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.cpuViewAsProgress),
).cardx,
],
);
}

static Widget _buildAppSettings(BuildContext ctx, double padTop) {
return ListView(
padding: _introListPad,
Expand Down Expand Up @@ -111,6 +63,30 @@ final class _IntroPage extends StatelessWidget {
subtitle: Text(l10n.fdroidReleaseTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.autoCheckAppUpdate),
).cardx,
ListTile(
leading: const Icon(MingCute.delete_2_fill),
title: const Text('rm -r'),
subtitle: Text(l10n.sftpRmrDirSummary, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.sftpRmrDir),
).cardx,
ListTile(
leading: const Icon(MingCute.chart_line_line, size: _kIconSize),
title: Text(l10n.stat),
subtitle: Text(l10n.parseContainerStatsTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.containerParseStat),
).cardx,
ListTile(
leading: const Icon(OctIcons.cpu),
title: Text(l10n.noLineChartForCpu),
subtitle: Text(l10n.cpuViewAsProgressTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.cpuViewAsProgress),
).cardx,
ListTile(
leading: const Icon(Bootstrap.alphabet),
title: Text(l10n.letterCache),
subtitle: Text(l10n.letterCacheTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.letterCache),
).cardx,
],
);
}
Expand Down
16 changes: 8 additions & 8 deletions lib/view/page/backup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BackupPage extends StatelessWidget {
child: ExpandTile(
leading: const Icon(Icons.file_open),
title: Text(libL10n.file),
initiallyExpanded: true,
initiallyExpanded: false,
children: [
ListTile(
title: Text(libL10n.backup),
Expand Down Expand Up @@ -112,7 +112,7 @@ class BackupPage extends StatelessWidget {
child: ExpandTile(
leading: const Icon(Icons.storage),
title: const Text('WebDAV'),
initiallyExpanded: true,
initiallyExpanded: false,
children: [
ListTile(
title: Text(l10n.setting),
Expand Down Expand Up @@ -261,11 +261,11 @@ class BackupPage extends StatelessWidget {
),
),
actions: Btn.ok(
onTap: (c) {
onTap: () {
for (final snippet in snippets) {
Pros.snippet.add(snippet);
}
c.pop();
context.pop();
context.pop();
},
).toList,
Expand Down Expand Up @@ -294,7 +294,7 @@ class BackupPage extends StatelessWidget {
'${libL10n.restore} ${libL10n.backup}(${backup.date})',
)),
actions: Btn.ok(
onTap: (c) async {
onTap: () async {
await backup.restore(force: true);
context.pop();
},
Expand Down Expand Up @@ -386,7 +386,7 @@ class BackupPage extends StatelessWidget {
),
],
),
actions: Btn.ok(onTap: (c) => context.pop(true)).toList,
actions: Btnx.oks,
);
if (result == true) {
final result = await Webdav.test(url.text, user.text, pwd.text);
Expand Down Expand Up @@ -423,7 +423,7 @@ class BackupPage extends StatelessWidget {
'${libL10n.restore} ${libL10n.backup}(${backup.date})',
)),
actions: Btn.ok(
onTap: (c) async {
onTap: () async {
await backup.restore(force: true);
context.pop();
},
Expand Down Expand Up @@ -454,7 +454,7 @@ class BackupPage extends StatelessWidget {
final sure = await context.showRoundDialog<bool>(
title: libL10n.import,
child: Text(libL10n.askContinue('${spis.length} ${l10n.server}')),
actions: Btn.ok(onTap: (c) => context.pop(true)).toList,
actions: Btnx.oks,
);
if (sure == true) {
final (suc, err) = await context.showLoadingDialog(
Expand Down
Loading