mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
rm: ssh term size
This commit is contained in:
@@ -19,10 +19,6 @@ class SettingStore extends PersistentStore {
|
||||
StoreProperty<bool> get showDistLogo =>
|
||||
property('showDistLogo', defaultValue: true);
|
||||
|
||||
/// SSH term size
|
||||
StoreProperty<String> get sshTermSize =>
|
||||
property('sshTermSize', defaultValue: '80x24');
|
||||
|
||||
/// First time to use SSH term
|
||||
StoreProperty<bool> get firstTimeUseSshTerm =>
|
||||
property('firstTimeUseSshTerm', defaultValue: true);
|
||||
|
||||
@@ -236,9 +236,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"sureNoPwd": MessageLookupByLibrary.simpleMessage(
|
||||
"Are you sure to use no password?"),
|
||||
"sureToDeleteServer": m14,
|
||||
"termSize": MessageLookupByLibrary.simpleMessage("SSH Terminal size"),
|
||||
"termSizeFormatError": MessageLookupByLibrary.simpleMessage(
|
||||
"Illegal format, please enter the format of width*height, such as 80*24"),
|
||||
"ttl": MessageLookupByLibrary.simpleMessage("ttl"),
|
||||
"unknown": MessageLookupByLibrary.simpleMessage("unknown"),
|
||||
"unknownError": MessageLookupByLibrary.simpleMessage("Unknown error"),
|
||||
@@ -258,8 +255,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"versionUpdated": m17,
|
||||
"waitConnection": MessageLookupByLibrary.simpleMessage(
|
||||
"Please wait for the connection to be established."),
|
||||
"willTakEeffectImmediately": MessageLookupByLibrary.simpleMessage(
|
||||
"Will take effect immediately"),
|
||||
"wxh": MessageLookupByLibrary.simpleMessage("Width*Height")
|
||||
"willTakEeffectImmediately":
|
||||
MessageLookupByLibrary.simpleMessage("Will take effect immediately")
|
||||
};
|
||||
}
|
||||
|
||||
@@ -204,9 +204,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"sureDelete": m13,
|
||||
"sureNoPwd": MessageLookupByLibrary.simpleMessage("确认使用无密码?"),
|
||||
"sureToDeleteServer": m14,
|
||||
"termSize": MessageLookupByLibrary.simpleMessage("SSH 终端大小"),
|
||||
"termSizeFormatError":
|
||||
MessageLookupByLibrary.simpleMessage("格式错误,请输入类似 80x24 的格式"),
|
||||
"ttl": MessageLookupByLibrary.simpleMessage("缓存时间"),
|
||||
"unknown": MessageLookupByLibrary.simpleMessage("未知"),
|
||||
"unknownError": MessageLookupByLibrary.simpleMessage("未知错误"),
|
||||
@@ -225,7 +222,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"versionUpdated": m17,
|
||||
"waitConnection": MessageLookupByLibrary.simpleMessage("请等待连接建立"),
|
||||
"willTakEeffectImmediately":
|
||||
MessageLookupByLibrary.simpleMessage("更改将会立即生效"),
|
||||
"wxh": MessageLookupByLibrary.simpleMessage("宽度x高度")
|
||||
MessageLookupByLibrary.simpleMessage("更改将会立即生效")
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1530,36 +1530,6 @@ class S {
|
||||
args: [url],
|
||||
);
|
||||
}
|
||||
|
||||
/// `SSH Terminal size`
|
||||
String get termSize {
|
||||
return Intl.message(
|
||||
'SSH Terminal size',
|
||||
name: 'termSize',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Width*Height`
|
||||
String get wxh {
|
||||
return Intl.message(
|
||||
'Width*Height',
|
||||
name: 'wxh',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Illegal format, please enter the format of width*height, such as 80*24`
|
||||
String get termSizeFormatError {
|
||||
return Intl.message(
|
||||
'Illegal format, please enter the format of width*height, such as 80*24',
|
||||
name: 'termSizeFormatError',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
||||
|
||||
@@ -146,8 +146,5 @@
|
||||
"showDistLogo": "Show distribution logo",
|
||||
"onServerDetailPage": "On server detail page",
|
||||
"addOne": "Add one",
|
||||
"sshTip": "This function is now in the experimental stage. \nPlease report bugs on {url} or join our development.",
|
||||
"termSize": "SSH Terminal size",
|
||||
"wxh": "Width*Height",
|
||||
"termSizeFormatError": "Illegal format, please enter the format of width*height, such as 80*24"
|
||||
"sshTip": "This function is now in the experimental stage. \nPlease report bugs on {url} or join our development."
|
||||
}
|
||||
@@ -146,8 +146,5 @@
|
||||
"showDistLogo": "显示发行版 Logo",
|
||||
"onServerDetailPage": "在服务器详情页",
|
||||
"addOne": "前去新增",
|
||||
"sshTip": "该功能目前处于测试阶段,请在 {url} 反馈问题,或者加入我们开发。",
|
||||
"termSize": "SSH 终端大小",
|
||||
"wxh": "宽度x高度",
|
||||
"termSizeFormatError": "格式错误,请输入类似 80x24 的格式"
|
||||
"sshTip": "该功能目前处于测试阶段,请在 {url} 反馈问题,或者加入我们开发。"
|
||||
}
|
||||
@@ -7,13 +7,11 @@ import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||
import 'package:toolbox/data/provider/pkg.dart';
|
||||
import 'package:toolbox/data/provider/server.dart';
|
||||
import 'package:toolbox/data/res/font_style.dart';
|
||||
import 'package:toolbox/data/res/url.dart';
|
||||
import 'package:toolbox/generated/l10n.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
import 'package:toolbox/view/widget/center_loading.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/two_line_text.dart';
|
||||
import 'package:toolbox/view/widget/url_text.dart';
|
||||
|
||||
class PkgManagePage extends StatefulWidget {
|
||||
const PkgManagePage(this.spi, {Key? key}) : super(key: key);
|
||||
|
||||
@@ -65,7 +65,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildCheckUpdate(),
|
||||
_buildLaunchPage(),
|
||||
_buildDistLogoSwitch(),
|
||||
_buildTermSize(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
),
|
||||
);
|
||||
@@ -241,43 +240,4 @@ class _SettingPageState extends State<SettingPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTermSize() {
|
||||
return const SizedBox();
|
||||
// return ListTile(
|
||||
// title: Text(
|
||||
// _s.termSize,
|
||||
// style: textSize13,
|
||||
// ),
|
||||
// trailing: InkWell(
|
||||
// child: Text(
|
||||
// _setting.sshTermSize.fetch()!,
|
||||
// style: textSize13,
|
||||
// textAlign: TextAlign.right,
|
||||
// ),
|
||||
// onTap: () {
|
||||
// showRoundDialog(
|
||||
// context,
|
||||
// _s.termSize,
|
||||
// TextField(
|
||||
// decoration: InputDecoration(hintText: _s.wxh),
|
||||
// onSubmitted: (value) {
|
||||
// if (wxhReg.hasMatch(value)) {
|
||||
// _setting.sshTermSize.put(value);
|
||||
// Navigator.pop(context);
|
||||
// } else {
|
||||
// showSnackBar(context, Text(_s.termSizeFormatError));
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// [],
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
/// RegExp for 'Width*Height', eg: 80x24
|
||||
/// 'Width' and 'Height' must both greater than 0, lesser than 1000
|
||||
final wxhReg = RegExp(r'^(\d{1,3})x(\d{1,3})$');
|
||||
|
||||
@@ -4,8 +4,6 @@ import 'package:dartssh2/dartssh2.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/view/widget/two_line_text.dart';
|
||||
import 'package:xterm/xterm.dart';
|
||||
|
||||
import '../../core/utils.dart';
|
||||
@@ -56,12 +54,6 @@ class _SSHPageState extends State<SSHPage> {
|
||||
client = await genClient(widget.spi);
|
||||
terminal.write('Connected\r\n');
|
||||
|
||||
final wxh = locator<SettingStore>().sshTermSize.fetch()!;
|
||||
final split = wxh.split('x');
|
||||
final w = int.parse(split.first);
|
||||
final h = int.parse(split.last);
|
||||
terminal.resize(w, h);
|
||||
|
||||
final session = await client.shell(
|
||||
pty: SSHPtyConfig(
|
||||
width: terminal.viewWidth,
|
||||
@@ -96,10 +88,6 @@ class _SSHPageState extends State<SSHPage> {
|
||||
final termTheme = isDark ? termDarkTheme : termLightTheme;
|
||||
return Scaffold(
|
||||
backgroundColor: termTheme.background,
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: TwoLineText(up: 'SSH', down: widget.spi.name),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
|
||||
Reference in New Issue
Block a user