This commit is contained in:
rustdesk 2024-07-06 23:41:53 +08:00
parent 8621b93436
commit 024220e58a
2 changed files with 21 additions and 7 deletions

View File

@ -173,10 +173,15 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
} }
List<Widget> _children() { List<Widget> _children() {
final hideSecurity =
bind.mainGetLocalOption(key: "hide-security-settings") == 'Y';
final hideNetwork =
bind.mainGetLocalOption(key: "hide-network-settings") == 'Y';
final children = [ final children = [
_General(), _General(),
if (!bind.isOutgoingOnly() && !bind.isDisableSettings()) _Safety(), if (!bind.isOutgoingOnly() && !bind.isDisableSettings() && !hideSecurity)
if (!bind.isDisableSettings()) _Network(), _Safety(),
if (!bind.isDisableSettings() && !hideNetwork) _Network(),
if (!bind.isIncomingOnly()) _Display(), if (!bind.isIncomingOnly()) _Display(),
if (!isWeb && !bind.isIncomingOnly() && bind.pluginFeatureIsEnabled()) if (!isWeb && !bind.isIncomingOnly() && bind.pluginFeatureIsEnabled())
_Plugin(), _Plugin(),
@ -1266,6 +1271,10 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
super.build(context); super.build(context);
bool enabled = !locked; bool enabled = !locked;
final scrollController = ScrollController(); final scrollController = ScrollController();
final hideServer =
bind.mainGetLocalOption(key: "hide-server-settings") == 'Y';
final hideProxy =
bind.mainGetLocalOption(key: "hide-proxy-settings") == 'Y';
return DesktopScrollWrapper( return DesktopScrollWrapper(
scrollController: scrollController, scrollController: scrollController,
child: ListView( child: ListView(
@ -1279,11 +1288,12 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
AbsorbPointer( AbsorbPointer(
absorbing: locked, absorbing: locked,
child: Column(children: [ child: Column(children: [
server(enabled), if (!hideServer) server(enabled),
_Card(title: 'Proxy', children: [ if (!hideProxy)
_Button('Socks5/Http(s) Proxy', changeSocks5Proxy, _Card(title: 'Proxy', children: [
enabled: enabled), _Button('Socks5/Http(s) Proxy', changeSocks5Proxy,
]), enabled: enabled),
]),
]), ]),
), ),
]).marginOnly(bottom: _kListViewBottomMargin)); ]).marginOnly(bottom: _kListViewBottomMargin));

View File

@ -2189,6 +2189,10 @@ pub mod keys {
OPTION_PRE_ELEVATE_SERVICE, OPTION_PRE_ELEVATE_SERVICE,
OPTION_DISPLAY_NAME, OPTION_DISPLAY_NAME,
"remove-preset-password-warning", "remove-preset-password-warning",
"hide-security-settings",
"hide-network-settings",
"hide-server-settings",
"hide-proxy-settings",
]; ];
// DEFAULT_SETTINGS, OVERWRITE_SETTINGS // DEFAULT_SETTINGS, OVERWRITE_SETTINGS
pub const KEYS_SETTINGS: &[&str] = &[ pub const KEYS_SETTINGS: &[&str] = &[