Add core mode
This commit is contained in:
@@ -4,7 +4,6 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hiddify/core/prefs/prefs.dart';
|
||||
import 'package:hiddify/domain/singbox/box_log.dart';
|
||||
import 'package:hiddify/domain/singbox/rules.dart';
|
||||
import 'package:hiddify/utils/platform_utils.dart';
|
||||
|
||||
part 'config_options.freezed.dart';
|
||||
part 'config_options.g.dart';
|
||||
@@ -34,16 +33,13 @@ class ConfigOptions with _$ConfigOptions {
|
||||
@Default(true) bool enableClashApi,
|
||||
@Default(6756) int clashApiPort,
|
||||
@Default(false) bool enableTun,
|
||||
@Default(true) bool setSystemProxy,
|
||||
@Default(false) bool setSystemProxy,
|
||||
@Default(false) bool bypassLan,
|
||||
@Default(false) bool enableFakeDns,
|
||||
List<Rule>? rules,
|
||||
}) = _ConfigOptions;
|
||||
|
||||
static ConfigOptions initial = ConfigOptions(
|
||||
enableTun: !PlatformUtils.isDesktop,
|
||||
setSystemProxy: PlatformUtils.isDesktop,
|
||||
);
|
||||
static ConfigOptions initial = const ConfigOptions();
|
||||
|
||||
String format() {
|
||||
const encoder = JsonEncoder.withIndent(' ');
|
||||
|
||||
13
lib/domain/singbox/core_mode.dart
Normal file
13
lib/domain/singbox/core_mode.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:hiddify/core/prefs/locale_prefs.dart';
|
||||
|
||||
enum CoreMode {
|
||||
none,
|
||||
proxy,
|
||||
tun;
|
||||
|
||||
String present(TranslationsEn t) => switch (this) {
|
||||
none => t.settings.config.modes.none,
|
||||
proxy => t.settings.config.modes.proxy,
|
||||
tun => t.settings.config.modes.tun,
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export 'box_log.dart';
|
||||
export 'config_options.dart';
|
||||
export 'core_mode.dart';
|
||||
export 'core_status.dart';
|
||||
export 'outbounds.dart';
|
||||
export 'proxy_type.dart';
|
||||
|
||||
Reference in New Issue
Block a user