mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
#155 new: option autoConnect
This commit is contained in:
@@ -176,6 +176,12 @@ abstract class S {
|
|||||||
/// **'Auto check update'**
|
/// **'Auto check update'**
|
||||||
String get autoCheckUpdate;
|
String get autoCheckUpdate;
|
||||||
|
|
||||||
|
/// No description provided for @autoConnect.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Auto connect'**
|
||||||
|
String get autoConnect;
|
||||||
|
|
||||||
/// No description provided for @autoUpdateHomeWidget.
|
/// No description provided for @autoUpdateHomeWidget.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ class SDe extends S {
|
|||||||
@override
|
@override
|
||||||
String get autoCheckUpdate => 'Aktualisierung automatisch prüfen';
|
String get autoCheckUpdate => 'Aktualisierung automatisch prüfen';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoConnect => 'Automatisch verbinden';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get autoUpdateHomeWidget => 'Home-Widget automatisch aktualisieren';
|
String get autoUpdateHomeWidget => 'Home-Widget automatisch aktualisieren';
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ class SEn extends S {
|
|||||||
@override
|
@override
|
||||||
String get autoCheckUpdate => 'Auto check update';
|
String get autoCheckUpdate => 'Auto check update';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoConnect => 'Auto connect';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get autoUpdateHomeWidget => 'Auto update home widget';
|
String get autoUpdateHomeWidget => 'Auto update home widget';
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ class SId extends S {
|
|||||||
@override
|
@override
|
||||||
String get autoCheckUpdate => 'Periksa pembaruan otomatis';
|
String get autoCheckUpdate => 'Periksa pembaruan otomatis';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoConnect => 'Hubungkan otomatis';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get autoUpdateHomeWidget => 'Widget Rumah Pembaruan Otomatis';
|
String get autoUpdateHomeWidget => 'Widget Rumah Pembaruan Otomatis';
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ class SZh extends S {
|
|||||||
@override
|
@override
|
||||||
String get autoCheckUpdate => '自动检查更新';
|
String get autoCheckUpdate => '自动检查更新';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoConnect => '自动连接';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get autoUpdateHomeWidget => '自动更新桌面小部件';
|
String get autoUpdateHomeWidget => '自动更新桌面小部件';
|
||||||
|
|
||||||
@@ -766,6 +769,9 @@ class SZhTw extends SZh {
|
|||||||
@override
|
@override
|
||||||
String get autoCheckUpdate => '自動檢查更新';
|
String get autoCheckUpdate => '自動檢查更新';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoConnect => '自動連接';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get autoUpdateHomeWidget => '自動更新桌面小部件';
|
String get autoUpdateHomeWidget => '自動更新桌面小部件';
|
||||||
|
|
||||||
|
|||||||
@@ -470,7 +470,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 = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
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";
|
||||||
@@ -602,7 +602,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 = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -610,7 +610,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
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";
|
||||||
@@ -628,7 +628,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 = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -636,7 +636,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
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";
|
||||||
@@ -657,7 +657,7 @@
|
|||||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -670,7 +670,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@executable_path/../../Frameworks",
|
"@executable_path/../../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||||
@@ -696,7 +696,7 @@
|
|||||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -709,7 +709,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@executable_path/../../Frameworks",
|
"@executable_path/../../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@@ -732,7 +732,7 @@
|
|||||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -745,7 +745,7 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
"@executable_path/../../Frameworks",
|
"@executable_path/../../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
|||||||
@@ -7,23 +7,25 @@ part 'server_private_info.g.dart';
|
|||||||
@HiveType(typeId: 3)
|
@HiveType(typeId: 3)
|
||||||
class ServerPrivateInfo {
|
class ServerPrivateInfo {
|
||||||
@HiveField(0)
|
@HiveField(0)
|
||||||
late String name;
|
final String name;
|
||||||
@HiveField(1)
|
@HiveField(1)
|
||||||
late String ip;
|
final String ip;
|
||||||
@HiveField(2)
|
@HiveField(2)
|
||||||
late int port;
|
final int port;
|
||||||
@HiveField(3)
|
@HiveField(3)
|
||||||
late String user;
|
final String user;
|
||||||
@HiveField(4)
|
@HiveField(4)
|
||||||
late String pwd;
|
final String? pwd;
|
||||||
@HiveField(5)
|
@HiveField(5)
|
||||||
String? pubKeyId;
|
final String? pubKeyId;
|
||||||
@HiveField(6)
|
@HiveField(6)
|
||||||
List<String>? tags;
|
final List<String>? tags;
|
||||||
@HiveField(7)
|
@HiveField(7)
|
||||||
String? alterUrl;
|
final String? alterUrl;
|
||||||
|
@HiveField(8)
|
||||||
|
final bool? autoConnect;
|
||||||
|
|
||||||
late String id;
|
final String id;
|
||||||
|
|
||||||
ServerPrivateInfo({
|
ServerPrivateInfo({
|
||||||
required this.name,
|
required this.name,
|
||||||
@@ -34,19 +36,23 @@ class ServerPrivateInfo {
|
|||||||
this.pubKeyId,
|
this.pubKeyId,
|
||||||
this.tags,
|
this.tags,
|
||||||
this.alterUrl,
|
this.alterUrl,
|
||||||
|
this.autoConnect,
|
||||||
}) : id = '$user@$ip:$port';
|
}) : id = '$user@$ip:$port';
|
||||||
|
|
||||||
ServerPrivateInfo.fromJson(Map<String, dynamic> json) {
|
/// TODO: if any field is changed, remember to update [id] [name]
|
||||||
name = json["name"].toString();
|
ServerPrivateInfo.fromJson(Map<String, dynamic> json)
|
||||||
ip = json["ip"].toString();
|
: ip = json["ip"].toString(),
|
||||||
port = json["port"] ?? 22;
|
port = json["port"] ?? 22,
|
||||||
user = json["user"].toString();
|
user = json["user"]?.toString() ?? 'root',
|
||||||
pwd = json["authorization"].toString();
|
id =
|
||||||
pubKeyId = json["pubKeyId"]?.toString();
|
'${json["user"]?.toString() ?? "root"}@${json["ip"].toString()}:${json["port"] ?? 22}',
|
||||||
id = '$user@$ip:$port';
|
name = json["name"]?.toString() ??
|
||||||
tags = json["tags"]?.cast<String>();
|
'${json["user"]?.toString() ?? 'root'}@${json["ip"].toString()}:${json["port"] ?? 22}',
|
||||||
alterUrl = json["alterUrl"]?.toString();
|
pwd = json["authorization"]?.toString(),
|
||||||
}
|
pubKeyId = json["pubKeyId"]?.toString(),
|
||||||
|
tags = json["tags"]?.cast<String>(),
|
||||||
|
alterUrl = json["alterUrl"]?.toString(),
|
||||||
|
autoConnect = json["autoConnect"];
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
@@ -58,6 +64,7 @@ class ServerPrivateInfo {
|
|||||||
data["pubKeyId"] = pubKeyId;
|
data["pubKeyId"] = pubKeyId;
|
||||||
data["tags"] = tags;
|
data["tags"] = tags;
|
||||||
data["alterUrl"] = alterUrl;
|
data["alterUrl"] = alterUrl;
|
||||||
|
data["autoConnect"] = autoConnect;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,17 +21,18 @@ class ServerPrivateInfoAdapter extends TypeAdapter<ServerPrivateInfo> {
|
|||||||
ip: fields[1] as String,
|
ip: fields[1] as String,
|
||||||
port: fields[2] as int,
|
port: fields[2] as int,
|
||||||
user: fields[3] as String,
|
user: fields[3] as String,
|
||||||
pwd: fields[4] as String,
|
pwd: fields[4] as String?,
|
||||||
pubKeyId: fields[5] as String?,
|
pubKeyId: fields[5] as String?,
|
||||||
tags: (fields[6] as List?)?.cast<String>(),
|
tags: (fields[6] as List?)?.cast<String>(),
|
||||||
alterUrl: fields[7] as String?,
|
alterUrl: fields[7] as String?,
|
||||||
|
autoConnect: fields[8] as bool?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void write(BinaryWriter writer, ServerPrivateInfo obj) {
|
void write(BinaryWriter writer, ServerPrivateInfo obj) {
|
||||||
writer
|
writer
|
||||||
..writeByte(8)
|
..writeByte(9)
|
||||||
..writeByte(0)
|
..writeByte(0)
|
||||||
..write(obj.name)
|
..write(obj.name)
|
||||||
..writeByte(1)
|
..writeByte(1)
|
||||||
@@ -47,7 +48,9 @@ class ServerPrivateInfoAdapter extends TypeAdapter<ServerPrivateInfo> {
|
|||||||
..writeByte(6)
|
..writeByte(6)
|
||||||
..write(obj.tags)
|
..write(obj.tags)
|
||||||
..writeByte(7)
|
..writeByte(7)
|
||||||
..write(obj.alterUrl);
|
..write(obj.alterUrl)
|
||||||
|
..writeByte(8)
|
||||||
|
..write(obj.autoConnect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ class ServerProvider extends ChangeNotifier {
|
|||||||
return Server(spi, initStatus, null, ServerState.disconnected);
|
return Server(spi, initStatus, null, ServerState.disconnected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// if [spi] is specificed then only refresh this server
|
||||||
|
/// [onlyFailed] only refresh failed servers
|
||||||
Future<void> refreshData({
|
Future<void> refreshData({
|
||||||
ServerPrivateInfo? spi,
|
ServerPrivateInfo? spi,
|
||||||
bool onlyFailed = false,
|
bool onlyFailed = false,
|
||||||
@@ -107,6 +109,7 @@ class ServerProvider extends ChangeNotifier {
|
|||||||
if (s.state != ServerState.failed) return;
|
if (s.state != ServerState.failed) return;
|
||||||
_limiter.reset(s.spi.id);
|
_limiter.reset(s.spi.id);
|
||||||
}
|
}
|
||||||
|
if (!(s.spi.autoConnect ?? true)) return;
|
||||||
return await _getData(s.spi);
|
return await _getData(s.spi);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 522;
|
static const int build = 525;
|
||||||
static const String engine = "3.13.1";
|
static const String engine = "3.13.1";
|
||||||
static const String buildAt = "2023-09-01 12:58:00.909396";
|
static const String buildAt = "2023-09-03 17:54:05.367410";
|
||||||
static const int modifications = 2;
|
static const int modifications = 4;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"attention": "Achtung",
|
"attention": "Achtung",
|
||||||
"auto": "System folgen",
|
"auto": "System folgen",
|
||||||
"autoCheckUpdate": "Aktualisierung automatisch prüfen",
|
"autoCheckUpdate": "Aktualisierung automatisch prüfen",
|
||||||
|
"autoConnect": "Automatisch verbinden",
|
||||||
"autoUpdateHomeWidget": "Home-Widget automatisch aktualisieren",
|
"autoUpdateHomeWidget": "Home-Widget automatisch aktualisieren",
|
||||||
"backup": "Backup",
|
"backup": "Backup",
|
||||||
"backupAndRestore": "Backup und Wiederherstellung",
|
"backupAndRestore": "Backup und Wiederherstellung",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"attention": "Attention",
|
"attention": "Attention",
|
||||||
"auto": "Auto",
|
"auto": "Auto",
|
||||||
"autoCheckUpdate": "Auto check update",
|
"autoCheckUpdate": "Auto check update",
|
||||||
|
"autoConnect": "Auto connect",
|
||||||
"autoUpdateHomeWidget": "Auto update home widget",
|
"autoUpdateHomeWidget": "Auto update home widget",
|
||||||
"backup": "Backup",
|
"backup": "Backup",
|
||||||
"backupAndRestore": "Backup and Restore",
|
"backupAndRestore": "Backup and Restore",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"attention": "Perhatian",
|
"attention": "Perhatian",
|
||||||
"auto": "Auto",
|
"auto": "Auto",
|
||||||
"autoCheckUpdate": "Periksa pembaruan otomatis",
|
"autoCheckUpdate": "Periksa pembaruan otomatis",
|
||||||
|
"autoConnect": "Hubungkan otomatis",
|
||||||
"autoUpdateHomeWidget": "Widget Rumah Pembaruan Otomatis",
|
"autoUpdateHomeWidget": "Widget Rumah Pembaruan Otomatis",
|
||||||
"backup": "Cadangan",
|
"backup": "Cadangan",
|
||||||
"backupAndRestore": "Cadangan dan Pulihkan",
|
"backupAndRestore": "Cadangan dan Pulihkan",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"attention": "注意",
|
"attention": "注意",
|
||||||
"auto": "自动",
|
"auto": "自动",
|
||||||
"autoCheckUpdate": "自动检查更新",
|
"autoCheckUpdate": "自动检查更新",
|
||||||
|
"autoConnect": "自动连接",
|
||||||
"autoUpdateHomeWidget": "自动更新桌面小部件",
|
"autoUpdateHomeWidget": "自动更新桌面小部件",
|
||||||
"backup": "备份",
|
"backup": "备份",
|
||||||
"backupAndRestore": "备份和恢复",
|
"backupAndRestore": "备份和恢复",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"attention": "注意",
|
"attention": "注意",
|
||||||
"auto": "自動",
|
"auto": "自動",
|
||||||
"autoCheckUpdate": "自動檢查更新",
|
"autoCheckUpdate": "自動檢查更新",
|
||||||
|
"autoConnect": "自動連接",
|
||||||
"autoUpdateHomeWidget": "自動更新桌面小部件",
|
"autoUpdateHomeWidget": "自動更新桌面小部件",
|
||||||
"backup": "備份",
|
"backup": "備份",
|
||||||
"backupAndRestore": "備份和還原",
|
"backupAndRestore": "備份和還原",
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
late ServerProvider _serverProvider;
|
late ServerProvider _serverProvider;
|
||||||
late S _s;
|
late S _s;
|
||||||
|
|
||||||
bool usePublicKey = false;
|
final usePublicKey = ValueNotifier(false);
|
||||||
|
final autoConnect = ValueNotifier(true);
|
||||||
int? _pubKeyIndex;
|
int? _pubKeyIndex;
|
||||||
PrivateKeyInfo? _keyInfo;
|
PrivateKeyInfo? _keyInfo;
|
||||||
List<String> _tags = [];
|
List<String> _tags = [];
|
||||||
@@ -178,13 +179,24 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
Text(_s.keyAuth),
|
Text(_s.keyAuth),
|
||||||
width13,
|
width13,
|
||||||
Switch(
|
Switch(
|
||||||
value: usePublicKey,
|
value: usePublicKey.value,
|
||||||
onChanged: (val) => setState(() => usePublicKey = val),
|
onChanged: (val) => setState(() => usePublicKey.value = val),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
width13,
|
||||||
|
Text(_s.autoConnect),
|
||||||
|
width13,
|
||||||
|
Switch(
|
||||||
|
value: autoConnect.value,
|
||||||
|
onChanged: (val) => setState(() => autoConnect.value = val),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
];
|
];
|
||||||
if (usePublicKey) {
|
if (usePublicKey.value) {
|
||||||
children.add(_buildKeyAuth());
|
children.add(_buildKeyAuth());
|
||||||
} else {
|
} else {
|
||||||
children.add(Input(
|
children.add(Input(
|
||||||
@@ -254,7 +266,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
showSnackBar(context, Text(_s.plzEnterHost));
|
showSnackBar(context, Text(_s.plzEnterHost));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!usePublicKey && _passwordController.text == '') {
|
if (!usePublicKey.value && _passwordController.text == '') {
|
||||||
final cancel = await showRoundDialog<bool>(
|
final cancel = await showRoundDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
title: Text(_s.attention),
|
title: Text(_s.attention),
|
||||||
@@ -274,7 +286,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (usePublicKey && _pubKeyIndex == -1) {
|
if (usePublicKey.value && _pubKeyIndex == -1) {
|
||||||
showSnackBar(context, Text(_s.plzSelectKey));
|
showSnackBar(context, Text(_s.plzSelectKey));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -296,10 +308,11 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
port: int.parse(_portController.text),
|
port: int.parse(_portController.text),
|
||||||
user: _usernameController.text,
|
user: _usernameController.text,
|
||||||
pwd: authorization,
|
pwd: authorization,
|
||||||
pubKeyId: usePublicKey ? _keyInfo!.id : null,
|
pubKeyId: usePublicKey.value ? _keyInfo!.id : null,
|
||||||
tags: _tags,
|
tags: _tags,
|
||||||
alterUrl:
|
alterUrl:
|
||||||
_alterUrlController.text == '' ? null : _alterUrlController.text,
|
_alterUrlController.text == '' ? null : _alterUrlController.text,
|
||||||
|
autoConnect: autoConnect.value,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (widget.spi == null) {
|
if (widget.spi == null) {
|
||||||
@@ -336,12 +349,13 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
|||||||
if (widget.spi?.pubKeyId == null) {
|
if (widget.spi?.pubKeyId == null) {
|
||||||
_passwordController.text = widget.spi?.pwd ?? '';
|
_passwordController.text = widget.spi?.pwd ?? '';
|
||||||
} else {
|
} else {
|
||||||
usePublicKey = true;
|
usePublicKey.value = true;
|
||||||
}
|
}
|
||||||
if (widget.spi?.tags != null) {
|
if (widget.spi?.tags != null) {
|
||||||
_tags = widget.spi!.tags!;
|
_tags = widget.spi!.tags!;
|
||||||
}
|
}
|
||||||
_alterUrlController.text = widget.spi?.alterUrl ?? '';
|
_alterUrlController.text = widget.spi?.alterUrl ?? '';
|
||||||
|
autoConnect.value = widget.spi?.autoConnect ?? true;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,13 +193,19 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
_showFailReason(si.status);
|
_showFailReason(si.status);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () => setState(() {
|
onLongPress: () {
|
||||||
|
if (si.state == ServerState.finished) {
|
||||||
|
setState(() {
|
||||||
if (_flipedCardIds.contains(si.spi.id)) {
|
if (_flipedCardIds.contains(si.spi.id)) {
|
||||||
_flipedCardIds.remove(si.spi.id);
|
_flipedCardIds.remove(si.spi.id);
|
||||||
} else {
|
} else {
|
||||||
_flipedCardIds.add(si.spi.id);
|
_flipedCardIds.add(si.spi.id);
|
||||||
}
|
}
|
||||||
}),
|
});
|
||||||
|
} else {
|
||||||
|
AppRoute.serverEdit(spi: si.spi).go(context);
|
||||||
|
}
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(13),
|
padding: const EdgeInsets.all(13),
|
||||||
child: _buildRealServerCard(si),
|
child: _buildRealServerCard(si),
|
||||||
@@ -221,11 +227,13 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
final title = _buildServerCardTitle(srv.status, srv.state, srv.spi);
|
final title = _buildServerCardTitle(srv.status, srv.state, srv.spi);
|
||||||
final List<Widget> children = [title];
|
final List<Widget> children = [title];
|
||||||
|
|
||||||
|
if (srv.state == ServerState.finished) {
|
||||||
if (_flipedCardIds.contains(srv.spi.id)) {
|
if (_flipedCardIds.contains(srv.spi.id)) {
|
||||||
children.addAll(_buildFlipedCard(srv));
|
children.addAll(_buildFlipedCard(srv));
|
||||||
} else if (srv.state == ServerState.finished) {
|
} else {
|
||||||
children.addAll(_buildNormalCard(srv.status, srv.spi));
|
children.addAll(_buildNormalCard(srv.status, srv.spi));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return AnimatedContainer(
|
return AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 377),
|
duration: const Duration(milliseconds: 377),
|
||||||
@@ -304,6 +312,22 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
ServerState cs,
|
ServerState cs,
|
||||||
ServerPrivateInfo spi,
|
ServerPrivateInfo spi,
|
||||||
) {
|
) {
|
||||||
|
Widget? rightCorner;
|
||||||
|
if (!(spi.autoConnect ?? true) && cs == ServerState.disconnected) {
|
||||||
|
rightCorner = InkWell(
|
||||||
|
onTap: () => _serverProvider.refreshData(spi: spi),
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 7),
|
||||||
|
child: Icon(
|
||||||
|
Icons.link,
|
||||||
|
size: 21,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else if (_settingStore.serverTabUseOldUI.fetch()) {
|
||||||
|
rightCorner = ServerFuncBtnsTopRight(spi: spi, s: _s);
|
||||||
|
}
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -326,8 +350,7 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
_buildTopRightText(ss, cs),
|
_buildTopRightText(ss, cs),
|
||||||
if (_settingStore.serverTabUseOldUI.fetch())
|
if (rightCorner != null) rightCorner,
|
||||||
ServerFuncBtnsTopRight(spi: spi, s: _s)
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -489,12 +512,12 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
double _calcCardHeight(ServerState cs, String id) {
|
double _calcCardHeight(ServerState cs, String id) {
|
||||||
if (_flipedCardIds.contains(id)) {
|
|
||||||
return 77.0;
|
|
||||||
}
|
|
||||||
if (cs != ServerState.finished) {
|
if (cs != ServerState.finished) {
|
||||||
return 23.0;
|
return 23.0;
|
||||||
}
|
}
|
||||||
|
if (_flipedCardIds.contains(id)) {
|
||||||
|
return 77.0;
|
||||||
|
}
|
||||||
if (_settingStore.moveOutServerTabFuncBtns.fetch() &&
|
if (_settingStore.moveOutServerTabFuncBtns.fetch() &&
|
||||||
// Discussion #146
|
// Discussion #146
|
||||||
!_settingStore.serverTabUseOldUI.fetch()) {
|
!_settingStore.serverTabUseOldUI.fetch()) {
|
||||||
|
|||||||
@@ -474,9 +474,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 = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
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;
|
||||||
@@ -489,9 +489,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 = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
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;
|
||||||
@@ -504,9 +504,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 = 522;
|
CURRENT_PROJECT_VERSION = 525;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.522;
|
MARKETING_VERSION = 1.0.525;
|
||||||
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