Add connection from lan option

This commit is contained in:
problematicconsumer
2024-01-01 19:14:28 +03:30
parent b117ab0372
commit 800efe6b43
10 changed files with 18 additions and 0 deletions

View File

@@ -103,6 +103,7 @@ class ConfigOptionRepositoryImpl
enableTun: persisted.serviceMode == ServiceMode.tun,
setSystemProxy: persisted.serviceMode == ServiceMode.systemProxy,
bypassLan: persisted.bypassLan,
allowConnectionFromLan: persisted.allowConnectionFromLan,
enableFakeDns: persisted.enableFakeDns,
enableDnsRouting: persisted.enableDnsRouting,
independentDnsCache: persisted.independentDnsCache,

View File

@@ -37,6 +37,7 @@ class ConfigOptionEntity with _$ConfigOptionEntity {
@Default(true) bool enableClashApi,
@Default(6756) int clashApiPort,
@Default(false) bool bypassLan,
@Default(false) bool allowConnectionFromLan,
@Default(false) bool enableFakeDns,
@Default(true) bool enableDnsRouting,
@Default(true) bool independentDnsCache,
@@ -96,6 +97,8 @@ class ConfigOptionEntity with _$ConfigOptionEntity {
enableClashApi: patch.enableClashApi ?? enableClashApi,
clashApiPort: patch.clashApiPort ?? clashApiPort,
bypassLan: patch.bypassLan ?? bypassLan,
allowConnectionFromLan:
patch.allowConnectionFromLan ?? allowConnectionFromLan,
enableFakeDns: patch.enableFakeDns ?? enableFakeDns,
enableDnsRouting: patch.enableDnsRouting ?? enableDnsRouting,
independentDnsCache: patch.independentDnsCache ?? independentDnsCache,

View File

@@ -31,6 +31,7 @@ class ConfigOptionPatch with _$ConfigOptionPatch {
bool? enableClashApi,
int? clashApiPort,
bool? bypassLan,
bool? allowConnectionFromLan,
bool? enableFakeDns,
bool? enableDnsRouting,
bool? independentDnsCache,

View File

@@ -257,6 +257,13 @@ class ConfigOptionsPage extends HookConsumerWidget {
);
},
),
SwitchListTile(
title: Text(t.settings.config.allowConnectionFromLan),
value: options.allowConnectionFromLan,
onChanged: (value) => changeOption(
ConfigOptionPatch(allowConnectionFromLan: value),
),
),
const SettingsDivider(),
SettingsSection(t.settings.config.section.tlsTricks),
SwitchListTile(