mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
#95 fix
This commit is contained in:
@@ -33,7 +33,16 @@ enum AppShellFuncType {
|
||||
case AppShellFuncType.status:
|
||||
return statusCmds.join(_cmdDivider);
|
||||
case AppShellFuncType.docker:
|
||||
return dockerCmds.join(_cmdDivider);
|
||||
return '''
|
||||
# If the cmd result contains "permission denied", try to use `sudo`
|
||||
result=\$(docker version 2>&1)
|
||||
deniedStr="permission denied"
|
||||
containStr=\$(echo \$result | grep "\${deniedStr}")
|
||||
if [[ \$containStr != "" ]]; then
|
||||
${dockerCmds.join(_cmdDivider)}
|
||||
else
|
||||
${dockerCmds.map((e) => "sudo -S $e").join(_cmdDivider)}
|
||||
fi''';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class DockerProvider extends BusyProvider {
|
||||
try {
|
||||
final statsLines = statsRaw.split('\n');
|
||||
statsLines.removeWhere((element) => element.isEmpty);
|
||||
statsLines.removeAt(0);
|
||||
if (statsLines.isNotEmpty) statsLines.removeAt(0);
|
||||
for (var item in items!) {
|
||||
final statsLine = statsLines.firstWhere(
|
||||
(element) => element.contains(item.containerId),
|
||||
@@ -148,6 +148,7 @@ class DockerProvider extends BusyProvider {
|
||||
}
|
||||
|
||||
Future<void> _onPwd(String event, StreamSink<Uint8List> stdin) async {
|
||||
print(event);
|
||||
if (isRequestingPwd) return;
|
||||
isRequestingPwd = true;
|
||||
if (event.contains('[sudo] password for ')) {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 426;
|
||||
static const int build = 446;
|
||||
static const String engine = "3.10.6";
|
||||
static const String buildAt = "2023-08-06 16:29:23.492978";
|
||||
static const String buildAt = "2023-08-07 18:34:12.547300";
|
||||
static const int modifications = 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user