diff --git a/lib/view/page/ssh/page.dart b/lib/view/page/ssh/page.dart index d3ffa166..7e64bdea 100644 --- a/lib/view/page/ssh/page.dart +++ b/lib/view/page/ssh/page.dart @@ -349,7 +349,7 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { ), ); - _setupDiscontinuityTimer(); + //_setupDiscontinuityTimer(); if (session == null) { _writeLn(_server?.status.err ?? 'Null session'); @@ -390,45 +390,45 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { .listen(_terminal.write); } - void _setupDiscontinuityTimer() { - _discontinuityTimer = Timer.periodic( - const Duration(seconds: 5), - (_) async { - var throwTimeout = true; - Future.delayed(const Duration(seconds: 3), () { - if (throwTimeout) { - _catchTimeout(); - } - }); - await _client?.ping(); - throwTimeout = false; - }, - ); - } + // void _setupDiscontinuityTimer() { + // _discontinuityTimer = Timer.periodic( + // const Duration(seconds: 5), + // (_) async { + // var throwTimeout = true; + // Future.delayed(const Duration(seconds: 3), () { + // if (throwTimeout) { + // _catchTimeout(); + // } + // }); + // await _client?.ping(); + // throwTimeout = false; + // }, + // ); + // } - void _catchTimeout() { - _discontinuityTimer?.cancel(); - if (!mounted) return; - _writeLn('\n\nConnection lost\r\n'); - context.showRoundDialog( - title: Text(l10n.attention), - child: Text('${l10n.disconnected}\n${l10n.goBackQ}'), - barrierDismiss: false, - actions: [ - TextButton( - onPressed: () { - if (mounted) { - context.pop(); - if (widget.pop) { - context.pop(); - } - } - }, - child: Text(l10n.ok), - ), - ], - ); - } + // void _catchTimeout() { + // _discontinuityTimer?.cancel(); + // if (!mounted) return; + // _writeLn('\n\nConnection lost\r\n'); + // context.showRoundDialog( + // title: Text(l10n.attention), + // child: Text('${l10n.disconnected}\n${l10n.goBackQ}'), + // barrierDismiss: false, + // actions: [ + // TextButton( + // onPressed: () { + // if (mounted) { + // context.pop(); + // if (widget.pop) { + // context.pop(); + // } + // } + // }, + // child: Text(l10n.ok), + // ), + // ], + // ); + // } @override bool get wantKeepAlive => true; diff --git a/lib/view/widget/server_func_btns.dart b/lib/view/widget/server_func_btns.dart index 89655c3d..0b8f5c84 100644 --- a/lib/view/widget/server_func_btns.dart +++ b/lib/view/widget/server_func_btns.dart @@ -69,11 +69,18 @@ class ServerFuncBtns extends StatelessWidget { @override Widget build(BuildContext context) { + final btns = () { + try { + return Stores.setting.serverFuncBtns + .fetch() + .map((e) => ServerFuncBtn.values[e]); + } catch (e) { + return ServerFuncBtn.values; + } + }(); return Row( mainAxisAlignment: MainAxisAlignment.spaceAround, - children: Stores.setting.serverFuncBtns - .fetch() - .map((e) => ServerFuncBtn.values[e]) + children: btns .map( (e) => Stores.setting.moveOutServerTabFuncBtns.fetch() ? IconButton(