new & opt

new: support set maxRetryCount of server reconnection
opt: server detail UI
opt: server provider
opt: `ssh` page on Android
This commit is contained in:
lollipopkit
2023-02-03 13:12:39 +08:00
parent 7837fa4339
commit 3feef3936c
20 changed files with 245 additions and 123 deletions

View File

@@ -345,7 +345,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
'${ns.speedIn(device: device)} | ${ns.totalIn(device: device)}',
style: textSize11,
textAlign: TextAlign.center,
textScaleFactor: 0.87,
textScaleFactor: 0.9,
),
),
SizedBox(
@@ -354,7 +354,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
'${ns.speedOut(device: device)} | ${ns.totalOut(device: device)}',
style: textSize11,
textAlign: TextAlign.right,
textScaleFactor: 0.87,
textScaleFactor: 0.9,
),
)
],

View File

@@ -73,7 +73,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
[
TextButton(
onPressed: () {
_serverProvider.delServer(widget.spi!);
_serverProvider.delServer(widget.spi!.id);
Navigator.of(context).pop();
Navigator.of(context).pop();
},

View File

@@ -123,13 +123,12 @@ class _ServerPageState extends State<ServerPage>
}
Widget _buildRealServerCard(ServerStatus ss, String serverName,
ServerConnectionState cs, ServerPrivateInfo spi) {
ServerState cs, ServerPrivateInfo spi) {
final rootDisk = ss.disk.firstWhere((element) => element.loc == '/');
final topRightStr =
getTopRightStr(cs, ss.cpu.temp, ss.uptime, ss.failedInfo);
final hasError =
cs == ServerConnectionState.failed && ss.failedInfo != null;
final hasError = cs == ServerState.failed && ss.failedInfo != null;
final style = TextStyle(
color: _theme.textTheme.bodyLarge!.color!.withAlpha(100), fontSize: 11);
@@ -288,12 +287,12 @@ class _ServerPageState extends State<ServerPage>
);
}
String getTopRightStr(ServerConnectionState cs, String temp, String upTime,
String? failedInfo) {
String getTopRightStr(
ServerState cs, String temp, String upTime, String? failedInfo) {
switch (cs) {
case ServerConnectionState.disconnected:
case ServerState.disconnected:
return _s.disconnected;
case ServerConnectionState.connected:
case ServerState.connected:
if (temp == '') {
if (upTime == '') {
return _s.serverTabLoading;
@@ -307,9 +306,9 @@ class _ServerPageState extends State<ServerPage>
return '$temp | $upTime';
}
}
case ServerConnectionState.connecting:
case ServerState.connecting:
return _s.serverTabConnecting;
case ServerConnectionState.failed:
case ServerState.failed:
if (failedInfo == null) {
return _s.serverTabFailed;
}