mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
set LANG in shell
This commit is contained in:
@@ -354,7 +354,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 123;
|
CURRENT_PROJECT_VERSION = 125;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -362,7 +362,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.123;
|
MARKETING_VERSION = 1.0.125;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 123;
|
CURRENT_PROJECT_VERSION = 125;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -492,7 +492,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.123;
|
MARKETING_VERSION = 1.0.125;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -508,7 +508,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 123;
|
CURRENT_PROJECT_VERSION = 125;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.123;
|
MARKETING_VERSION = 1.0.125;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
|||||||
@@ -41,5 +41,10 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>CFBundleLocalizations</key>
|
||||||
|
<array>
|
||||||
|
<string>en</string>
|
||||||
|
<string>zh</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -30,7 +30,8 @@ List<SSHKeyPair> loadIndentity(String key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const seperator = 'A====A';
|
const seperator = 'A====A';
|
||||||
const shellCmd = "cat /proc/net/dev && date +%s \necho $seperator \n "
|
const shellCmd = "export LANG=en_US.utf-8 \necho '$seperator' \n"
|
||||||
|
"cat /proc/net/dev && date +%s \necho $seperator \n "
|
||||||
"cat /etc/os-release | grep PRETTY_NAME \necho $seperator \n"
|
"cat /etc/os-release | grep PRETTY_NAME \necho $seperator \n"
|
||||||
"cat /proc/stat | grep cpu \necho $seperator \n"
|
"cat /proc/stat | grep cpu \necho $seperator \n"
|
||||||
"uptime \necho $seperator \n"
|
"uptime \necho $seperator \n"
|
||||||
@@ -40,6 +41,7 @@ const shellCmd = "cat /proc/net/dev && date +%s \necho $seperator \n "
|
|||||||
"cat /sys/class/thermal/thermal_zone*/type \necho $seperator \n"
|
"cat /sys/class/thermal/thermal_zone*/type \necho $seperator \n"
|
||||||
"cat /sys/class/thermal/thermal_zone*/temp";
|
"cat /sys/class/thermal/thermal_zone*/temp";
|
||||||
const shellPath = '.serverbox.sh';
|
const shellPath = '.serverbox.sh';
|
||||||
|
const memPrefix = 'Mem:';
|
||||||
final cpuTempReg = RegExp('(x86_pkg_temp|cpu_thermal)');
|
final cpuTempReg = RegExp('(x86_pkg_temp|cpu_thermal)');
|
||||||
|
|
||||||
class ServerProvider extends BusyProvider {
|
class ServerProvider extends BusyProvider {
|
||||||
@@ -192,6 +194,7 @@ class ServerProvider extends BusyProvider {
|
|||||||
if (si.client == null) return;
|
if (si.client == null) return;
|
||||||
final raw = await si.client!.run("sh $shellPath").string;
|
final raw = await si.client!.run("sh $shellPath").string;
|
||||||
final lines = raw.split(seperator).map((e) => e.trim()).toList();
|
final lines = raw.split(seperator).map((e) => e.trim()).toList();
|
||||||
|
lines.removeAt(0);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_getCPU(spi, lines[2], lines[7], lines[8]);
|
_getCPU(spi, lines[2], lines[7], lines[8]);
|
||||||
@@ -322,11 +325,9 @@ class ServerProvider extends BusyProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _getMem(ServerPrivateInfo spi, String raw) {
|
void _getMem(ServerPrivateInfo spi, String raw) {
|
||||||
const memPrefixies = ['Mem:', '内存:'];
|
|
||||||
final info = _servers.firstWhere((e) => e.info == spi);
|
final info = _servers.firstWhere((e) => e.info == spi);
|
||||||
for (var item in raw.split('\n')) {
|
for (var item in raw.split('\n')) {
|
||||||
var found = false;
|
var found = false;
|
||||||
for (var memPrefix in memPrefixies) {
|
|
||||||
if (item.contains(memPrefix)) {
|
if (item.contains(memPrefix)) {
|
||||||
found = true;
|
found = true;
|
||||||
final split = item.replaceFirst(memPrefix, '').split(' ');
|
final split = item.replaceFirst(memPrefix, '').split(' ');
|
||||||
@@ -341,7 +342,6 @@ class ServerProvider extends BusyProvider {
|
|||||||
avail: memList[5]);
|
avail: memList[5]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (found) break;
|
if (found) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 123;
|
static const int build = 125;
|
||||||
static const String engine =
|
static const String engine =
|
||||||
"Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 5464c5bac7 (2 weeks ago) • 2022-04-18 09:55:37 -0700\nEngine • revision 57d3bac3dd\nTools • Dart 2.16.2 • DevTools 2.9.2\n";
|
"Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 5464c5bac7 (2 weeks ago) • 2022-04-18 09:55:37 -0700\nEngine • revision 57d3bac3dd\nTools • Dart 2.16.2 • DevTools 2.9.2\n";
|
||||||
static const String buildAt = "2022-05-04 21:08:15.263486";
|
static const String buildAt = "2022-05-05 16:11:07.575227";
|
||||||
static const int modifications = 0;
|
static const int modifications = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,8 +247,7 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
applicationIcon: _buildIcon(),
|
applicationIcon: _buildIcon(),
|
||||||
aboutBoxChildren: [
|
aboutBoxChildren: [
|
||||||
UrlText(
|
UrlText(
|
||||||
text: s.madeWithLove(myGithub),
|
text: s.madeWithLove(myGithub), replace: 'LollipopKit'),
|
||||||
replace: 'LollipopKit'),
|
|
||||||
UrlText(
|
UrlText(
|
||||||
text: s.aboutThanks(rainSunMeGithub),
|
text: s.aboutThanks(rainSunMeGithub),
|
||||||
replace: 'RainSunMe',
|
replace: 'RainSunMe',
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ class _PingPageState extends State<PingPage>
|
|||||||
title: Text(result.serverName,
|
title: Text(result.serverName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18, fontWeight: FontWeight.bold, color: primaryColor)),
|
fontSize: 18, fontWeight: FontWeight.bold, color: primaryColor)),
|
||||||
subtitle: Text(_buildPingSummary(result, unknown, ms), style: summaryTextStyle,),
|
subtitle: Text(
|
||||||
|
_buildPingSummary(result, unknown, ms),
|
||||||
|
style: summaryTextStyle,
|
||||||
|
),
|
||||||
trailing: Text(
|
trailing: Text(
|
||||||
s.pingAvg +
|
s.pingAvg +
|
||||||
(result.statistic?.avg?.toStringAsFixed(2) ?? s.unknown) +
|
(result.statistic?.avg?.toStringAsFixed(2) ?? s.unknown) +
|
||||||
|
|||||||
@@ -92,8 +92,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage>
|
|||||||
final key = keyController.text;
|
final key = keyController.text;
|
||||||
final pwd = pwdController.text;
|
final pwd = pwdController.text;
|
||||||
if (name.isEmpty || key.isEmpty) {
|
if (name.isEmpty || key.isEmpty) {
|
||||||
showSnackBar(
|
showSnackBar(context, Text(s.fieldMustNotEmpty));
|
||||||
context, Text(s.fieldMustNotEmpty));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
|
|||||||
@@ -60,12 +60,8 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
widget.spi != null
|
widget.spi != null
|
||||||
? IconButton(
|
? IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showRoundDialog(
|
showRoundDialog(context, 'Attention',
|
||||||
context,
|
Text(s.sureToDeleteServer(widget.spi!.name)), [
|
||||||
'Attention',
|
|
||||||
Text(
|
|
||||||
s.sureToDeleteServer(widget.spi!.name)),
|
|
||||||
[
|
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_serverProvider.delServer(widget.spi!);
|
_serverProvider.delServer(widget.spi!);
|
||||||
@@ -93,8 +89,8 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
TextField(
|
TextField(
|
||||||
controller: nameController,
|
controller: nameController,
|
||||||
keyboardType: TextInputType.text,
|
keyboardType: TextInputType.text,
|
||||||
decoration:
|
decoration: buildDecoration(s.name,
|
||||||
buildDecoration(s.name, icon: Icons.info, hint: s.exampleName),
|
icon: Icons.info, hint: s.exampleName),
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: ipController,
|
controller: ipController,
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
|||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async =>
|
onPressed: () async =>
|
||||||
await _import(_importFieldController.text.trim()),
|
await _import(_importFieldController.text.trim()),
|
||||||
child: Text('GO'),
|
child: const Text('GO'),
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -246,11 +246,9 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
|||||||
]));
|
]));
|
||||||
}), [
|
}), [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async => run(context, snippet),
|
onPressed: () async => run(context, snippet), child: Text(s.run)),
|
||||||
child: Text(s.run)),
|
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(), child: Text(s.cancel)),
|
||||||
child: Text(s.cancel)),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,8 +259,7 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
|||||||
showRoundDialog(context, s.result,
|
showRoundDialog(context, s.result,
|
||||||
Text(result, style: const TextStyle(fontSize: 13)), [
|
Text(result, style: const TextStyle(fontSize: 13)), [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(), child: Text(s.close))
|
||||||
child: Text(s.close))
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user