mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.
- `TerminalColors` - ssh virtual key auto switch
This commit is contained in:
@@ -990,6 +990,12 @@ abstract class S {
|
||||
/// **'This function is now in the experimental stage.\n\nPlease report bugs on {url} or join our development.'**
|
||||
String sshTip(Object url);
|
||||
|
||||
/// No description provided for @sshVirtualKeyAutoOff.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Auto switching of virtual keys'**
|
||||
String get sshVirtualKeyAutoOff;
|
||||
|
||||
/// No description provided for @start.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -481,6 +481,9 @@ class SDe extends S {
|
||||
return 'Diese Funktion befindet sich jetzt in der Experimentierphase.\n\nBitte melde Bugs auf $url oder mach mit bei der Entwicklung.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get sshVirtualKeyAutoOff => 'Automatische Umschaltung der virtuellen Tasten';
|
||||
|
||||
@override
|
||||
String get start => 'Start';
|
||||
|
||||
|
||||
@@ -481,6 +481,9 @@ class SEn extends S {
|
||||
return 'This function is now in the experimental stage.\n\nPlease report bugs on $url or join our development.';
|
||||
}
|
||||
|
||||
@override
|
||||
String get sshVirtualKeyAutoOff => 'Auto switching of virtual keys';
|
||||
|
||||
@override
|
||||
String get start => 'Start';
|
||||
|
||||
|
||||
@@ -481,6 +481,9 @@ class SZh extends S {
|
||||
return '该功能目前处于测试阶段。\n\n请在 $url 反馈问题,或者加入我们开发。';
|
||||
}
|
||||
|
||||
@override
|
||||
String get sshVirtualKeyAutoOff => '虚拟按键自动切换';
|
||||
|
||||
@override
|
||||
String get start => '开始';
|
||||
|
||||
@@ -1067,6 +1070,9 @@ class SZhTw extends SZh {
|
||||
return '該功能目前處於測試階段。\n\n請在 $url 反饋問題,或者加入我們開發。';
|
||||
}
|
||||
|
||||
@override
|
||||
String get sshVirtualKeyAutoOff => '虛擬按鍵自動切換';
|
||||
|
||||
@override
|
||||
String get start => '開始';
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 321;
|
||||
CURRENT_PROJECT_VERSION = 328;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -368,7 +368,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.321;
|
||||
MARKETING_VERSION = 1.0.328;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -491,7 +491,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 321;
|
||||
CURRENT_PROJECT_VERSION = 328;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -499,7 +499,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.321;
|
||||
MARKETING_VERSION = 1.0.328;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -516,7 +516,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 321;
|
||||
CURRENT_PROJECT_VERSION = 328;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -524,7 +524,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.321;
|
||||
MARKETING_VERSION = 1.0.328;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:xterm/ui.dart';
|
||||
import '../../res/terminal.dart';
|
||||
import 'package:xterm/ui.dart' hide TerminalColors;
|
||||
|
||||
class TerminalUITheme {
|
||||
final Color cursor;
|
||||
@@ -50,16 +49,13 @@ class TerminalUITheme {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class TerminalColors {
|
||||
final TerminalColorsPlatform platform;
|
||||
final Color black = Colors.black;
|
||||
class TerminalColors {
|
||||
final Color black;
|
||||
final Color red;
|
||||
final Color green;
|
||||
final Color yellow;
|
||||
final Color blue;
|
||||
// 品红
|
||||
final Color magenta;
|
||||
// 青
|
||||
final Color cyan;
|
||||
final Color white;
|
||||
|
||||
@@ -73,8 +69,7 @@ abstract class TerminalColors {
|
||||
final Color brightCyan;
|
||||
final Color brightWhite;
|
||||
|
||||
TerminalColors(
|
||||
this.platform,
|
||||
const TerminalColors(
|
||||
this.red,
|
||||
this.green,
|
||||
this.yellow,
|
||||
@@ -89,54 +84,7 @@ abstract class TerminalColors {
|
||||
this.brightBlue,
|
||||
this.brightMagenta,
|
||||
this.brightCyan, {
|
||||
this.brightWhite = Colors.white,
|
||||
this.black = const Color(0x00000000),
|
||||
this.brightWhite = const Color(0xFFFFFFFF),
|
||||
});
|
||||
}
|
||||
|
||||
enum TerminalColorsPlatform {
|
||||
macOS,
|
||||
vga,
|
||||
cmd,
|
||||
putty,
|
||||
xterm,
|
||||
ubuntu,
|
||||
;
|
||||
|
||||
String get name {
|
||||
switch (this) {
|
||||
case TerminalColorsPlatform.vga:
|
||||
return 'VGA';
|
||||
case TerminalColorsPlatform.cmd:
|
||||
return 'CMD';
|
||||
case TerminalColorsPlatform.macOS:
|
||||
return 'macOS';
|
||||
case TerminalColorsPlatform.putty:
|
||||
return 'PuTTY';
|
||||
case TerminalColorsPlatform.xterm:
|
||||
return 'XTerm';
|
||||
case TerminalColorsPlatform.ubuntu:
|
||||
return 'Ubuntu';
|
||||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
TerminalColors get colors {
|
||||
switch (this) {
|
||||
case TerminalColorsPlatform.vga:
|
||||
return VGATerminalColor();
|
||||
case TerminalColorsPlatform.cmd:
|
||||
return CMDTerminalColor();
|
||||
case TerminalColorsPlatform.macOS:
|
||||
return MacOSTerminalColor();
|
||||
case TerminalColorsPlatform.putty:
|
||||
return PuttyTerminalColor();
|
||||
case TerminalColorsPlatform.xterm:
|
||||
return XTermTerminalColor();
|
||||
case TerminalColorsPlatform.ubuntu:
|
||||
return UbuntuTerminalColor();
|
||||
default:
|
||||
return MacOSTerminalColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
import 'package:xterm/core.dart';
|
||||
|
||||
class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
||||
@@ -7,6 +9,8 @@ class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
||||
bool ctrl = false;
|
||||
bool alt = false;
|
||||
|
||||
final _setting = locator<SettingStore>();
|
||||
|
||||
void reset(TerminalKeyboardEvent e) {
|
||||
if (e.ctrl) {
|
||||
ctrl = false;
|
||||
@@ -23,7 +27,9 @@ class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
||||
ctrl: event.ctrl || ctrl,
|
||||
alt: event.alt || alt,
|
||||
);
|
||||
reset(e);
|
||||
if (_setting.sshVirtualKeyAutoOff.fetch()!) {
|
||||
reset(e);
|
||||
}
|
||||
return defaultInputHandler.call(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 321;
|
||||
static const String engine = "3.10.2";
|
||||
static const String buildAt = "2023-05-26 20:09:33.821996";
|
||||
static const int modifications = 2;
|
||||
static const int build = 328;
|
||||
static const String engine = "3.10.0";
|
||||
static const String buildAt = "2023-05-27 19:03:35.177457";
|
||||
static const int modifications = 3;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/model/ssh/terminal_color.dart';
|
||||
|
||||
const termDarkTheme = TerminalUITheme(
|
||||
cursor: Color(0XAAAEAFAD),
|
||||
selection: Color(0XAAAEAFAD),
|
||||
cursor: Color.fromARGB(137, 174, 175, 173),
|
||||
selection: Color.fromARGB(147, 174, 175, 173),
|
||||
foreground: Color(0XFFCCCCCC),
|
||||
background: Colors.black,
|
||||
searchHitBackground: Color(0XFFFFFF2B),
|
||||
@@ -12,7 +12,7 @@ const termDarkTheme = TerminalUITheme(
|
||||
);
|
||||
|
||||
const termLightTheme = TerminalUITheme(
|
||||
cursor: Color(0XFFAEAFAD),
|
||||
cursor: Color.fromARGB(153, 174, 175, 173),
|
||||
selection: Color.fromARGB(102, 174, 175, 173),
|
||||
foreground: Color(0XFF000000),
|
||||
background: Color(0XFFFFFFFF),
|
||||
@@ -21,128 +21,23 @@ const termLightTheme = TerminalUITheme(
|
||||
searchHitForeground: Color(0XFF000000),
|
||||
);
|
||||
|
||||
class VGATerminalColor extends TerminalColors {
|
||||
VGATerminalColor()
|
||||
: super(
|
||||
TerminalColorsPlatform.vga,
|
||||
const Color.fromARGB(255, 170, 0, 0),
|
||||
const Color.fromARGB(255, 0, 170, 0),
|
||||
const Color.fromARGB(255, 170, 85, 0),
|
||||
const Color.fromARGB(255, 0, 0, 170),
|
||||
const Color.fromARGB(255, 170, 0, 170),
|
||||
const Color.fromARGB(255, 0, 170, 170),
|
||||
const Color.fromARGB(255, 170, 170, 170),
|
||||
const Color.fromARGB(255, 85, 85, 85),
|
||||
const Color.fromARGB(255, 255, 85, 85),
|
||||
const Color.fromARGB(255, 85, 255, 85),
|
||||
const Color.fromARGB(255, 255, 255, 85),
|
||||
const Color.fromARGB(255, 85, 85, 255),
|
||||
const Color.fromARGB(255, 255, 85, 255),
|
||||
const Color.fromARGB(255, 85, 255, 255),
|
||||
);
|
||||
}
|
||||
|
||||
class CMDTerminalColor extends TerminalColors {
|
||||
CMDTerminalColor()
|
||||
: super(
|
||||
TerminalColorsPlatform.cmd,
|
||||
const Color.fromARGB(255, 128, 0, 0),
|
||||
const Color.fromARGB(255, 0, 128, 0),
|
||||
const Color.fromARGB(255, 128, 128, 0),
|
||||
const Color.fromARGB(255, 0, 0, 128),
|
||||
const Color.fromARGB(255, 128, 0, 128),
|
||||
const Color.fromARGB(255, 0, 128, 128),
|
||||
const Color.fromARGB(255, 192, 192, 192),
|
||||
const Color.fromARGB(255, 128, 128, 128),
|
||||
const Color.fromARGB(255, 255, 0, 0),
|
||||
const Color.fromARGB(255, 0, 255, 0),
|
||||
const Color.fromARGB(255, 255, 255, 0),
|
||||
const Color.fromARGB(255, 0, 0, 255),
|
||||
const Color.fromARGB(255, 255, 0, 255),
|
||||
const Color.fromARGB(255, 0, 255, 255),
|
||||
);
|
||||
}
|
||||
|
||||
class MacOSTerminalColor extends TerminalColors {
|
||||
MacOSTerminalColor()
|
||||
: super(
|
||||
TerminalColorsPlatform.macOS,
|
||||
const Color.fromARGB(255, 194, 54, 33),
|
||||
const Color.fromARGB(255, 37, 188, 36),
|
||||
const Color.fromARGB(255, 173, 173, 39),
|
||||
const Color.fromARGB(255, 73, 46, 225),
|
||||
const Color.fromARGB(255, 211, 56, 211),
|
||||
const Color.fromARGB(255, 51, 187, 200),
|
||||
const Color.fromARGB(255, 203, 204, 205),
|
||||
const Color.fromARGB(255, 129, 131, 131),
|
||||
const Color.fromARGB(255, 252, 57, 31),
|
||||
const Color.fromARGB(255, 49, 231, 34),
|
||||
const Color.fromARGB(255, 234, 236, 35),
|
||||
const Color.fromARGB(255, 88, 51, 255),
|
||||
const Color.fromARGB(255, 249, 53, 248),
|
||||
const Color.fromARGB(255, 20, 240, 240),
|
||||
brightWhite: const Color.fromARGB(255, 233, 235, 235));
|
||||
}
|
||||
|
||||
class PuttyTerminalColor extends TerminalColors {
|
||||
PuttyTerminalColor()
|
||||
: super(
|
||||
TerminalColorsPlatform.putty,
|
||||
const Color.fromARGB(255, 187, 0, 0),
|
||||
const Color.fromARGB(255, 0, 187, 0),
|
||||
const Color.fromARGB(255, 187, 187, 0),
|
||||
const Color.fromARGB(255, 0, 0, 187),
|
||||
const Color.fromARGB(255, 187, 0, 187),
|
||||
const Color.fromARGB(255, 0, 187, 187),
|
||||
const Color.fromARGB(255, 187, 187, 187),
|
||||
const Color.fromARGB(255, 85, 85, 85),
|
||||
const Color.fromARGB(255, 255, 85, 85),
|
||||
const Color.fromARGB(255, 85, 255, 85),
|
||||
const Color.fromARGB(255, 255, 255, 85),
|
||||
const Color.fromARGB(255, 85, 85, 255),
|
||||
const Color.fromARGB(255, 255, 85, 255),
|
||||
const Color.fromARGB(255, 85, 255, 255),
|
||||
);
|
||||
}
|
||||
|
||||
class XTermTerminalColor extends TerminalColors {
|
||||
XTermTerminalColor()
|
||||
: super(
|
||||
TerminalColorsPlatform.xterm,
|
||||
const Color.fromARGB(255, 205, 0, 0),
|
||||
const Color.fromARGB(255, 0, 205, 0),
|
||||
const Color.fromARGB(255, 205, 205, 0),
|
||||
const Color.fromARGB(255, 0, 0, 238),
|
||||
const Color.fromARGB(255, 205, 0, 205),
|
||||
const Color.fromARGB(255, 0, 205, 205),
|
||||
const Color.fromARGB(255, 229, 229, 229),
|
||||
const Color.fromARGB(255, 127, 127, 127),
|
||||
const Color.fromARGB(255, 255, 0, 0),
|
||||
const Color.fromARGB(255, 0, 255, 0),
|
||||
const Color.fromARGB(255, 255, 255, 0),
|
||||
const Color.fromARGB(255, 92, 92, 255),
|
||||
const Color.fromARGB(255, 255, 0, 255),
|
||||
const Color.fromARGB(255, 0, 255, 255),
|
||||
);
|
||||
}
|
||||
|
||||
class UbuntuTerminalColor extends TerminalColors {
|
||||
UbuntuTerminalColor()
|
||||
: super(
|
||||
TerminalColorsPlatform.ubuntu,
|
||||
const Color.fromARGB(255, 222, 56, 43),
|
||||
const Color.fromARGB(255, 57, 181, 74),
|
||||
const Color.fromARGB(255, 255, 199, 6),
|
||||
const Color.fromARGB(255, 0, 111, 184),
|
||||
const Color.fromARGB(255, 118, 38, 113),
|
||||
const Color.fromARGB(255, 44, 181, 233),
|
||||
const Color.fromARGB(255, 204, 204, 204),
|
||||
const Color.fromARGB(255, 128, 128, 128),
|
||||
const Color.fromARGB(255, 255, 0, 0),
|
||||
const Color.fromARGB(255, 0, 255, 0),
|
||||
const Color.fromARGB(255, 255, 255, 0),
|
||||
const Color.fromARGB(255, 0, 0, 255),
|
||||
const Color.fromARGB(255, 255, 0, 255),
|
||||
const Color.fromARGB(255, 0, 255, 255),
|
||||
const Color.fromARGB(255, 194, 54, 33),
|
||||
const Color.fromARGB(255, 37, 188, 36),
|
||||
const Color.fromARGB(255, 173, 173, 39),
|
||||
const Color.fromARGB(255, 73, 46, 225),
|
||||
const Color.fromARGB(255, 211, 56, 211),
|
||||
const Color.fromARGB(255, 51, 187, 200),
|
||||
const Color.fromARGB(255, 203, 204, 205),
|
||||
const Color.fromARGB(255, 129, 131, 131),
|
||||
const Color.fromARGB(255, 252, 57, 31),
|
||||
const Color.fromARGB(255, 49, 231, 34),
|
||||
const Color.fromARGB(255, 234, 236, 35),
|
||||
const Color.fromARGB(255, 88, 51, 255),
|
||||
const Color.fromARGB(255, 249, 53, 248),
|
||||
const Color.fromARGB(255, 20, 240, 240),
|
||||
brightWhite: const Color.fromARGB(255, 233, 235, 235),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,50 +12,50 @@ class SettingStore extends PersistentStore {
|
||||
StoreProperty<int> get serverStatusUpdateInterval =>
|
||||
property('serverStatusUpdateInterval', defaultValue: 3);
|
||||
|
||||
/// Lanch page idx
|
||||
// Lanch page idx
|
||||
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
||||
|
||||
/// Version of store db
|
||||
// Version of store db
|
||||
StoreProperty<int> get storeVersion =>
|
||||
property('storeVersion', defaultValue: 0);
|
||||
|
||||
/// Show logo on server detail page
|
||||
// Show logo on server detail page
|
||||
StoreProperty<bool> get showDistLogo =>
|
||||
property('showDistLogo', defaultValue: true);
|
||||
|
||||
/// First time to use SSH term
|
||||
// First time to use SSH term
|
||||
StoreProperty<bool> get firstTimeUseSshTerm =>
|
||||
property('firstTimeUseSshTerm', defaultValue: true);
|
||||
|
||||
StoreProperty<int> get termColorIdx =>
|
||||
property('termColorIdx', defaultValue: 0);
|
||||
|
||||
/// Max retry count when connect to server
|
||||
// Max retry count when connect to server
|
||||
StoreProperty<int> get maxRetryCount =>
|
||||
property('maxRetryCount', defaultValue: 2);
|
||||
|
||||
/// Night mode: 0 -> auto, 1 -> light, 2 -> dark
|
||||
// Night mode: 0 -> auto, 1 -> light, 2 -> dark
|
||||
StoreProperty<int> get themeMode => property('themeMode', defaultValue: 0);
|
||||
|
||||
/// Font file path
|
||||
// Font file path
|
||||
StoreProperty<String> get fontPath => property('fontPath');
|
||||
|
||||
/// Backgroud running (Android)
|
||||
// Backgroud running (Android)
|
||||
StoreProperty<bool> get bgRun => property('bgRun', defaultValue: isAndroid);
|
||||
|
||||
/// Server order
|
||||
// Server order
|
||||
StoreProperty<List<String>> get serverOrder =>
|
||||
property('serverOrder', defaultValue: null);
|
||||
|
||||
/// Server details page cards order
|
||||
// Server details page cards order
|
||||
StoreProperty<List<String>> get detailCardOrder =>
|
||||
property('detailCardPrder', defaultValue: defaultDetailCardOrder);
|
||||
|
||||
/// SSH term font size
|
||||
// SSH term font size
|
||||
StoreProperty<double> get termFontSize =>
|
||||
property('termFontSize', defaultValue: 13);
|
||||
|
||||
/// Server detail disk ignore path
|
||||
// Server detail disk ignore path
|
||||
StoreProperty<List<String>> get diskIgnorePath =>
|
||||
property('diskIgnorePath', defaultValue: [
|
||||
'udev',
|
||||
@@ -66,6 +66,10 @@ class SettingStore extends PersistentStore {
|
||||
'none',
|
||||
]);
|
||||
|
||||
/// Locale
|
||||
// Locale
|
||||
StoreProperty<String> get locale => property('locale', defaultValue: null);
|
||||
|
||||
// SSH virtual key (ctrl | alt) auto turn off
|
||||
StoreProperty<bool> get sshVirtualKeyAutoOff =>
|
||||
property('sshVirtualKeyAutoOff', defaultValue: true);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"snippet": "Snippet",
|
||||
"spentTime": "Benötigte Zeit: {time}",
|
||||
"sshTip": "Diese Funktion befindet sich jetzt in der Experimentierphase.\n\nBitte melde Bugs auf {url} oder mach mit bei der Entwicklung.",
|
||||
"sshVirtualKeyAutoOff": "Automatische Umschaltung der virtuellen Tasten",
|
||||
"start": "Start",
|
||||
"stop": "Stop",
|
||||
"success": "Erfolgreich",
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"snippet": "Snippet",
|
||||
"spentTime": "Spent time: {time}",
|
||||
"sshTip": "This function is now in the experimental stage.\n\nPlease report bugs on {url} or join our development.",
|
||||
"sshVirtualKeyAutoOff": "Auto switching of virtual keys",
|
||||
"start": "Start",
|
||||
"stop": "Stop",
|
||||
"success": "Success",
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"snippet": "代码片段",
|
||||
"spentTime": "耗时: {time}",
|
||||
"sshTip": "该功能目前处于测试阶段。\n\n请在 {url} 反馈问题,或者加入我们开发。",
|
||||
"sshVirtualKeyAutoOff": "虚拟按键自动切换",
|
||||
"start": "开始",
|
||||
"stop": "停止",
|
||||
"success": "成功",
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
"snippet": "程式片段",
|
||||
"spentTime": "耗時: {time}",
|
||||
"sshTip": "該功能目前處於測試階段。\n\n請在 {url} 反饋問題,或者加入我們開發。",
|
||||
"sshVirtualKeyAutoOff": "虛擬按鍵自動切換",
|
||||
"start": "開始",
|
||||
"stop": "停止",
|
||||
"success": "成功",
|
||||
|
||||
@@ -12,7 +12,6 @@ import 'package:toolbox/view/widget/input_field.dart';
|
||||
|
||||
import '../../core/utils/misc.dart';
|
||||
import '../../core/utils/platform.dart';
|
||||
import '../../data/model/ssh/terminal_color.dart';
|
||||
import '../../core/update.dart';
|
||||
import '../../core/utils/ui.dart';
|
||||
import '../../data/provider/app.dart';
|
||||
@@ -37,7 +36,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
final themeKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||
final startPageKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||
final updateIntervalKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||
final termThemeKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||
final maxRetryKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||
final fontSizeKey = GlobalKey<PopupMenuButtonState<double>>();
|
||||
final localeKey = GlobalKey<PopupMenuButtonState<String>>();
|
||||
@@ -49,7 +47,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
|
||||
late int _selectedColorValue;
|
||||
late int _launchPageIdx;
|
||||
late int _termThemeIdx;
|
||||
late int _nightMode;
|
||||
late int _maxRetryCount;
|
||||
late int _updateInterval;
|
||||
@@ -72,7 +69,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_serverProvider = locator<ServerProvider>();
|
||||
_setting = locator<SettingStore>();
|
||||
_launchPageIdx = _setting.launchPage.fetch()!;
|
||||
_termThemeIdx = _setting.termColorIdx.fetch()!;
|
||||
_nightMode = _setting.themeMode.fetch()!;
|
||||
_updateInterval = _setting.serverStatusUpdateInterval.fetch()!;
|
||||
_maxRetryCount = _setting.maxRetryCount.fetch()!;
|
||||
@@ -149,9 +145,9 @@ class _SettingPageState extends State<SettingPage> {
|
||||
Widget _buildSSH() {
|
||||
return Column(
|
||||
children: [
|
||||
_buildTermTheme(),
|
||||
_buildFont(),
|
||||
_buildTermFontSize(),
|
||||
_buildSSHVirtualKeyAutoOff(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
);
|
||||
}
|
||||
@@ -313,40 +309,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTermTheme() {
|
||||
final items = TerminalColorsPlatform.values
|
||||
.map(
|
||||
(e) => PopupMenuItem<int>(
|
||||
value: e.index,
|
||||
child: Text(e.name),
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
return ListTile(
|
||||
title: Text(
|
||||
_s.theme,
|
||||
),
|
||||
onTap: () {
|
||||
termThemeKey.currentState?.showButtonMenu();
|
||||
},
|
||||
trailing: PopupMenuButton(
|
||||
key: termThemeKey,
|
||||
itemBuilder: (BuildContext context) => items,
|
||||
initialValue: _termThemeIdx,
|
||||
onSelected: (int idx) {
|
||||
setState(() {
|
||||
_termThemeIdx = idx;
|
||||
});
|
||||
_setting.termColorIdx.put(idx);
|
||||
},
|
||||
child: Text(
|
||||
TerminalColorsPlatform.values[_termThemeIdx].name,
|
||||
style: textSize15,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMaxRetry() {
|
||||
final items = List.generate(
|
||||
10,
|
||||
@@ -636,4 +598,12 @@ class _SettingPageState extends State<SettingPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSSHVirtualKeyAutoOff() {
|
||||
return ListTile(
|
||||
title: Text(_s.sshVirtualKeyAutoOff),
|
||||
subtitle: const Text('Ctrl & Alt', style: grey),
|
||||
trailing: buildSwitch(context, _setting.sshVirtualKeyAutoOff),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:toolbox/core/extension/navigator.dart';
|
||||
import 'package:xterm/xterm.dart' hide TerminalColors;
|
||||
import 'package:xterm/xterm.dart';
|
||||
|
||||
import '../../core/utils/platform.dart';
|
||||
import '../../data/model/ssh/terminal_color.dart';
|
||||
@@ -42,7 +42,6 @@ class _SSHPageState extends State<SSHPage> {
|
||||
final TerminalController _terminalController = TerminalController();
|
||||
final ContextMenuController _menuController = ContextMenuController();
|
||||
late TextStyle _menuTextStyle;
|
||||
late TerminalColors _termColors;
|
||||
late S _s;
|
||||
late TerminalStyle _terminalStyle;
|
||||
late TerminalUITheme _termUITheme;
|
||||
@@ -53,8 +52,6 @@ class _SSHPageState extends State<SSHPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
final termColorIdx = _setting.termColorIdx.fetch()!;
|
||||
_termColors = TerminalColorsPlatform.values[termColorIdx].colors;
|
||||
final fontFamilly = getFileName(_setting.fontPath.fetch());
|
||||
final textStyle = TextStyle(
|
||||
fontFamily: fontFamilly,
|
||||
@@ -72,7 +69,7 @@ class _SSHPageState extends State<SSHPage> {
|
||||
_menuTextStyle = TextStyle(color: contentColor.resolve(context));
|
||||
_s = S.of(context)!;
|
||||
_termUITheme = _isDark ? termDarkTheme : termLightTheme;
|
||||
_terminalTheme = _termUITheme.toTerminalTheme(_termColors);
|
||||
_terminalTheme = _termUITheme.toTerminalTheme(MacOSTerminalColor());
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -164,11 +161,7 @@ class _SSHPageState extends State<SSHPage> {
|
||||
}
|
||||
|
||||
final child = item.icon != null
|
||||
? Icon(
|
||||
item.icon,
|
||||
color: _isDark ? Colors.white : Colors.black,
|
||||
size: 17,
|
||||
)
|
||||
? Icon(item.icon, size: 17)
|
||||
: Text(
|
||||
item.text,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -475,9 +475,9 @@
|
||||
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 321;
|
||||
CURRENT_PROJECT_VERSION = 328;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0.321;
|
||||
MARKETING_VERSION = 1.0.328;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -490,9 +490,9 @@
|
||||
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 321;
|
||||
CURRENT_PROJECT_VERSION = 328;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0.321;
|
||||
MARKETING_VERSION = 1.0.328;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -505,9 +505,9 @@
|
||||
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 321;
|
||||
CURRENT_PROJECT_VERSION = 328;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0.321;
|
||||
MARKETING_VERSION = 1.0.328;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
Reference in New Issue
Block a user