fix & opt

- apt/yum if not root, auto try saved pwd
- ServerPrivateInfo.authorization: Object => String pwd
- fix apt parse: caused by irrelevant output
- serverprovider replace _servers[idx] with s
This commit is contained in:
Junyuan Feng
2022-05-24 12:44:12 +08:00
parent f60b09abe4
commit cb5aed8e79
12 changed files with 79 additions and 70 deletions

View File

@@ -17,7 +17,7 @@ class ServerPrivateInfo {
late String ip;
late int port;
late String user;
late Object authorization;
late String pwd;
String? pubKeyId;
ServerPrivateInfo(
@@ -25,14 +25,14 @@ class ServerPrivateInfo {
required this.ip,
required this.port,
required this.user,
required this.authorization,
required this.pwd,
this.pubKeyId});
ServerPrivateInfo.fromJson(Map<String, dynamic> json) {
name = json["name"].toString();
ip = json["ip"].toString();
port = json["port"].toInt();
user = json["user"].toString();
authorization = json["authorization"];
pwd = json["authorization"].toString();
pubKeyId = json["pubKeyId"]?.toString();
}
Map<String, dynamic> toJson() {
@@ -41,7 +41,7 @@ class ServerPrivateInfo {
data["ip"] = ip;
data["port"] = port;
data["user"] = user;
data["authorization"] = authorization;
data["authorization"] = pwd;
data["pubKeyId"] = pubKeyId;
return data;
}