mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt. for docker & apt
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"dart.flutterSdkPath": ".fvm",
|
||||||
"files.watcherExclude": {
|
"files.watcherExclude": {
|
||||||
"**/.fvm": true
|
".fvm": true
|
||||||
},
|
},
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/.fvm": true
|
".fvm": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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 = 165;
|
CURRENT_PROJECT_VERSION = 166;
|
||||||
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.165;
|
MARKETING_VERSION = 1.0.166;
|
||||||
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 = 165;
|
CURRENT_PROJECT_VERSION = 166;
|
||||||
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.165;
|
MARKETING_VERSION = 1.0.166;
|
||||||
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 = 165;
|
CURRENT_PROJECT_VERSION = 166;
|
||||||
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.165;
|
MARKETING_VERSION = 1.0.166;
|
||||||
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";
|
||||||
|
|||||||
35
lib/core/extension/ssh_client.dart
Normal file
35
lib/core/extension/ssh_client.dart
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:dartssh2/dartssh2.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:toolbox/core/extension/uint8list.dart';
|
||||||
|
|
||||||
|
typedef OnStd = void Function(String data, StreamSink<Uint8List> sink);
|
||||||
|
typedef OnStdin = void Function(StreamSink<Uint8List> sink);
|
||||||
|
|
||||||
|
typedef PwdRequestFunc = Future<String> Function();
|
||||||
|
final pwdRequestWithUserReg = RegExp(r'\[sudo\] password for (.+):');
|
||||||
|
|
||||||
|
extension SSHClientX on SSHClient {
|
||||||
|
Future<int?> exec(String cmd,
|
||||||
|
{OnStd? onStderr, OnStd? onStdout, OnStdin? stdin}) async {
|
||||||
|
final session = await execute(cmd);
|
||||||
|
|
||||||
|
if (onStderr != null) {
|
||||||
|
await for (final data in session.stderr) {
|
||||||
|
onStderr(data.string, session.stdin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (onStdout != null) {
|
||||||
|
await for (final data in session.stdout) {
|
||||||
|
onStdout(data.string, session.stdin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stdin != null) {
|
||||||
|
stdin(session.stdin);
|
||||||
|
}
|
||||||
|
|
||||||
|
session.close();
|
||||||
|
return session.exitCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:toolbox/data/model/distribution.dart';
|
import 'package:toolbox/data/model/distribution.dart';
|
||||||
|
|
||||||
@@ -60,4 +63,6 @@ extension StringX on String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String get withLangExport => 'export LANG=en_US.UTF-8 && $this';
|
String get withLangExport => 'export LANG=en_US.UTF-8 && $this';
|
||||||
|
|
||||||
|
Uint8List get uint8List => Uint8List.fromList(utf8.encode(this));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:dartssh2/dartssh2.dart';
|
import 'package:dartssh2/dartssh2.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:toolbox/core/extension/ssh_client.dart';
|
||||||
import 'package:toolbox/core/extension/stringx.dart';
|
import 'package:toolbox/core/extension/stringx.dart';
|
||||||
import 'package:toolbox/core/extension/uint8list.dart';
|
import 'package:toolbox/core/extension/uint8list.dart';
|
||||||
import 'package:toolbox/core/provider_base.dart';
|
import 'package:toolbox/core/provider_base.dart';
|
||||||
import 'package:toolbox/data/model/apt/upgrade_pkg_info.dart';
|
import 'package:toolbox/data/model/apt/upgrade_pkg_info.dart';
|
||||||
import 'package:toolbox/data/model/distribution.dart';
|
import 'package:toolbox/data/model/distribution.dart';
|
||||||
|
|
||||||
typedef PwdRequestFunc = Future<String> Function(
|
|
||||||
int triedTimes, String? userName);
|
|
||||||
final pwdRequestWithUserReg = RegExp(r'\[sudo\] password for (.+):');
|
|
||||||
|
|
||||||
class AptProvider extends BusyProvider {
|
class AptProvider extends BusyProvider {
|
||||||
final logger = Logger('AptProvider');
|
final logger = Logger('AptProvider');
|
||||||
|
|
||||||
@@ -29,45 +25,37 @@ class AptProvider extends BusyProvider {
|
|||||||
String? upgradeLog;
|
String? upgradeLog;
|
||||||
String? updateLog;
|
String? updateLog;
|
||||||
String lastLog = '';
|
String lastLog = '';
|
||||||
int triedTimes = 0;
|
|
||||||
bool isRequestingPwd = false;
|
bool isRequestingPwd = false;
|
||||||
|
|
||||||
AptProvider();
|
AptProvider();
|
||||||
|
|
||||||
Future<void> init(SSHClient client, Distribution dist, Function() onUpgrade,
|
Future<void> init(
|
||||||
Function() onUpdate, PwdRequestFunc onPasswordRequest) async {
|
SSHClient client,
|
||||||
|
Distribution dist,
|
||||||
|
Function() onUpgrade,
|
||||||
|
Function() onUpdate,
|
||||||
|
PwdRequestFunc onPasswordRequest,
|
||||||
|
String user) async {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.dist = dist;
|
this.dist = dist;
|
||||||
this.onUpgrade = onUpgrade;
|
this.onUpgrade = onUpgrade;
|
||||||
this.onPasswordRequest = onPasswordRequest;
|
this.onPasswordRequest = onPasswordRequest;
|
||||||
whoami = (await client.run('whoami').string).trim();
|
whoami = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get isSU => whoami == 'root';
|
bool get isSU => whoami == 'root';
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
client = null;
|
client = dist = updateLog = upgradeLog = upgradeable =
|
||||||
dist = null;
|
error = whoami = onUpdate = onUpgrade = onPasswordRequest = null;
|
||||||
upgradeable = null;
|
|
||||||
error = null;
|
|
||||||
upgradeLog = null;
|
|
||||||
updateLog = whoami = null;
|
|
||||||
onUpgrade = null;
|
|
||||||
onUpdate = null;
|
|
||||||
onPasswordRequest = null;
|
|
||||||
triedTimes = 0;
|
|
||||||
isRequestingPwd = false;
|
isRequestingPwd = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> refreshInstalled() async {
|
Future<void> refreshInstalled() async {
|
||||||
if (client == null) {
|
|
||||||
error = 'No client';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final result = await _update();
|
final result = await _update();
|
||||||
getUpgradeableList(result);
|
try {
|
||||||
try {} catch (e) {
|
getUpgradeableList(result);
|
||||||
|
} catch (e) {
|
||||||
error = '[Server Raw]:\n$result\n[App Error]:\n$e';
|
error = '[Server Raw]:\n$result\n[App Error]:\n$e';
|
||||||
} finally {
|
} finally {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
@@ -100,32 +88,27 @@ class AptProvider extends BusyProvider {
|
|||||||
upgradeable = list.map((e) => UpgradePkgInfo(e, dist!)).toList();
|
upgradeable = list.map((e) => UpgradePkgInfo(e, dist!)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> _update() async {
|
Future<String?> _update() async {
|
||||||
switch (dist) {
|
switch (dist) {
|
||||||
case Distribution.rehl:
|
case Distribution.rehl:
|
||||||
return await client?.run(_wrap('yum check-update')).string ?? '';
|
return await client?.run(_wrap('yum check-update')).string;
|
||||||
default:
|
default:
|
||||||
final session = await client!.execute(_wrap('apt update'));
|
await client!.exec(
|
||||||
session.stderr.listen((event) => _onPwd(event, session.stdin));
|
_wrap('apt update'),
|
||||||
session.stdout.listen((event) {
|
onStderr: _onPwd,
|
||||||
updateLog = (updateLog ?? '') + event.string;
|
onStdout: (data, sink) {
|
||||||
notifyListeners();
|
updateLog = (updateLog ?? '') + data;
|
||||||
onUpdate ?? () {}();
|
notifyListeners();
|
||||||
});
|
onUpdate!();
|
||||||
await session.done;
|
},
|
||||||
|
);
|
||||||
return await client
|
return await client
|
||||||
?.run('apt list --upgradeable'.withLangExport)
|
?.run('apt list --upgradeable'.withLangExport)
|
||||||
.string ??
|
.string;
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> upgrade() async {
|
Future<void> upgrade() async {
|
||||||
if (client == null) {
|
|
||||||
error = 'No client';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final upgradeCmd = () {
|
final upgradeCmd = () {
|
||||||
switch (dist) {
|
switch (dist) {
|
||||||
case Distribution.rehl:
|
case Distribution.rehl:
|
||||||
@@ -135,38 +118,34 @@ class AptProvider extends BusyProvider {
|
|||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
final session = await client!.execute(_wrap(upgradeCmd));
|
await client!.exec(
|
||||||
session.stderr.listen((e) => _onPwd(e, session.stdin));
|
_wrap(upgradeCmd),
|
||||||
|
onStderr: (data, sink) => _onPwd(data, sink),
|
||||||
session.stdout.listen((data) async {
|
onStdout: (log, sink) {
|
||||||
final log = data.string;
|
if (lastLog == log.trim()) return;
|
||||||
if (lastLog == log.trim()) return;
|
upgradeLog = (upgradeLog ?? '') + log;
|
||||||
upgradeLog = (upgradeLog ?? '') + log;
|
lastLog = log.trim();
|
||||||
lastLog = log.trim();
|
notifyListeners();
|
||||||
notifyListeners();
|
onUpgrade!();
|
||||||
onUpgrade!();
|
},
|
||||||
});
|
);
|
||||||
|
|
||||||
upgradeLog = null;
|
upgradeLog = null;
|
||||||
await session.done;
|
|
||||||
refreshInstalled();
|
refreshInstalled();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onPwd(Uint8List e, StreamSink<Uint8List> stdin) async {
|
Future<void> _onPwd(String event, StreamSink<Uint8List> stdin) async {
|
||||||
if (isRequestingPwd) return;
|
if (isRequestingPwd) return;
|
||||||
isRequestingPwd = true;
|
isRequestingPwd = true;
|
||||||
final event = e.string;
|
|
||||||
if (event.contains('[sudo] password for ')) {
|
if (event.contains('[sudo] password for ')) {
|
||||||
final user = pwdRequestWithUserReg.firstMatch(event)?.group(1);
|
final user = pwdRequestWithUserReg.firstMatch(event)?.group(1);
|
||||||
logger.info('sudo password request for $user');
|
logger.info('sudo password request for $user');
|
||||||
triedTimes++;
|
final pwd = await onPasswordRequest!();
|
||||||
final pwd =
|
|
||||||
await (onPasswordRequest ?? (_, __) async => '')(triedTimes, user);
|
|
||||||
if (pwd.isEmpty) {
|
if (pwd.isEmpty) {
|
||||||
logger.info('sudo password request cancelled');
|
logger.info('sudo password request cancelled');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stdin.add(Uint8List.fromList(utf8.encode('$pwd\n')));
|
stdin.add('$pwd\n'.uint8List);
|
||||||
}
|
}
|
||||||
isRequestingPwd = false;
|
isRequestingPwd = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:dartssh2/dartssh2.dart';
|
import 'package:dartssh2/dartssh2.dart';
|
||||||
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:toolbox/core/extension/ssh_client.dart';
|
||||||
import 'package:toolbox/core/extension/stringx.dart';
|
import 'package:toolbox/core/extension/stringx.dart';
|
||||||
import 'package:toolbox/core/extension/uint8list.dart';
|
import 'package:toolbox/core/extension/uint8list.dart';
|
||||||
import 'package:toolbox/core/provider_base.dart';
|
import 'package:toolbox/core/provider_base.dart';
|
||||||
import 'package:toolbox/data/model/docker/ps.dart';
|
import 'package:toolbox/data/model/docker/ps.dart';
|
||||||
|
import 'package:toolbox/data/res/error.dart';
|
||||||
|
import 'package:toolbox/data/store/docker.dart';
|
||||||
|
import 'package:toolbox/locator.dart';
|
||||||
|
|
||||||
final _dockerNotFound = RegExp(r'command not found|Unknown command');
|
final _dockerNotFound = RegExp(r'command not found|Unknown command');
|
||||||
final _versionReg = RegExp(r'(Version:)\s+([0-9]+\.[0-9]+\.[0-9]+)');
|
final _versionReg = RegExp(r'(Version:)\s+([0-9]+\.[0-9]+\.[0-9]+)');
|
||||||
final _editionReg = RegExp(r'(Client:)\s+(.+-.+)');
|
final _editionReg = RegExp(r'(Client:)\s+(.+-.+)');
|
||||||
final _userIdReg = RegExp(r'.+:(\d+:\d+):.+');
|
|
||||||
|
const _dockerPS = 'docker ps -a';
|
||||||
|
|
||||||
|
final _logger = Logger('DockerProvider');
|
||||||
|
|
||||||
class DockerProvider extends BusyProvider {
|
class DockerProvider extends BusyProvider {
|
||||||
SSHClient? client;
|
SSHClient? client;
|
||||||
@@ -15,82 +26,125 @@ class DockerProvider extends BusyProvider {
|
|||||||
List<DockerPsItem>? items;
|
List<DockerPsItem>? items;
|
||||||
String? version;
|
String? version;
|
||||||
String? edition;
|
String? edition;
|
||||||
String? error;
|
DockerErr? error;
|
||||||
|
PwdRequestFunc? onPwdReq;
|
||||||
|
String? hostId;
|
||||||
|
String? runLog;
|
||||||
|
bool isRequestingPwd = false;
|
||||||
|
|
||||||
void init(SSHClient client, String userName) {
|
void init(SSHClient client, String userName, PwdRequestFunc onPwdReq,
|
||||||
|
String hostId) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
|
this.onPwdReq = onPwdReq;
|
||||||
|
this.hostId = hostId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
client = null;
|
client = userName = error = items = version = edition = onPwdReq = null;
|
||||||
userName = null;
|
isRequestingPwd = false;
|
||||||
error = null;
|
hostId = runLog = null;
|
||||||
items = null;
|
|
||||||
version = null;
|
|
||||||
edition = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> refresh() async {
|
Future<void> refresh() async {
|
||||||
if (client == null) {
|
|
||||||
error = 'no client';
|
|
||||||
notifyListeners();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final verRaw = await client!.run('docker version'.withLangExport).string;
|
final verRaw = await client!.run('docker version'.withLangExport).string;
|
||||||
if (verRaw.contains(_dockerNotFound)) {
|
if (verRaw.contains(_dockerNotFound)) {
|
||||||
error = 'docker not found';
|
error = DockerErr(type: DockerErrType.notInstalled);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
version = _versionReg.firstMatch(verRaw)?.group(2);
|
try {
|
||||||
edition = _editionReg.firstMatch(verRaw)?.group(2);
|
version = _versionReg.firstMatch(verRaw)?.group(2);
|
||||||
|
edition = _editionReg.firstMatch(verRaw)?.group(2);
|
||||||
final passwd = await client!.run('cat /etc/passwd | grep $userName').string;
|
} catch (e) {
|
||||||
final userId = _userIdReg.firstMatch(passwd)?.group(1)?.split(':').first;
|
rethrow;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final cmd = 'docker ps -a'.withLangExport;
|
// judge whether to use DOCKER_HOST / sudo
|
||||||
final raw = await () async {
|
final dockerHost = locator<DockerStore>().getDockerHost(hostId!);
|
||||||
final raw = await client!.run(cmd).string;
|
final cmd = () {
|
||||||
if (raw.contains('permission denied')) {
|
if (dockerHost == null || dockerHost.isEmpty) {
|
||||||
return await client!
|
return 'sudo -S $_dockerPS'.withLangExport;
|
||||||
.run(
|
|
||||||
'export DOCKER_HOST=unix:///run/user/${userId ?? 1000}/docker.sock && $cmd')
|
|
||||||
.string;
|
|
||||||
}
|
}
|
||||||
return raw;
|
return 'export DOCKER_HOST=$dockerHost && $_dockerPS'.withLangExport;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
// run docker ps
|
||||||
|
var raw = '';
|
||||||
|
await client!.exec(
|
||||||
|
cmd,
|
||||||
|
onStderr: _onPwd,
|
||||||
|
onStdout: (data, _) => raw = '$raw$data',
|
||||||
|
);
|
||||||
|
|
||||||
|
// parse result
|
||||||
final lines = raw.split('\n');
|
final lines = raw.split('\n');
|
||||||
lines.removeAt(0);
|
lines.removeAt(0);
|
||||||
lines.removeWhere((element) => element.isEmpty);
|
lines.removeWhere((element) => element.isEmpty);
|
||||||
items = lines.map((e) => DockerPsItem.fromRawString(e)).toList();
|
items = lines.map((e) => DockerPsItem.fromRawString(e)).toList();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e.toString();
|
error = DockerErr(type: DockerErrType.unknown, message: e.toString());
|
||||||
rethrow;
|
rethrow;
|
||||||
} finally {
|
} finally {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _onPwd(String event, StreamSink<Uint8List> stdin) async {
|
||||||
|
if (isRequestingPwd) return;
|
||||||
|
isRequestingPwd = true;
|
||||||
|
if (event.contains('[sudo] password for ')) {
|
||||||
|
_logger.info('sudo password request for $userName');
|
||||||
|
final pwd = await onPwdReq!();
|
||||||
|
if (pwd.isEmpty) {
|
||||||
|
_logger.info('sudo password request cancelled');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stdin.add('$pwd\n'.uint8List);
|
||||||
|
}
|
||||||
|
isRequestingPwd = false;
|
||||||
|
}
|
||||||
|
|
||||||
Future<bool> _do(String id, String cmd) async {
|
Future<bool> _do(String id, String cmd) async {
|
||||||
setBusyState();
|
setBusyState();
|
||||||
if (client == null) {
|
final result = await client!.run('$cmd $id').string;
|
||||||
error = 'no client';
|
|
||||||
setBusyState(false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final result = await client!.run(cmd).string;
|
|
||||||
await refresh();
|
await refresh();
|
||||||
setBusyState(false);
|
setBusyState(false);
|
||||||
return result.contains(id);
|
return result.contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> stop(String id) async => await _do(id, 'docker stop $id');
|
Future<bool> stop(String id) async => await _do(id, 'docker stop');
|
||||||
|
|
||||||
Future<bool> start(String id) async => await _do(id, 'docker start $id');
|
Future<bool> start(String id) async => await _do(id, 'docker start');
|
||||||
|
|
||||||
Future<bool> delete(String id) async => await _do(id, 'docker rm $id');
|
Future<bool> delete(String id) async => await _do(id, 'docker rm');
|
||||||
|
|
||||||
|
Future<DockerErr?> run(String cmd) async {
|
||||||
|
if (!cmd.startsWith('docker ')) {
|
||||||
|
return DockerErr(type: DockerErrType.cmdNoPrefix);
|
||||||
|
}
|
||||||
|
setBusyState();
|
||||||
|
|
||||||
|
final errs = <String>[];
|
||||||
|
final code = await client!.exec(
|
||||||
|
cmd,
|
||||||
|
onStderr: (data, _) => errs.add(data),
|
||||||
|
onStdout: (data, _) {
|
||||||
|
runLog = '$runLog$data';
|
||||||
|
notifyListeners();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
runLog = null;
|
||||||
|
|
||||||
|
if (errs.isNotEmpty || code != 0) {
|
||||||
|
setBusyState(false);
|
||||||
|
return DockerErr(type: DockerErrType.unknown, message: errs.join('\n'));
|
||||||
|
}
|
||||||
|
await refresh();
|
||||||
|
setBusyState(false);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 165;
|
static const int build = 166;
|
||||||
static const String engine =
|
static const String engine =
|
||||||
"Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b8f7f1f986 (12 days ago) • 2022-11-23 06:43:51 +0900\nEngine • revision 8f2221fbef\nTools • Dart 2.18.5 • DevTools 2.15.0\n";
|
"Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b8f7f1f986 (12 days ago) • 2022-11-23 06:43:51 +0900\nEngine • revision 8f2221fbef\nTools • Dart 2.18.5 • DevTools 2.15.0\n";
|
||||||
static const String buildAt = "2022-12-04 21:41:26.055331";
|
static const String buildAt = "2022-12-04 21:57:10.591121";
|
||||||
static const int modifications = 1;
|
static const int modifications = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
28
lib/data/res/error.dart
Normal file
28
lib/data/res/error.dart
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
enum ErrFrom {
|
||||||
|
unknown,
|
||||||
|
apt,
|
||||||
|
docker,
|
||||||
|
sftp,
|
||||||
|
ssh,
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Err<T> {
|
||||||
|
final ErrFrom from;
|
||||||
|
final T type;
|
||||||
|
final String? message;
|
||||||
|
|
||||||
|
Err({required this.from, required this.type, this.message});
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DockerErrType {
|
||||||
|
unknown,
|
||||||
|
noClient,
|
||||||
|
notInstalled,
|
||||||
|
invalidVersion,
|
||||||
|
cmdNoPrefix
|
||||||
|
}
|
||||||
|
|
||||||
|
class DockerErr extends Err<DockerErrType> {
|
||||||
|
DockerErr({required DockerErrType type, String? message})
|
||||||
|
: super(from: ErrFrom.docker, type: type, message: message);
|
||||||
|
}
|
||||||
11
lib/data/store/docker.dart
Normal file
11
lib/data/store/docker.dart
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import 'package:toolbox/core/persistant_store.dart';
|
||||||
|
|
||||||
|
class DockerStore extends PersistentStore {
|
||||||
|
String? getDockerHost(String id) {
|
||||||
|
return box.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setDockerHost(String id, String host) {
|
||||||
|
box.put(id, host);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ class SettingStore extends PersistentStore {
|
|||||||
StoreProperty<int> get primaryColor =>
|
StoreProperty<int> get primaryColor =>
|
||||||
property('primaryColor', defaultValue: Colors.deepPurpleAccent.value);
|
property('primaryColor', defaultValue: Colors.deepPurpleAccent.value);
|
||||||
StoreProperty<int> get serverStatusUpdateInterval =>
|
StoreProperty<int> get serverStatusUpdateInterval =>
|
||||||
property('serverStatusUpdateInterval', defaultValue: 2);
|
property('serverStatusUpdateInterval', defaultValue: 5);
|
||||||
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
||||||
|
|
||||||
StoreProperty<int> get storeVersion =>
|
StoreProperty<int> get storeVersion =>
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"clear": MessageLookupByLibrary.simpleMessage("Clear"),
|
"clear": MessageLookupByLibrary.simpleMessage("Clear"),
|
||||||
"clickSee": MessageLookupByLibrary.simpleMessage("Click here"),
|
"clickSee": MessageLookupByLibrary.simpleMessage("Click here"),
|
||||||
"close": MessageLookupByLibrary.simpleMessage("Close"),
|
"close": MessageLookupByLibrary.simpleMessage("Close"),
|
||||||
|
"cmd": MessageLookupByLibrary.simpleMessage("Command"),
|
||||||
"containerStatus":
|
"containerStatus":
|
||||||
MessageLookupByLibrary.simpleMessage("Container status"),
|
MessageLookupByLibrary.simpleMessage("Container status"),
|
||||||
"convert": MessageLookupByLibrary.simpleMessage("Convert"),
|
"convert": MessageLookupByLibrary.simpleMessage("Convert"),
|
||||||
@@ -94,6 +95,14 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"delete": MessageLookupByLibrary.simpleMessage("Delete"),
|
"delete": MessageLookupByLibrary.simpleMessage("Delete"),
|
||||||
"disconnected": MessageLookupByLibrary.simpleMessage("Disconnected"),
|
"disconnected": MessageLookupByLibrary.simpleMessage("Disconnected"),
|
||||||
"dl2Local": m0,
|
"dl2Local": m0,
|
||||||
|
"dockerCmdPrefixErr": MessageLookupByLibrary.simpleMessage(
|
||||||
|
"Please make sure that the docker command prefix is correct."),
|
||||||
|
"dockerEditHost":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Edit DOCKER_HOST"),
|
||||||
|
"dockerEmptyRunningItems": MessageLookupByLibrary.simpleMessage(
|
||||||
|
"No running container. \nIt may be that the env DOCKER_HOST is not read correctly. You can found it by running `echo \$DOCKER_HOST` in terminal."),
|
||||||
|
"dockerNotInstalled":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Docker not installed"),
|
||||||
"dockerStatusRunningAndStoppedFmt": m1,
|
"dockerStatusRunningAndStoppedFmt": m1,
|
||||||
"dockerStatusRunningFmt": m2,
|
"dockerStatusRunningFmt": m2,
|
||||||
"download": MessageLookupByLibrary.simpleMessage("Download"),
|
"download": MessageLookupByLibrary.simpleMessage("Download"),
|
||||||
@@ -128,6 +137,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
||||||
"Please https://docs.docker.com/engine/install docker first."),
|
"Please https://docs.docker.com/engine/install docker first."),
|
||||||
"invalidJson": MessageLookupByLibrary.simpleMessage("Invalid JSON"),
|
"invalidJson": MessageLookupByLibrary.simpleMessage("Invalid JSON"),
|
||||||
|
"invalidVersion":
|
||||||
|
MessageLookupByLibrary.simpleMessage("Invalid version"),
|
||||||
"invalidVersionHelp": m6,
|
"invalidVersionHelp": m6,
|
||||||
"keepForeground":
|
"keepForeground":
|
||||||
MessageLookupByLibrary.simpleMessage("Keep app foreground!"),
|
MessageLookupByLibrary.simpleMessage("Keep app foreground!"),
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"clear": MessageLookupByLibrary.simpleMessage("清除"),
|
"clear": MessageLookupByLibrary.simpleMessage("清除"),
|
||||||
"clickSee": MessageLookupByLibrary.simpleMessage("点击查看"),
|
"clickSee": MessageLookupByLibrary.simpleMessage("点击查看"),
|
||||||
"close": MessageLookupByLibrary.simpleMessage("关闭"),
|
"close": MessageLookupByLibrary.simpleMessage("关闭"),
|
||||||
|
"cmd": MessageLookupByLibrary.simpleMessage("命令"),
|
||||||
"containerStatus": MessageLookupByLibrary.simpleMessage("容器状态"),
|
"containerStatus": MessageLookupByLibrary.simpleMessage("容器状态"),
|
||||||
"convert": MessageLookupByLibrary.simpleMessage("转换"),
|
"convert": MessageLookupByLibrary.simpleMessage("转换"),
|
||||||
"copy": MessageLookupByLibrary.simpleMessage("复制到剪切板"),
|
"copy": MessageLookupByLibrary.simpleMessage("复制到剪切板"),
|
||||||
@@ -88,6 +89,13 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"delete": MessageLookupByLibrary.simpleMessage("删除"),
|
"delete": MessageLookupByLibrary.simpleMessage("删除"),
|
||||||
"disconnected": MessageLookupByLibrary.simpleMessage("连接断开"),
|
"disconnected": MessageLookupByLibrary.simpleMessage("连接断开"),
|
||||||
"dl2Local": m0,
|
"dl2Local": m0,
|
||||||
|
"dockerCmdPrefixErr":
|
||||||
|
MessageLookupByLibrary.simpleMessage("命令前缀错误,没有以 `docker` 开头"),
|
||||||
|
"dockerEditHost":
|
||||||
|
MessageLookupByLibrary.simpleMessage("编辑 DOCKER_HOST"),
|
||||||
|
"dockerEmptyRunningItems": MessageLookupByLibrary.simpleMessage(
|
||||||
|
"没有正在运行的容器。\n这可能是因为环境变量 DOCKER_HOST 没有被正确读取。你可以通过在终端内运行 `echo \$DOCKER_HOST` 来获取。"),
|
||||||
|
"dockerNotInstalled": MessageLookupByLibrary.simpleMessage("Docker未安装"),
|
||||||
"dockerStatusRunningAndStoppedFmt": m1,
|
"dockerStatusRunningAndStoppedFmt": m1,
|
||||||
"dockerStatusRunningFmt": m2,
|
"dockerStatusRunningFmt": m2,
|
||||||
"download": MessageLookupByLibrary.simpleMessage("下载"),
|
"download": MessageLookupByLibrary.simpleMessage("下载"),
|
||||||
@@ -116,6 +124,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||||||
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
"installDockerWithUrl": MessageLookupByLibrary.simpleMessage(
|
||||||
"请先 https://docs.docker.com/engine/install docker"),
|
"请先 https://docs.docker.com/engine/install docker"),
|
||||||
"invalidJson": MessageLookupByLibrary.simpleMessage("无效的json,存在格式问题"),
|
"invalidJson": MessageLookupByLibrary.simpleMessage("无效的json,存在格式问题"),
|
||||||
|
"invalidVersion": MessageLookupByLibrary.simpleMessage("不支持的版本"),
|
||||||
"invalidVersionHelp": m6,
|
"invalidVersionHelp": m6,
|
||||||
"keepForeground": MessageLookupByLibrary.simpleMessage("请保持应用处于前台!"),
|
"keepForeground": MessageLookupByLibrary.simpleMessage("请保持应用处于前台!"),
|
||||||
"keyAuth": MessageLookupByLibrary.simpleMessage("公钥认证"),
|
"keyAuth": MessageLookupByLibrary.simpleMessage("公钥认证"),
|
||||||
|
|||||||
@@ -1350,6 +1350,66 @@ class S {
|
|||||||
args: [],
|
args: [],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// `Docker not installed`
|
||||||
|
String get dockerNotInstalled {
|
||||||
|
return Intl.message(
|
||||||
|
'Docker not installed',
|
||||||
|
name: 'dockerNotInstalled',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `Invalid version`
|
||||||
|
String get invalidVersion {
|
||||||
|
return Intl.message(
|
||||||
|
'Invalid version',
|
||||||
|
name: 'invalidVersion',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `Command`
|
||||||
|
String get cmd {
|
||||||
|
return Intl.message(
|
||||||
|
'Command',
|
||||||
|
name: 'cmd',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `No running container. \nIt may be that the env DOCKER_HOST is not read correctly. You can found it by running 'echo $DOCKER_HOST' in terminal.`
|
||||||
|
String get dockerEmptyRunningItems {
|
||||||
|
return Intl.message(
|
||||||
|
'No running container. \nIt may be that the env DOCKER_HOST is not read correctly. You can found it by running `echo \$DOCKER_HOST` in terminal.',
|
||||||
|
name: 'dockerEmptyRunningItems',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `Edit DOCKER_HOST`
|
||||||
|
String get dockerEditHost {
|
||||||
|
return Intl.message(
|
||||||
|
'Edit DOCKER_HOST',
|
||||||
|
name: 'dockerEditHost',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `Please make sure that the docker command prefix is correct.`
|
||||||
|
String get dockerCmdPrefixErr {
|
||||||
|
return Intl.message(
|
||||||
|
'Please make sure that the docker command prefix is correct.',
|
||||||
|
name: 'dockerCmdPrefixErr',
|
||||||
|
desc: '',
|
||||||
|
args: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
||||||
|
|||||||
@@ -128,5 +128,11 @@
|
|||||||
"feedback": "Feedback",
|
"feedback": "Feedback",
|
||||||
"feedbackOnGithub": "If you have any questions, please feedback on Github.",
|
"feedbackOnGithub": "If you have any questions, please feedback on Github.",
|
||||||
"update": "Update",
|
"update": "Update",
|
||||||
"inputDomainHere": "Input Domain here"
|
"inputDomainHere": "Input Domain here",
|
||||||
|
"dockerNotInstalled": "Docker not installed",
|
||||||
|
"invalidVersion": "Invalid version",
|
||||||
|
"cmd": "Command",
|
||||||
|
"dockerEmptyRunningItems": "No running container. \nIt may be that the env DOCKER_HOST is not read correctly. You can found it by running `echo $DOCKER_HOST` in terminal.",
|
||||||
|
"dockerEditHost": "Edit DOCKER_HOST",
|
||||||
|
"dockerCmdPrefixErr": "Please make sure that the docker command prefix is correct."
|
||||||
}
|
}
|
||||||
@@ -128,5 +128,11 @@
|
|||||||
"feedback": "反馈",
|
"feedback": "反馈",
|
||||||
"feedbackOnGithub": "如果你有任何问题,请在GitHub反馈",
|
"feedbackOnGithub": "如果你有任何问题,请在GitHub反馈",
|
||||||
"update": "更新",
|
"update": "更新",
|
||||||
"inputDomainHere": "在这里输入域名"
|
"inputDomainHere": "在这里输入域名",
|
||||||
|
"dockerNotInstalled": "Docker未安装",
|
||||||
|
"invalidVersion": "不支持的版本",
|
||||||
|
"cmd": "命令",
|
||||||
|
"dockerEmptyRunningItems": "没有正在运行的容器。\n这可能是因为环境变量 DOCKER_HOST 没有被正确读取。你可以通过在终端内运行 `echo $DOCKER_HOST` 来获取。",
|
||||||
|
"dockerEditHost": "编辑 DOCKER_HOST",
|
||||||
|
"dockerCmdPrefixErr": "命令前缀错误,没有以 `docker` 开头"
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ import 'package:toolbox/data/provider/server.dart';
|
|||||||
import 'package:toolbox/data/provider/sftp_download.dart';
|
import 'package:toolbox/data/provider/sftp_download.dart';
|
||||||
import 'package:toolbox/data/provider/snippet.dart';
|
import 'package:toolbox/data/provider/snippet.dart';
|
||||||
import 'package:toolbox/data/service/app.dart';
|
import 'package:toolbox/data/service/app.dart';
|
||||||
|
import 'package:toolbox/data/store/docker.dart';
|
||||||
import 'package:toolbox/data/store/private_key.dart';
|
import 'package:toolbox/data/store/private_key.dart';
|
||||||
import 'package:toolbox/data/store/server.dart';
|
import 'package:toolbox/data/store/server.dart';
|
||||||
import 'package:toolbox/data/store/setting.dart';
|
import 'package:toolbox/data/store/setting.dart';
|
||||||
@@ -46,6 +47,10 @@ Future<void> setupLocatorForStores() async {
|
|||||||
final snippet = SnippetStore();
|
final snippet = SnippetStore();
|
||||||
await snippet.init(boxName: 'snippet');
|
await snippet.init(boxName: 'snippet');
|
||||||
locator.registerSingleton(snippet);
|
locator.registerSingleton(snippet);
|
||||||
|
|
||||||
|
final docker = DockerStore();
|
||||||
|
await docker.init(boxName: 'docker');
|
||||||
|
locator.registerSingleton(docker);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setupLocator() async {
|
Future<void> setupLocator() async {
|
||||||
|
|||||||
@@ -58,61 +58,60 @@ class _AptManagePageState extends State<AptManagePage>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: prefer_function_declarations_over_variables
|
|
||||||
Function onSubmitted = () {
|
|
||||||
if (textController.text == '') {
|
|
||||||
showRoundDialog(context, s.attention, Text(s.fieldMustNotEmpty), [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(context).pop(), child: Text(s.ok)),
|
|
||||||
]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
};
|
|
||||||
|
|
||||||
// ignore: prefer_function_declarations_over_variables
|
|
||||||
PwdRequestFunc onPwdRequest = (triedTimes, user) async {
|
|
||||||
if (!mounted) return '';
|
|
||||||
await showRoundDialog(
|
|
||||||
context,
|
|
||||||
triedTimes == 3 ? s.lastTry : (user ?? s.unknown),
|
|
||||||
TextField(
|
|
||||||
controller: textController,
|
|
||||||
keyboardType: TextInputType.visiblePassword,
|
|
||||||
obscureText: true,
|
|
||||||
onSubmitted: (_) => onSubmitted(),
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: s.pwd,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
[
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
child: Text(s.cancel)),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => onSubmitted(),
|
|
||||||
child: Text(
|
|
||||||
s.ok,
|
|
||||||
style: const TextStyle(color: Colors.red),
|
|
||||||
)),
|
|
||||||
]);
|
|
||||||
return textController.text.trim();
|
|
||||||
};
|
|
||||||
|
|
||||||
_aptProvider.init(
|
_aptProvider.init(
|
||||||
si.client!,
|
si.client!,
|
||||||
si.status.sysVer.dist,
|
si.status.sysVer.dist,
|
||||||
() =>
|
() =>
|
||||||
scrollController.jumpTo(scrollController.position.maxScrollExtent),
|
scrollController.jumpTo(scrollController.position.maxScrollExtent),
|
||||||
() => scrollControllerUpdate
|
() => scrollControllerUpdate
|
||||||
.jumpTo(scrollControllerUpdate.positions.last.maxScrollExtent),
|
.jumpTo(scrollController.position.maxScrollExtent),
|
||||||
onPwdRequest);
|
onPwdRequest,
|
||||||
|
widget.spi.user);
|
||||||
_aptProvider.refreshInstalled();
|
_aptProvider.refreshInstalled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onSubmitted() {
|
||||||
|
if (textController.text == '') {
|
||||||
|
showRoundDialog(context, s.attention, Text(s.fieldMustNotEmpty), [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(), child: Text(s.ok)),
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> onPwdRequest() async {
|
||||||
|
if (!mounted) return '';
|
||||||
|
await showRoundDialog(
|
||||||
|
context,
|
||||||
|
widget.spi.user,
|
||||||
|
TextField(
|
||||||
|
controller: textController,
|
||||||
|
keyboardType: TextInputType.visiblePassword,
|
||||||
|
obscureText: true,
|
||||||
|
onSubmitted: (_) => onSubmitted(),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: s.pwd,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Text(s.cancel)),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => onSubmitted(),
|
||||||
|
child: Text(
|
||||||
|
s.ok,
|
||||||
|
style: const TextStyle(color: Colors.red),
|
||||||
|
)),
|
||||||
|
]);
|
||||||
|
return textController.text.trim();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import 'package:toolbox/data/model/docker/ps.dart';
|
|||||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||||
import 'package:toolbox/data/provider/docker.dart';
|
import 'package:toolbox/data/provider/docker.dart';
|
||||||
import 'package:toolbox/data/provider/server.dart';
|
import 'package:toolbox/data/provider/server.dart';
|
||||||
|
import 'package:toolbox/data/res/error.dart';
|
||||||
import 'package:toolbox/data/res/url.dart';
|
import 'package:toolbox/data/res/url.dart';
|
||||||
|
import 'package:toolbox/data/store/docker.dart';
|
||||||
import 'package:toolbox/generated/l10n.dart';
|
import 'package:toolbox/generated/l10n.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
import 'package:toolbox/view/widget/center_loading.dart';
|
import 'package:toolbox/view/widget/center_loading.dart';
|
||||||
@@ -25,6 +27,7 @@ class DockerManagePage extends StatefulWidget {
|
|||||||
class _DockerManagePageState extends State<DockerManagePage> {
|
class _DockerManagePageState extends State<DockerManagePage> {
|
||||||
final _docker = locator<DockerProvider>();
|
final _docker = locator<DockerProvider>();
|
||||||
final greyTextStyle = const TextStyle(color: Colors.grey);
|
final greyTextStyle = const TextStyle(color: Colors.grey);
|
||||||
|
final textController = TextEditingController();
|
||||||
late S s;
|
late S s;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -51,69 +54,233 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
|||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_docker.init(client, widget.spi.user);
|
_docker.init(client, widget.spi.user, onPwdRequest, widget.spi.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
centerTitle: true,
|
|
||||||
title: TwoLineText(up: 'Docker', down: widget.spi.name),
|
|
||||||
),
|
|
||||||
body: _buildMain(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildMain() {
|
|
||||||
return Consumer<DockerProvider>(builder: (_, docker, __) {
|
return Consumer<DockerProvider>(builder: (_, docker, __) {
|
||||||
final running = docker.items;
|
return Scaffold(
|
||||||
if (docker.error != null && running == null) {
|
appBar: AppBar(
|
||||||
return SizedBox.expand(
|
centerTitle: true,
|
||||||
child: Column(
|
title: TwoLineText(up: 'Docker', down: widget.spi.name),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
actions: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
IconButton(
|
||||||
children: [
|
onPressed: () => docker.refresh(),
|
||||||
const Icon(
|
icon: const Icon(Icons.refresh))
|
||||||
Icons.error,
|
],
|
||||||
size: 37,
|
),
|
||||||
),
|
body: _buildMain(docker),
|
||||||
const SizedBox(height: 27),
|
floatingActionButton: _buildFAB(docker),
|
||||||
Text(docker.error!),
|
|
||||||
const SizedBox(height: 27),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(17),
|
|
||||||
child: _buildSolution(docker.error!),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (running == null) {
|
|
||||||
_docker.refresh();
|
|
||||||
return centerLoading;
|
|
||||||
}
|
|
||||||
return ListView(
|
|
||||||
padding: const EdgeInsets.all(7),
|
|
||||||
children: [
|
|
||||||
_buildVersion(
|
|
||||||
docker.edition ?? s.unknown, docker.version ?? s.unknown),
|
|
||||||
_buildPsItems(running, docker)
|
|
||||||
].map((e) => RoundRectCard(e)).toList(),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSolution(String err) {
|
Widget _buildFAB(DockerProvider docker) {
|
||||||
switch (err) {
|
final c = TextEditingController();
|
||||||
case 'docker not found':
|
return FloatingActionButton(
|
||||||
|
onPressed: () {
|
||||||
|
showRoundDialog(
|
||||||
|
context,
|
||||||
|
s.cmd,
|
||||||
|
TextField(
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
maxLines: 7,
|
||||||
|
controller: c,
|
||||||
|
autocorrect: false,
|
||||||
|
),
|
||||||
|
[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
child: Text(s.cancel),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
final result = await docker.run(c.text.trim());
|
||||||
|
if (result != null) {
|
||||||
|
showSnackBar(
|
||||||
|
context, Text(getErrMsg(result) ?? s.unknownError));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Text(s.run),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: const Icon(Icons.code),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String? getErrMsg(DockerErr err) {
|
||||||
|
switch (err.type) {
|
||||||
|
case DockerErrType.cmdNoPrefix:
|
||||||
|
return s.dockerCmdPrefixErr;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void onSubmitted() {
|
||||||
|
if (textController.text == '') {
|
||||||
|
showRoundDialog(context, s.attention, Text(s.fieldMustNotEmpty), [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(), child: Text(s.ok)),
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> onPwdRequest() async {
|
||||||
|
if (!mounted) return '';
|
||||||
|
await showRoundDialog(
|
||||||
|
context,
|
||||||
|
widget.spi.user,
|
||||||
|
TextField(
|
||||||
|
controller: textController,
|
||||||
|
keyboardType: TextInputType.visiblePassword,
|
||||||
|
obscureText: true,
|
||||||
|
onSubmitted: (_) => onSubmitted(),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: s.pwd,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Text(s.cancel)),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => onSubmitted(),
|
||||||
|
child: Text(
|
||||||
|
s.ok,
|
||||||
|
style: const TextStyle(color: Colors.red),
|
||||||
|
)),
|
||||||
|
]);
|
||||||
|
return textController.text.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMain(DockerProvider docker) {
|
||||||
|
final running = docker.items;
|
||||||
|
if (docker.error != null && running == null) {
|
||||||
|
return SizedBox.expand(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 37,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 27),
|
||||||
|
_buildErr(docker.error!),
|
||||||
|
const SizedBox(height: 27),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(17),
|
||||||
|
child: _buildSolution(docker.error!),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (running == null) {
|
||||||
|
_docker.refresh();
|
||||||
|
return centerLoading;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ListView(
|
||||||
|
padding: const EdgeInsets.all(7),
|
||||||
|
children: [
|
||||||
|
_buildVersion(docker.edition ?? s.unknown, docker.version ?? s.unknown),
|
||||||
|
_buildPsItems(running, docker),
|
||||||
|
_buildEditHost(running, docker),
|
||||||
|
_buildRunLog(docker),
|
||||||
|
].map((e) => RoundRectCard(e)).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildRunLog(DockerProvider docker) {
|
||||||
|
if (docker.runLog == null) return const SizedBox();
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(17),
|
||||||
|
child: Text(docker.runLog!, maxLines: 1,),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildEditHost(List<DockerPsItem> running, DockerProvider docker) {
|
||||||
|
if (running.isEmpty) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(17, 17, 17, 0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
s.dockerEmptyRunningItems,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => _showEditHostDialog(docker),
|
||||||
|
child: Text(s.dockerEditHost))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _showEditHostDialog(DockerProvider docker) async {
|
||||||
|
await showRoundDialog(
|
||||||
|
context,
|
||||||
|
s.dockerEditHost,
|
||||||
|
TextField(
|
||||||
|
maxLines: 1,
|
||||||
|
autocorrect: false,
|
||||||
|
controller:
|
||||||
|
TextEditingController(text: 'unix:///run/user/1000/docker.sock'),
|
||||||
|
onSubmitted: (value) {
|
||||||
|
locator<DockerStore>().setDockerHost(widget.spi.id, value.trim());
|
||||||
|
docker.refresh();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
child: Text(s.cancel)),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildErr(DockerErr err) {
|
||||||
|
var errStr = '';
|
||||||
|
switch (err.type) {
|
||||||
|
case DockerErrType.noClient:
|
||||||
|
errStr = s.noClient;
|
||||||
|
break;
|
||||||
|
case DockerErrType.notInstalled:
|
||||||
|
errStr = s.dockerNotInstalled;
|
||||||
|
break;
|
||||||
|
case DockerErrType.invalidVersion:
|
||||||
|
errStr = s.invalidVersion;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
errStr = err.message ?? s.unknown;
|
||||||
|
}
|
||||||
|
return Text(errStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildSolution(DockerErr err) {
|
||||||
|
switch (err.type) {
|
||||||
|
case DockerErrType.notInstalled:
|
||||||
return UrlText(
|
return UrlText(
|
||||||
text: s.installDockerWithUrl,
|
text: s.installDockerWithUrl,
|
||||||
replace: s.install,
|
replace: s.install,
|
||||||
);
|
);
|
||||||
case 'no client':
|
case DockerErrType.noClient:
|
||||||
return Text(s.waitConnection);
|
return Text(s.waitConnection);
|
||||||
case 'invalid version':
|
case DockerErrType.invalidVersion:
|
||||||
return UrlText(
|
return UrlText(
|
||||||
text: s.invalidVersionHelp(issueUrl),
|
text: s.invalidVersionHelp(issueUrl),
|
||||||
replace: 'Github',
|
replace: 'Github',
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
body: ListView(
|
body: ListView(
|
||||||
padding: const EdgeInsets.all(13),
|
padding: const EdgeInsets.all(13),
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: _media.size.height * 0.03),
|
SizedBox(height: _media.size.height * 0.01),
|
||||||
_buildLinuxIcon(si.status.sysVer),
|
_buildLinuxIcon(si.status.sysVer),
|
||||||
SizedBox(height: _media.size.height * 0.03),
|
SizedBox(height: _media.size.height * 0.03),
|
||||||
_buildUpTimeAndSys(si.status),
|
_buildUpTimeAndSys(si.status),
|
||||||
|
|||||||
34
macos/Podfile.lock
Normal file
34
macos/Podfile.lock
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
PODS:
|
||||||
|
- FlutterMacOS (1.0.0)
|
||||||
|
- path_provider_macos (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
|
- share_plus_macos (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
|
- url_launcher_macos (0.0.1):
|
||||||
|
- FlutterMacOS
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||||
|
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
|
||||||
|
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
|
||||||
|
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
FlutterMacOS:
|
||||||
|
:path: Flutter/ephemeral
|
||||||
|
path_provider_macos:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
|
||||||
|
share_plus_macos:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos
|
||||||
|
url_launcher_macos:
|
||||||
|
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
|
||||||
|
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
|
||||||
|
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4
|
||||||
|
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
|
||||||
|
|
||||||
|
COCOAPODS: 1.11.3
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||||
|
C86960F09D66BFB9F9EAF159 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12CD422E1FDAE58EFAA39492 /* Pods_Runner.framework */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@@ -52,9 +53,10 @@
|
|||||||
/* End PBXCopyFilesBuildPhase section */
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
12CD422E1FDAE58EFAA39492 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||||
33CC10ED2044A3C60003C045 /* server_box.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "server_box.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
33CC10ED2044A3C60003C045 /* server_box.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = server_box.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||||
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||||
@@ -66,8 +68,11 @@
|
|||||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||||
|
62CF3F38CCFA54DE5E957523 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
|
B6755FBA95AAD9208D08281D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
E8756DDE15E6B592B0279207 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -75,12 +80,24 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
C86960F09D66BFB9F9EAF159 /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
|
14E85A356189F50B8E9FC339 /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
E8756DDE15E6B592B0279207 /* Pods-Runner.debug.xcconfig */,
|
||||||
|
B6755FBA95AAD9208D08281D /* Pods-Runner.release.xcconfig */,
|
||||||
|
62CF3F38CCFA54DE5E957523 /* Pods-Runner.profile.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
path = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
33BA886A226E78AF003329D5 /* Configs */ = {
|
33BA886A226E78AF003329D5 /* Configs */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -99,6 +116,7 @@
|
|||||||
33CEB47122A05771004F2AC0 /* Flutter */,
|
33CEB47122A05771004F2AC0 /* Flutter */,
|
||||||
33CC10EE2044A3C60003C045 /* Products */,
|
33CC10EE2044A3C60003C045 /* Products */,
|
||||||
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||||
|
14E85A356189F50B8E9FC339 /* Pods */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -148,6 +166,7 @@
|
|||||||
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
12CD422E1FDAE58EFAA39492 /* Pods_Runner.framework */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -159,11 +178,13 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
59089466276869E3A7766664 /* [CP] Check Pods Manifest.lock */,
|
||||||
33CC10E92044A3C60003C045 /* Sources */,
|
33CC10E92044A3C60003C045 /* Sources */,
|
||||||
33CC10EA2044A3C60003C045 /* Frameworks */,
|
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||||
33CC10EB2044A3C60003C045 /* Resources */,
|
33CC10EB2044A3C60003C045 /* Resources */,
|
||||||
33CC110E2044A8840003C045 /* Bundle Framework */,
|
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||||
|
4365C365EEF06532F9E082D0 /* [CP] Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -270,6 +291,45 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||||
};
|
};
|
||||||
|
4365C365EEF06532F9E082D0 /* [CP] Embed Pods Frameworks */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||||
|
);
|
||||||
|
name = "[CP] Embed Pods Frameworks";
|
||||||
|
outputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
59089466276869E3A7766664 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
|||||||
Reference in New Issue
Block a user