mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
feat & fix
- support openwrt - save server info failed if connect error - support ssh 'none' auth
This commit is contained in:
@@ -155,6 +155,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildProgress(double percent) {
|
||||
if (percent > 100) percent = 100;
|
||||
final pColor = primaryColor;
|
||||
final percentWithinOne = percent / 100;
|
||||
return LinearProgressIndicator(
|
||||
@@ -186,7 +187,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
final pColor = primaryColor;
|
||||
final used = ss.memory.used / ss.memory.total;
|
||||
final width = _media.size.width - 17 * 2 - 17 * 2;
|
||||
const mb = 1024 * 1024;
|
||||
const mb = 1024;
|
||||
return RoundRectCard(Padding(
|
||||
padding: roundRectCardPadding,
|
||||
child: SizedBox(
|
||||
@@ -329,8 +330,8 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
Icons.device_hub,
|
||||
size: 17,
|
||||
),
|
||||
Icon(Icons.arrow_downward, size: 17),
|
||||
Icon(Icons.arrow_upward, size: 17),
|
||||
Icon(Icons.arrow_downward, size: 17)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -190,14 +190,28 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.send),
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
if (ipController.text == '') {
|
||||
showSnackBar(context, Text(s.plzEnterHost));
|
||||
return;
|
||||
}
|
||||
if (!usePublicKey && passwordController.text == '') {
|
||||
showSnackBar(context, Text(s.plzEnterPwd));
|
||||
return;
|
||||
final cancel = await showRoundDialog<bool>(
|
||||
context,
|
||||
s.attention,
|
||||
Text(s.sureNoPwd),
|
||||
[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(s.ok)),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(s.cancel))
|
||||
],
|
||||
barrierDismiss: false);
|
||||
if (cancel ?? true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (usePublicKey && _pubKeyIndex == -1) {
|
||||
showSnackBar(context, Text(s.plzSelectKey));
|
||||
|
||||
Reference in New Issue
Block a user