Refactor config options

This commit is contained in:
problematicconsumer
2024-03-07 20:21:25 +03:30
parent 55afbd55f6
commit fabd559b19
6 changed files with 77 additions and 151 deletions

View File

@@ -101,12 +101,17 @@ enum MuxProtocol {
yamux;
}
@JsonEnum(valueField: 'key')
enum WarpDetourMode {
outbound,
inbound;
proxyOverWarp("proxy_over_warp"),
warpOverProxy("warp_over_proxy");
const WarpDetourMode(this.key);
final String key;
String present(TranslationsEn t) => switch (this) {
outbound => t.settings.config.warpDetourModes.outbound,
inbound => t.settings.config.warpDetourModes.inbound,
proxyOverWarp => t.settings.config.warpDetourModes.proxyOverWarp,
warpOverProxy => t.settings.config.warpDetourModes.warpOverProxy,
};
}