mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
#50 new: docker shell
This commit is contained in:
@@ -1019,6 +1019,12 @@ abstract class S {
|
|||||||
/// **'Are you sure to delete server [{server}]?'**
|
/// **'Are you sure to delete server [{server}]?'**
|
||||||
String sureToDeleteServer(Object server);
|
String sureToDeleteServer(Object server);
|
||||||
|
|
||||||
|
/// No description provided for @terminal.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Terminal'**
|
||||||
|
String get terminal;
|
||||||
|
|
||||||
/// No description provided for @theme.
|
/// No description provided for @theme.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -500,6 +500,9 @@ class SDe extends S {
|
|||||||
return 'Bist du sicher, dass du [$server] löschen willst?';
|
return 'Bist du sicher, dass du [$server] löschen willst?';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get terminal => 'Terminal';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get theme => 'Themen';
|
String get theme => 'Themen';
|
||||||
|
|
||||||
|
|||||||
@@ -500,6 +500,9 @@ class SEn extends S {
|
|||||||
return 'Are you sure to delete server [$server]?';
|
return 'Are you sure to delete server [$server]?';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get terminal => 'Terminal';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get theme => 'Theme';
|
String get theme => 'Theme';
|
||||||
|
|
||||||
|
|||||||
@@ -500,6 +500,9 @@ class SZh extends S {
|
|||||||
return '你确定要删除服务器 [$server] 吗?';
|
return '你确定要删除服务器 [$server] 吗?';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get terminal => '终端';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get theme => '主题';
|
String get theme => '主题';
|
||||||
|
|
||||||
|
|||||||
@@ -360,7 +360,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 320;
|
CURRENT_PROJECT_VERSION = 321;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -368,7 +368,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.320;
|
MARKETING_VERSION = 1.0.321;
|
||||||
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";
|
||||||
@@ -491,7 +491,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 320;
|
CURRENT_PROJECT_VERSION = 321;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.320;
|
MARKETING_VERSION = 1.0.321;
|
||||||
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";
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 320;
|
CURRENT_PROJECT_VERSION = 321;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -524,7 +524,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.320;
|
MARKETING_VERSION = 1.0.321;
|
||||||
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";
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ enum DockerMenuType {
|
|||||||
stop,
|
stop,
|
||||||
restart,
|
restart,
|
||||||
rm,
|
rm,
|
||||||
logs;
|
logs,
|
||||||
|
terminal;
|
||||||
|
|
||||||
static List<DockerMenuType> items(bool running) {
|
static List<DockerMenuType> items(bool running) {
|
||||||
if (running) {
|
if (running) {
|
||||||
@@ -68,6 +69,8 @@ enum DockerMenuType {
|
|||||||
return Icons.delete;
|
return Icons.delete;
|
||||||
case DockerMenuType.logs:
|
case DockerMenuType.logs:
|
||||||
return Icons.logo_dev;
|
return Icons.logo_dev;
|
||||||
|
case DockerMenuType.terminal:
|
||||||
|
return Icons.terminal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +86,8 @@ enum DockerMenuType {
|
|||||||
return s.delete;
|
return s.delete;
|
||||||
case DockerMenuType.logs:
|
case DockerMenuType.logs:
|
||||||
return s.log;
|
return s.log;
|
||||||
|
case DockerMenuType.terminal:
|
||||||
|
return s.terminal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 320;
|
static const int build = 321;
|
||||||
static const String engine = "3.10.2";
|
static const String engine = "3.10.2";
|
||||||
static const String buildAt = "2023-05-26 20:00:35.224841";
|
static const String buildAt = "2023-05-26 20:09:33.821996";
|
||||||
static const int modifications = 5;
|
static const int modifications = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,6 +153,7 @@
|
|||||||
"sureDirEmpty": "Stelle sicher, dass der Ordner leer ist.",
|
"sureDirEmpty": "Stelle sicher, dass der Ordner leer ist.",
|
||||||
"sureNoPwd": "Bist du sicher, dass du kein Passwort verwenden willst?",
|
"sureNoPwd": "Bist du sicher, dass du kein Passwort verwenden willst?",
|
||||||
"sureToDeleteServer": "Bist du sicher, dass du [{server}] löschen willst?",
|
"sureToDeleteServer": "Bist du sicher, dass du [{server}] löschen willst?",
|
||||||
|
"terminal": "Terminal",
|
||||||
"theme": "Themen",
|
"theme": "Themen",
|
||||||
"themeMode": "Thememodus",
|
"themeMode": "Thememodus",
|
||||||
"times": "x",
|
"times": "x",
|
||||||
|
|||||||
@@ -153,6 +153,7 @@
|
|||||||
"sureDirEmpty": "Make sure dir is empty.",
|
"sureDirEmpty": "Make sure dir is empty.",
|
||||||
"sureNoPwd": "Are you sure to use no password?",
|
"sureNoPwd": "Are you sure to use no password?",
|
||||||
"sureToDeleteServer": "Are you sure to delete server [{server}]?",
|
"sureToDeleteServer": "Are you sure to delete server [{server}]?",
|
||||||
|
"terminal": "Terminal",
|
||||||
"theme": "Theme",
|
"theme": "Theme",
|
||||||
"themeMode": "Theme mode",
|
"themeMode": "Theme mode",
|
||||||
"times": "Times",
|
"times": "Times",
|
||||||
|
|||||||
@@ -153,6 +153,7 @@
|
|||||||
"sureDirEmpty": "请确保文件夹为空",
|
"sureDirEmpty": "请确保文件夹为空",
|
||||||
"sureNoPwd": "确认使用无密码?",
|
"sureNoPwd": "确认使用无密码?",
|
||||||
"sureToDeleteServer": "你确定要删除服务器 [{server}] 吗?",
|
"sureToDeleteServer": "你确定要删除服务器 [{server}] 吗?",
|
||||||
|
"terminal": "终端",
|
||||||
"theme": "主题",
|
"theme": "主题",
|
||||||
"themeMode": "主题模式",
|
"themeMode": "主题模式",
|
||||||
"times": "次",
|
"times": "次",
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:toolbox/core/extension/navigator.dart';
|
import 'package:toolbox/core/extension/navigator.dart';
|
||||||
|
import 'package:toolbox/core/route.dart';
|
||||||
import 'package:toolbox/core/utils/misc.dart';
|
import 'package:toolbox/core/utils/misc.dart';
|
||||||
|
import 'package:toolbox/view/page/ssh.dart';
|
||||||
import 'package:toolbox/view/widget/input_field.dart';
|
import 'package:toolbox/view/widget/input_field.dart';
|
||||||
|
|
||||||
import '../../core/utils/ui.dart';
|
import '../../core/utils/ui.dart';
|
||||||
@@ -499,6 +501,9 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
case DockerMenuType.stop:
|
case DockerMenuType.stop:
|
||||||
_docker.stop(dItem.containerId);
|
_docker.stop(dItem.containerId);
|
||||||
break;
|
break;
|
||||||
|
case DockerMenuType.restart:
|
||||||
|
_docker.restart(dItem.containerId);
|
||||||
|
break;
|
||||||
case DockerMenuType.logs:
|
case DockerMenuType.logs:
|
||||||
final logs = await _docker.logs(dItem.containerId);
|
final logs = await _docker.logs(dItem.containerId);
|
||||||
showRoundDialog(
|
showRoundDialog(
|
||||||
@@ -514,9 +519,14 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case DockerMenuType.restart:
|
case DockerMenuType.terminal:
|
||||||
_docker.restart(dItem.containerId);
|
AppRoute(
|
||||||
break;
|
SSHPage(
|
||||||
|
spi: widget.spi,
|
||||||
|
initCmd: 'docker exec -it ${dItem.containerId} /bin/sh',
|
||||||
|
),
|
||||||
|
'Docker terminal',
|
||||||
|
).go(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ import '../../locator.dart';
|
|||||||
|
|
||||||
class SSHPage extends StatefulWidget {
|
class SSHPage extends StatefulWidget {
|
||||||
final ServerPrivateInfo spi;
|
final ServerPrivateInfo spi;
|
||||||
const SSHPage({Key? key, required this.spi}) : super(key: key);
|
final String? initCmd;
|
||||||
|
const SSHPage({Key? key, required this.spi, this.initCmd}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_SSHPageState createState() => _SSHPageState();
|
_SSHPageState createState() => _SSHPageState();
|
||||||
@@ -341,6 +342,11 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
_listen(session.stdout);
|
_listen(session.stdout);
|
||||||
_listen(session.stderr);
|
_listen(session.stderr);
|
||||||
|
|
||||||
|
if (widget.initCmd != null) {
|
||||||
|
_terminal.write(widget.initCmd!);
|
||||||
|
_terminal.keyInput(TerminalKey.enter);
|
||||||
|
}
|
||||||
|
|
||||||
await session.done;
|
await session.done;
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
context.pop();
|
context.pop();
|
||||||
|
|||||||
@@ -475,9 +475,9 @@
|
|||||||
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 320;
|
CURRENT_PROJECT_VERSION = 321;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.320;
|
MARKETING_VERSION = 1.0.321;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -490,9 +490,9 @@
|
|||||||
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 320;
|
CURRENT_PROJECT_VERSION = 321;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.320;
|
MARKETING_VERSION = 1.0.321;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -505,9 +505,9 @@
|
|||||||
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 320;
|
CURRENT_PROJECT_VERSION = 321;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.320;
|
MARKETING_VERSION = 1.0.321;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user