mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +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.'**
|
/// **'This function is now in the experimental stage.\n\nPlease report bugs on {url} or join our development.'**
|
||||||
String sshTip(Object url);
|
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.
|
/// No description provided for @start.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// 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.';
|
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
|
@override
|
||||||
String get start => 'Start';
|
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.';
|
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
|
@override
|
||||||
String get start => 'Start';
|
String get start => 'Start';
|
||||||
|
|
||||||
|
|||||||
@@ -481,6 +481,9 @@ class SZh extends S {
|
|||||||
return '该功能目前处于测试阶段。\n\n请在 $url 反馈问题,或者加入我们开发。';
|
return '该功能目前处于测试阶段。\n\n请在 $url 反馈问题,或者加入我们开发。';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get sshVirtualKeyAutoOff => '虚拟按键自动切换';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get start => '开始';
|
String get start => '开始';
|
||||||
|
|
||||||
@@ -1067,6 +1070,9 @@ class SZhTw extends SZh {
|
|||||||
return '該功能目前處於測試階段。\n\n請在 $url 反饋問題,或者加入我們開發。';
|
return '該功能目前處於測試階段。\n\n請在 $url 反饋問題,或者加入我們開發。';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get sshVirtualKeyAutoOff => '虛擬按鍵自動切換';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get start => '開始';
|
String get start => '開始';
|
||||||
|
|
||||||
|
|||||||
@@ -360,7 +360,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 321;
|
CURRENT_PROJECT_VERSION = 328;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -368,7 +368,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.321;
|
MARKETING_VERSION = 1.0.328;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -491,7 +491,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 321;
|
CURRENT_PROJECT_VERSION = 328;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.321;
|
MARKETING_VERSION = 1.0.328;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 321;
|
CURRENT_PROJECT_VERSION = 328;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -524,7 +524,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.321;
|
MARKETING_VERSION = 1.0.328;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:xterm/ui.dart';
|
import 'package:xterm/ui.dart' hide TerminalColors;
|
||||||
import '../../res/terminal.dart';
|
|
||||||
|
|
||||||
class TerminalUITheme {
|
class TerminalUITheme {
|
||||||
final Color cursor;
|
final Color cursor;
|
||||||
@@ -50,16 +49,13 @@ class TerminalUITheme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class TerminalColors {
|
class TerminalColors {
|
||||||
final TerminalColorsPlatform platform;
|
final Color black;
|
||||||
final Color black = Colors.black;
|
|
||||||
final Color red;
|
final Color red;
|
||||||
final Color green;
|
final Color green;
|
||||||
final Color yellow;
|
final Color yellow;
|
||||||
final Color blue;
|
final Color blue;
|
||||||
// 品红
|
|
||||||
final Color magenta;
|
final Color magenta;
|
||||||
// 青
|
|
||||||
final Color cyan;
|
final Color cyan;
|
||||||
final Color white;
|
final Color white;
|
||||||
|
|
||||||
@@ -73,8 +69,7 @@ abstract class TerminalColors {
|
|||||||
final Color brightCyan;
|
final Color brightCyan;
|
||||||
final Color brightWhite;
|
final Color brightWhite;
|
||||||
|
|
||||||
TerminalColors(
|
const TerminalColors(
|
||||||
this.platform,
|
|
||||||
this.red,
|
this.red,
|
||||||
this.green,
|
this.green,
|
||||||
this.yellow,
|
this.yellow,
|
||||||
@@ -89,54 +84,7 @@ abstract class TerminalColors {
|
|||||||
this.brightBlue,
|
this.brightBlue,
|
||||||
this.brightMagenta,
|
this.brightMagenta,
|
||||||
this.brightCyan, {
|
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:flutter/widgets.dart';
|
||||||
|
import 'package:toolbox/data/store/setting.dart';
|
||||||
|
import 'package:toolbox/locator.dart';
|
||||||
import 'package:xterm/core.dart';
|
import 'package:xterm/core.dart';
|
||||||
|
|
||||||
class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
||||||
@@ -7,6 +9,8 @@ class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
|||||||
bool ctrl = false;
|
bool ctrl = false;
|
||||||
bool alt = false;
|
bool alt = false;
|
||||||
|
|
||||||
|
final _setting = locator<SettingStore>();
|
||||||
|
|
||||||
void reset(TerminalKeyboardEvent e) {
|
void reset(TerminalKeyboardEvent e) {
|
||||||
if (e.ctrl) {
|
if (e.ctrl) {
|
||||||
ctrl = false;
|
ctrl = false;
|
||||||
@@ -23,7 +27,9 @@ class VirtualKeyboard extends TerminalInputHandler with ChangeNotifier {
|
|||||||
ctrl: event.ctrl || ctrl,
|
ctrl: event.ctrl || ctrl,
|
||||||
alt: event.alt || alt,
|
alt: event.alt || alt,
|
||||||
);
|
);
|
||||||
|
if (_setting.sshVirtualKeyAutoOff.fetch()!) {
|
||||||
reset(e);
|
reset(e);
|
||||||
|
}
|
||||||
return defaultInputHandler.call(e);
|
return defaultInputHandler.call(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 321;
|
static const int build = 328;
|
||||||
static const String engine = "3.10.2";
|
static const String engine = "3.10.0";
|
||||||
static const String buildAt = "2023-05-26 20:09:33.821996";
|
static const String buildAt = "2023-05-27 19:03:35.177457";
|
||||||
static const int modifications = 2;
|
static const int modifications = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:toolbox/data/model/ssh/terminal_color.dart';
|
import 'package:toolbox/data/model/ssh/terminal_color.dart';
|
||||||
|
|
||||||
const termDarkTheme = TerminalUITheme(
|
const termDarkTheme = TerminalUITheme(
|
||||||
cursor: Color(0XAAAEAFAD),
|
cursor: Color.fromARGB(137, 174, 175, 173),
|
||||||
selection: Color(0XAAAEAFAD),
|
selection: Color.fromARGB(147, 174, 175, 173),
|
||||||
foreground: Color(0XFFCCCCCC),
|
foreground: Color(0XFFCCCCCC),
|
||||||
background: Colors.black,
|
background: Colors.black,
|
||||||
searchHitBackground: Color(0XFFFFFF2B),
|
searchHitBackground: Color(0XFFFFFF2B),
|
||||||
@@ -12,7 +12,7 @@ const termDarkTheme = TerminalUITheme(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const termLightTheme = TerminalUITheme(
|
const termLightTheme = TerminalUITheme(
|
||||||
cursor: Color(0XFFAEAFAD),
|
cursor: Color.fromARGB(153, 174, 175, 173),
|
||||||
selection: Color.fromARGB(102, 174, 175, 173),
|
selection: Color.fromARGB(102, 174, 175, 173),
|
||||||
foreground: Color(0XFF000000),
|
foreground: Color(0XFF000000),
|
||||||
background: Color(0XFFFFFFFF),
|
background: Color(0XFFFFFFFF),
|
||||||
@@ -21,52 +21,9 @@ const termLightTheme = TerminalUITheme(
|
|||||||
searchHitForeground: Color(0XFF000000),
|
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 {
|
class MacOSTerminalColor extends TerminalColors {
|
||||||
MacOSTerminalColor()
|
MacOSTerminalColor()
|
||||||
: super(
|
: super(
|
||||||
TerminalColorsPlatform.macOS,
|
|
||||||
const Color.fromARGB(255, 194, 54, 33),
|
const Color.fromARGB(255, 194, 54, 33),
|
||||||
const Color.fromARGB(255, 37, 188, 36),
|
const Color.fromARGB(255, 37, 188, 36),
|
||||||
const Color.fromARGB(255, 173, 173, 39),
|
const Color.fromARGB(255, 173, 173, 39),
|
||||||
@@ -81,68 +38,6 @@ class MacOSTerminalColor extends TerminalColors {
|
|||||||
const Color.fromARGB(255, 88, 51, 255),
|
const Color.fromARGB(255, 88, 51, 255),
|
||||||
const Color.fromARGB(255, 249, 53, 248),
|
const Color.fromARGB(255, 249, 53, 248),
|
||||||
const Color.fromARGB(255, 20, 240, 240),
|
const Color.fromARGB(255, 20, 240, 240),
|
||||||
brightWhite: const Color.fromARGB(255, 233, 235, 235));
|
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),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,50 +12,50 @@ class SettingStore extends PersistentStore {
|
|||||||
StoreProperty<int> get serverStatusUpdateInterval =>
|
StoreProperty<int> get serverStatusUpdateInterval =>
|
||||||
property('serverStatusUpdateInterval', defaultValue: 3);
|
property('serverStatusUpdateInterval', defaultValue: 3);
|
||||||
|
|
||||||
/// Lanch page idx
|
// Lanch page idx
|
||||||
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
StoreProperty<int> get launchPage => property('launchPage', defaultValue: 0);
|
||||||
|
|
||||||
/// Version of store db
|
// Version of store db
|
||||||
StoreProperty<int> get storeVersion =>
|
StoreProperty<int> get storeVersion =>
|
||||||
property('storeVersion', defaultValue: 0);
|
property('storeVersion', defaultValue: 0);
|
||||||
|
|
||||||
/// Show logo on server detail page
|
// Show logo on server detail page
|
||||||
StoreProperty<bool> get showDistLogo =>
|
StoreProperty<bool> get showDistLogo =>
|
||||||
property('showDistLogo', defaultValue: true);
|
property('showDistLogo', defaultValue: true);
|
||||||
|
|
||||||
/// First time to use SSH term
|
// First time to use SSH term
|
||||||
StoreProperty<bool> get firstTimeUseSshTerm =>
|
StoreProperty<bool> get firstTimeUseSshTerm =>
|
||||||
property('firstTimeUseSshTerm', defaultValue: true);
|
property('firstTimeUseSshTerm', defaultValue: true);
|
||||||
|
|
||||||
StoreProperty<int> get termColorIdx =>
|
StoreProperty<int> get termColorIdx =>
|
||||||
property('termColorIdx', defaultValue: 0);
|
property('termColorIdx', defaultValue: 0);
|
||||||
|
|
||||||
/// Max retry count when connect to server
|
// Max retry count when connect to server
|
||||||
StoreProperty<int> get maxRetryCount =>
|
StoreProperty<int> get maxRetryCount =>
|
||||||
property('maxRetryCount', defaultValue: 2);
|
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);
|
StoreProperty<int> get themeMode => property('themeMode', defaultValue: 0);
|
||||||
|
|
||||||
/// Font file path
|
// Font file path
|
||||||
StoreProperty<String> get fontPath => property('fontPath');
|
StoreProperty<String> get fontPath => property('fontPath');
|
||||||
|
|
||||||
/// Backgroud running (Android)
|
// Backgroud running (Android)
|
||||||
StoreProperty<bool> get bgRun => property('bgRun', defaultValue: isAndroid);
|
StoreProperty<bool> get bgRun => property('bgRun', defaultValue: isAndroid);
|
||||||
|
|
||||||
/// Server order
|
// Server order
|
||||||
StoreProperty<List<String>> get serverOrder =>
|
StoreProperty<List<String>> get serverOrder =>
|
||||||
property('serverOrder', defaultValue: null);
|
property('serverOrder', defaultValue: null);
|
||||||
|
|
||||||
/// Server details page cards order
|
// Server details page cards order
|
||||||
StoreProperty<List<String>> get detailCardOrder =>
|
StoreProperty<List<String>> get detailCardOrder =>
|
||||||
property('detailCardPrder', defaultValue: defaultDetailCardOrder);
|
property('detailCardPrder', defaultValue: defaultDetailCardOrder);
|
||||||
|
|
||||||
/// SSH term font size
|
// SSH term font size
|
||||||
StoreProperty<double> get termFontSize =>
|
StoreProperty<double> get termFontSize =>
|
||||||
property('termFontSize', defaultValue: 13);
|
property('termFontSize', defaultValue: 13);
|
||||||
|
|
||||||
/// Server detail disk ignore path
|
// Server detail disk ignore path
|
||||||
StoreProperty<List<String>> get diskIgnorePath =>
|
StoreProperty<List<String>> get diskIgnorePath =>
|
||||||
property('diskIgnorePath', defaultValue: [
|
property('diskIgnorePath', defaultValue: [
|
||||||
'udev',
|
'udev',
|
||||||
@@ -66,6 +66,10 @@ class SettingStore extends PersistentStore {
|
|||||||
'none',
|
'none',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/// Locale
|
// Locale
|
||||||
StoreProperty<String> get locale => property('locale', defaultValue: null);
|
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",
|
"snippet": "Snippet",
|
||||||
"spentTime": "Benötigte Zeit: {time}",
|
"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.",
|
"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",
|
"start": "Start",
|
||||||
"stop": "Stop",
|
"stop": "Stop",
|
||||||
"success": "Erfolgreich",
|
"success": "Erfolgreich",
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
"snippet": "Snippet",
|
"snippet": "Snippet",
|
||||||
"spentTime": "Spent time: {time}",
|
"spentTime": "Spent time: {time}",
|
||||||
"sshTip": "This function is now in the experimental stage.\n\nPlease report bugs on {url} or join our development.",
|
"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",
|
"start": "Start",
|
||||||
"stop": "Stop",
|
"stop": "Stop",
|
||||||
"success": "Success",
|
"success": "Success",
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
"snippet": "代码片段",
|
"snippet": "代码片段",
|
||||||
"spentTime": "耗时: {time}",
|
"spentTime": "耗时: {time}",
|
||||||
"sshTip": "该功能目前处于测试阶段。\n\n请在 {url} 反馈问题,或者加入我们开发。",
|
"sshTip": "该功能目前处于测试阶段。\n\n请在 {url} 反馈问题,或者加入我们开发。",
|
||||||
|
"sshVirtualKeyAutoOff": "虚拟按键自动切换",
|
||||||
"start": "开始",
|
"start": "开始",
|
||||||
"stop": "停止",
|
"stop": "停止",
|
||||||
"success": "成功",
|
"success": "成功",
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
"snippet": "程式片段",
|
"snippet": "程式片段",
|
||||||
"spentTime": "耗時: {time}",
|
"spentTime": "耗時: {time}",
|
||||||
"sshTip": "該功能目前處於測試階段。\n\n請在 {url} 反饋問題,或者加入我們開發。",
|
"sshTip": "該功能目前處於測試階段。\n\n請在 {url} 反饋問題,或者加入我們開發。",
|
||||||
|
"sshVirtualKeyAutoOff": "虛擬按鍵自動切換",
|
||||||
"start": "開始",
|
"start": "開始",
|
||||||
"stop": "停止",
|
"stop": "停止",
|
||||||
"success": "成功",
|
"success": "成功",
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import 'package:toolbox/view/widget/input_field.dart';
|
|||||||
|
|
||||||
import '../../core/utils/misc.dart';
|
import '../../core/utils/misc.dart';
|
||||||
import '../../core/utils/platform.dart';
|
import '../../core/utils/platform.dart';
|
||||||
import '../../data/model/ssh/terminal_color.dart';
|
|
||||||
import '../../core/update.dart';
|
import '../../core/update.dart';
|
||||||
import '../../core/utils/ui.dart';
|
import '../../core/utils/ui.dart';
|
||||||
import '../../data/provider/app.dart';
|
import '../../data/provider/app.dart';
|
||||||
@@ -37,7 +36,6 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
final themeKey = GlobalKey<PopupMenuButtonState<int>>();
|
final themeKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||||
final startPageKey = GlobalKey<PopupMenuButtonState<int>>();
|
final startPageKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||||
final updateIntervalKey = GlobalKey<PopupMenuButtonState<int>>();
|
final updateIntervalKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||||
final termThemeKey = GlobalKey<PopupMenuButtonState<int>>();
|
|
||||||
final maxRetryKey = GlobalKey<PopupMenuButtonState<int>>();
|
final maxRetryKey = GlobalKey<PopupMenuButtonState<int>>();
|
||||||
final fontSizeKey = GlobalKey<PopupMenuButtonState<double>>();
|
final fontSizeKey = GlobalKey<PopupMenuButtonState<double>>();
|
||||||
final localeKey = GlobalKey<PopupMenuButtonState<String>>();
|
final localeKey = GlobalKey<PopupMenuButtonState<String>>();
|
||||||
@@ -49,7 +47,6 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
|
|
||||||
late int _selectedColorValue;
|
late int _selectedColorValue;
|
||||||
late int _launchPageIdx;
|
late int _launchPageIdx;
|
||||||
late int _termThemeIdx;
|
|
||||||
late int _nightMode;
|
late int _nightMode;
|
||||||
late int _maxRetryCount;
|
late int _maxRetryCount;
|
||||||
late int _updateInterval;
|
late int _updateInterval;
|
||||||
@@ -72,7 +69,6 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
_serverProvider = locator<ServerProvider>();
|
_serverProvider = locator<ServerProvider>();
|
||||||
_setting = locator<SettingStore>();
|
_setting = locator<SettingStore>();
|
||||||
_launchPageIdx = _setting.launchPage.fetch()!;
|
_launchPageIdx = _setting.launchPage.fetch()!;
|
||||||
_termThemeIdx = _setting.termColorIdx.fetch()!;
|
|
||||||
_nightMode = _setting.themeMode.fetch()!;
|
_nightMode = _setting.themeMode.fetch()!;
|
||||||
_updateInterval = _setting.serverStatusUpdateInterval.fetch()!;
|
_updateInterval = _setting.serverStatusUpdateInterval.fetch()!;
|
||||||
_maxRetryCount = _setting.maxRetryCount.fetch()!;
|
_maxRetryCount = _setting.maxRetryCount.fetch()!;
|
||||||
@@ -149,9 +145,9 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
Widget _buildSSH() {
|
Widget _buildSSH() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
_buildTermTheme(),
|
|
||||||
_buildFont(),
|
_buildFont(),
|
||||||
_buildTermFontSize(),
|
_buildTermFontSize(),
|
||||||
|
_buildSSHVirtualKeyAutoOff(),
|
||||||
].map((e) => RoundRectCard(e)).toList(),
|
].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() {
|
Widget _buildMaxRetry() {
|
||||||
final items = List.generate(
|
final items = List.generate(
|
||||||
10,
|
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:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:toolbox/core/extension/navigator.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 '../../core/utils/platform.dart';
|
||||||
import '../../data/model/ssh/terminal_color.dart';
|
import '../../data/model/ssh/terminal_color.dart';
|
||||||
@@ -42,7 +42,6 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
final TerminalController _terminalController = TerminalController();
|
final TerminalController _terminalController = TerminalController();
|
||||||
final ContextMenuController _menuController = ContextMenuController();
|
final ContextMenuController _menuController = ContextMenuController();
|
||||||
late TextStyle _menuTextStyle;
|
late TextStyle _menuTextStyle;
|
||||||
late TerminalColors _termColors;
|
|
||||||
late S _s;
|
late S _s;
|
||||||
late TerminalStyle _terminalStyle;
|
late TerminalStyle _terminalStyle;
|
||||||
late TerminalUITheme _termUITheme;
|
late TerminalUITheme _termUITheme;
|
||||||
@@ -53,8 +52,6 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
final termColorIdx = _setting.termColorIdx.fetch()!;
|
|
||||||
_termColors = TerminalColorsPlatform.values[termColorIdx].colors;
|
|
||||||
final fontFamilly = getFileName(_setting.fontPath.fetch());
|
final fontFamilly = getFileName(_setting.fontPath.fetch());
|
||||||
final textStyle = TextStyle(
|
final textStyle = TextStyle(
|
||||||
fontFamily: fontFamilly,
|
fontFamily: fontFamilly,
|
||||||
@@ -72,7 +69,7 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
_menuTextStyle = TextStyle(color: contentColor.resolve(context));
|
_menuTextStyle = TextStyle(color: contentColor.resolve(context));
|
||||||
_s = S.of(context)!;
|
_s = S.of(context)!;
|
||||||
_termUITheme = _isDark ? termDarkTheme : termLightTheme;
|
_termUITheme = _isDark ? termDarkTheme : termLightTheme;
|
||||||
_terminalTheme = _termUITheme.toTerminalTheme(_termColors);
|
_terminalTheme = _termUITheme.toTerminalTheme(MacOSTerminalColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -164,11 +161,7 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final child = item.icon != null
|
final child = item.icon != null
|
||||||
? Icon(
|
? Icon(item.icon, size: 17)
|
||||||
item.icon,
|
|
||||||
color: _isDark ? Colors.white : Colors.black,
|
|
||||||
size: 17,
|
|
||||||
)
|
|
||||||
: Text(
|
: Text(
|
||||||
item.text,
|
item.text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -475,9 +475,9 @@
|
|||||||
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 321;
|
CURRENT_PROJECT_VERSION = 328;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.321;
|
MARKETING_VERSION = 1.0.328;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -490,9 +490,9 @@
|
|||||||
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 321;
|
CURRENT_PROJECT_VERSION = 328;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.321;
|
MARKETING_VERSION = 1.0.328;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -505,9 +505,9 @@
|
|||||||
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 321;
|
CURRENT_PROJECT_VERSION = 328;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.321;
|
MARKETING_VERSION = 1.0.328;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user