diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 6f15be5..3a2aa09 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -120,5 +120,11 @@ "thumbnailMethod0": "ffmpeg binary", "thumbnailMethod1": "ffmpeg API", "thumbnailDir": "The folder used to store thumbnails", - "imgVerifySecret": "The secret of image verify" + "imgVerifySecret": "The secret of image verify", + "flutterFrontend": "The path of flutter frontend", + "fetchTimeout": "Fetch timeout", + "downloadTimeout": "Download timeout", + "downloadTimeoutHelp": "The download will be terminated when nothing is received within the specified time period.", + "millisecond": "millisecond", + "ffprobePath": "The path to the ffprobe binary" } diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 7621701..f09b4fc 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -120,5 +120,11 @@ "thumbnailMethod0": "FFMPEG 二进制", "thumbnailMethod1": "FFMPEG API", "thumbnailDir": "存放缩略图的文件夹", - "imgVerifySecret": "用于验证图片 verify 的密钥" + "imgVerifySecret": "用于验证图片 verify 的密钥", + "flutterFrontend": "flutter 前端路径", + "fetchTimeout": "Fetch 超时时间", + "downloadTimeout": "下载超时时间", + "downloadTimeoutHelp": "当指定时间段内没有任何内容收到时,将会停止下载。", + "millisecond": "毫秒", + "ffprobePath": "FFPROBE 二进制的位置" } diff --git a/lib/server_settings.dart b/lib/server_settings.dart index 9f073ff..be3298a 100644 --- a/lib/server_settings.dart +++ b/lib/server_settings.dart @@ -265,7 +265,10 @@ class _ServerSettingsPage extends State Widget _buildTextBox(BuildContext context) { final i18n = AppLocalizations.of(context)!; if (kIsWeb) { - _uaController.text = _now.ua ?? _config!.ua ?? ""; + final t = _now.ua ?? _config!.ua ?? ""; + if (_uaController.text != t) { + _uaController.text = t; + } } return _buildWithHorizontalPadding( context, @@ -511,6 +514,64 @@ class _ServerSettingsPage extends State }); }, )), + _buildWithVecticalPadding(TextFormField( + initialValue: _now.flutterFrontend ?? _config!.flutterFrontend, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: i18n.flutterFrontend, + ), + onChanged: (s) { + setState(() { + _now.flutterFrontend = s; + _changed = true; + }); + }, + )), + _buildWithVecticalPadding(NumberFormField( + min: 1, + initialValue: _now.fetchTimeout ?? _config!.fetchTimeout, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: i18n.fetchTimeout, + suffixText: i18n.millisecond, + ), + onChanged: (s) { + setState(() { + _now.fetchTimeout = s; + _changed = true; + }); + }, + )), + _buildWithVecticalPadding(NumberFormField( + min: 1, + initialValue: _now.downloadTimeout ?? _config!.downloadTimeout, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: i18n.downloadTimeout, + suffixText: i18n.millisecond, + helperText: i18n.downloadTimeoutHelp, + helperMaxLines: 3, + ), + onChanged: (s) { + setState(() { + _now.downloadTimeout = s; + _changed = true; + }); + }, + )), + _buildWithVecticalPadding(TextFormField( + initialValue: _now.ffprobePath ?? _config!.ffprobePath, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: i18n.ffprobePath, + ), + onChanged: (s) { + setState(() { + _now.ffprobePath = s; + _changed = true; + }); + }, + )), ])); }