mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
fix: jump server (#190)
This commit is contained in:
@@ -18,8 +18,9 @@ class ServerPrivateInfo {
|
||||
final String user;
|
||||
@HiveField(4)
|
||||
final String? pwd;
|
||||
/// [id] of private key
|
||||
@HiveField(5)
|
||||
final String? pubKeyId;
|
||||
final String? keyId;
|
||||
@HiveField(6)
|
||||
final List<String>? tags;
|
||||
@HiveField(7)
|
||||
@@ -39,7 +40,7 @@ class ServerPrivateInfo {
|
||||
required this.port,
|
||||
required this.user,
|
||||
required this.pwd,
|
||||
this.pubKeyId,
|
||||
this.keyId,
|
||||
this.tags,
|
||||
this.alterUrl,
|
||||
this.autoConnect,
|
||||
@@ -55,7 +56,7 @@ class ServerPrivateInfo {
|
||||
name = json["name"]?.toString() ??
|
||||
'${json["user"]?.toString() ?? 'root'}@${json["ip"].toString()}:${json["port"] ?? 22}',
|
||||
pwd = json["authorization"]?.toString(),
|
||||
pubKeyId = json["pubKeyId"]?.toString(),
|
||||
keyId = json["pubKeyId"]?.toString(),
|
||||
tags = json["tags"]?.cast<String>(),
|
||||
alterUrl = json["alterUrl"]?.toString(),
|
||||
autoConnect = json["autoConnect"],
|
||||
@@ -68,7 +69,7 @@ class ServerPrivateInfo {
|
||||
data["port"] = port;
|
||||
data["user"] = user;
|
||||
data["authorization"] = pwd;
|
||||
data["pubKeyId"] = pubKeyId;
|
||||
data["pubKeyId"] = keyId;
|
||||
data["tags"] = tags;
|
||||
data["alterUrl"] = alterUrl;
|
||||
data["autoConnect"] = autoConnect;
|
||||
@@ -82,7 +83,7 @@ class ServerPrivateInfo {
|
||||
bool shouldReconnect(ServerPrivateInfo old) {
|
||||
return id != old.id ||
|
||||
pwd != old.pwd ||
|
||||
pubKeyId != old.pubKeyId ||
|
||||
keyId != old.keyId ||
|
||||
alterUrl != old.alterUrl ||
|
||||
jumpId != old.jumpId;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class ServerPrivateInfoAdapter extends TypeAdapter<ServerPrivateInfo> {
|
||||
port: fields[2] as int,
|
||||
user: fields[3] as String,
|
||||
pwd: fields[4] as String?,
|
||||
pubKeyId: fields[5] as String?,
|
||||
keyId: fields[5] as String?,
|
||||
tags: (fields[6] as List?)?.cast<String>(),
|
||||
alterUrl: fields[7] as String?,
|
||||
autoConnect: fields[8] as bool?,
|
||||
@@ -45,7 +45,7 @@ class ServerPrivateInfoAdapter extends TypeAdapter<ServerPrivateInfo> {
|
||||
..writeByte(4)
|
||||
..write(obj.pwd)
|
||||
..writeByte(5)
|
||||
..write(obj.pubKeyId)
|
||||
..write(obj.keyId)
|
||||
..writeByte(6)
|
||||
..write(obj.tags)
|
||||
..writeByte(7)
|
||||
|
||||
Reference in New Issue
Block a user