fix #3
- server edit page display bugs, include userPubKey and pubKeyIdx
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 = 145;
|
CURRENT_PROJECT_VERSION = 146;
|
||||||
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.145;
|
MARKETING_VERSION = 1.0.146;
|
||||||
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 = 145;
|
CURRENT_PROJECT_VERSION = 146;
|
||||||
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.145;
|
MARKETING_VERSION = 1.0.146;
|
||||||
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 = 145;
|
CURRENT_PROJECT_VERSION = 146;
|
||||||
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.145;
|
MARKETING_VERSION = 1.0.146;
|
||||||
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";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ enum _BuildMode {
|
|||||||
profile,
|
profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
_BuildMode _buildMode = (() {
|
final _buildMode = (() {
|
||||||
if (const bool.fromEnvironment('dart.vm.product')) {
|
if (const bool.fromEnvironment('dart.vm.product')) {
|
||||||
return _BuildMode.release;
|
return _BuildMode.release;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,6 @@ class ProviderBase with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ProviderState {
|
|
||||||
idle,
|
|
||||||
busy,
|
|
||||||
}
|
|
||||||
|
|
||||||
class BusyProvider extends ProviderBase {
|
class BusyProvider extends ProviderBase {
|
||||||
bool _isBusy = false;
|
bool _isBusy = false;
|
||||||
bool get isBusy => _isBusy;
|
bool get isBusy => _isBusy;
|
||||||
|
|||||||
@@ -1,20 +1,9 @@
|
|||||||
import 'package:toolbox/core/provider_base.dart';
|
import 'package:toolbox/core/provider_base.dart';
|
||||||
import 'package:toolbox/data/service/app.dart';
|
|
||||||
|
|
||||||
class AppProvider extends BusyProvider {
|
class AppProvider extends BusyProvider {
|
||||||
Map? _notify;
|
|
||||||
Map? get notify => _notify;
|
|
||||||
int? _newestBuild;
|
int? _newestBuild;
|
||||||
int? get newestBuild => _newestBuild;
|
int? get newestBuild => _newestBuild;
|
||||||
|
|
||||||
Future<void> loadData() async {
|
|
||||||
setBusyState(true);
|
|
||||||
final service = AppService();
|
|
||||||
_notify = await service.getNotify();
|
|
||||||
setBusyState(false);
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setNewestBuild(int build) {
|
void setNewestBuild(int build) {
|
||||||
_newestBuild = build;
|
_newestBuild = build;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
@@ -66,42 +66,22 @@ class DockerProvider extends BusyProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> stop(String id) async {
|
Future<bool> _do(String id, String cmd) async {
|
||||||
setBusyState();
|
setBusyState();
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
error = 'no client';
|
error = 'no client';
|
||||||
setBusyState(false);
|
setBusyState(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final result = await client!.run('docker stop $id').string;
|
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> start(String id) async {
|
Future<bool> stop(String id) async => await _do(id, 'docker stop $id');
|
||||||
setBusyState();
|
|
||||||
if (client == null) {
|
|
||||||
error = 'no client';
|
|
||||||
setBusyState(false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final result = await client!.run('docker start $id').string;
|
|
||||||
await refresh();
|
|
||||||
setBusyState(false);
|
|
||||||
return result.contains(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<bool> delete(String id) async {
|
Future<bool> start(String id) async => await _do(id, 'docker start $id');
|
||||||
setBusyState();
|
|
||||||
if (client == null) {
|
Future<bool> delete(String id) async => await _do(id, 'docker rm $id');
|
||||||
error = 'no client';
|
|
||||||
setBusyState(false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final result = await client!.run('docker rm $id').string;
|
|
||||||
await refresh();
|
|
||||||
setBusyState(false);
|
|
||||||
return result.contains(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 145;
|
static const int build = 146;
|
||||||
static const String engine =
|
static const String engine =
|
||||||
"Flutter 3.0.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision fb57da5f94 (4 days ago) • 2022-05-19 15:50:29 -0700\nEngine • revision caaafc5604\nTools • Dart 2.17.1 • DevTools 2.12.2\n";
|
"Flutter 3.0.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision fb57da5f94 (4 days ago) • 2022-05-19 15:50:29 -0700\nEngine • revision caaafc5604\nTools • Dart 2.17.1 • DevTools 2.12.2\n";
|
||||||
static const String buildAt = "2022-05-24 13:29:00.556031";
|
static const String buildAt = "2022-05-24 13:44:07.002192";
|
||||||
static const int modifications = 4;
|
static const int modifications = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,6 @@ import 'package:toolbox/data/model/app/update.dart';
|
|||||||
import 'package:toolbox/data/res/url.dart';
|
import 'package:toolbox/data/res/url.dart';
|
||||||
|
|
||||||
class AppService {
|
class AppService {
|
||||||
Future<Map> getNotify() async {
|
|
||||||
final resp = await Dio().get('$baseUrl/notify.json');
|
|
||||||
return resp.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<AppUpdate> getUpdate() async {
|
Future<AppUpdate> getUpdate() async {
|
||||||
final resp = await Dio().get('$baseUrl/update.json');
|
final resp = await Dio().get('$baseUrl/update.json');
|
||||||
return AppUpdate.fromJson(resp.data);
|
return AppUpdate.fromJson(resp.data);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
|
|
||||||
bool usePublicKey = false;
|
bool usePublicKey = false;
|
||||||
|
|
||||||
int _pubKeyIndex = -1;
|
int? _pubKeyIndex;
|
||||||
PrivateKeyInfo? _keyInfo;
|
PrivateKeyInfo? _keyInfo;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -151,7 +151,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
? Consumer<PrivateKeyProvider>(builder: (_, key, __) {
|
? Consumer<PrivateKeyProvider>(builder: (_, key, __) {
|
||||||
for (var item in key.infos) {
|
for (var item in key.infos) {
|
||||||
if (item.id == widget.spi?.pubKeyId) {
|
if (item.id == widget.spi?.pubKeyId) {
|
||||||
_pubKeyIndex = key.infos.indexOf(item);
|
_pubKeyIndex ??= key.infos.indexOf(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final tiles = key.infos
|
final tiles = key.infos
|
||||||
@@ -255,12 +255,9 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
ipController.text = widget.spi?.ip ?? '';
|
ipController.text = widget.spi?.ip ?? '';
|
||||||
portController.text = (widget.spi?.port ?? 22).toString();
|
portController.text = (widget.spi?.port ?? 22).toString();
|
||||||
usernameController.text = widget.spi?.user ?? '';
|
usernameController.text = widget.spi?.user ?? '';
|
||||||
if (widget.spi?.pwd is String) {
|
if (widget.spi?.pubKeyId == null) {
|
||||||
passwordController.text = widget.spi?.pwd ?? '';
|
passwordController.text = widget.spi?.pwd ?? '';
|
||||||
} else {
|
} else {
|
||||||
final auth = widget.spi?.pwd as Map;
|
|
||||||
passwordController.text = auth['passphrase'];
|
|
||||||
keyController.text = auth['privateKey'];
|
|
||||||
usePublicKey = true;
|
usePublicKey = true;
|
||||||
}
|
}
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|||||||
@@ -420,14 +420,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 145;
|
CURRENT_PROJECT_VERSION = 146;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.145;
|
MARKETING_VERSION = 1.0.146;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -550,14 +550,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 145;
|
CURRENT_PROJECT_VERSION = 146;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.145;
|
MARKETING_VERSION = 1.0.146;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
@@ -574,14 +574,14 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 145;
|
CURRENT_PROJECT_VERSION = 146;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.145;
|
MARKETING_VERSION = 1.0.146;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user