mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-10 16:18:27 +03:00
Add rule type selection to routing rules (#8007)
* Add rule type selection to routing rules * Use enum --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,9 @@ public class RoutingRuleDetailsViewModel : MyReactiveObject
|
||||
[Reactive]
|
||||
public string Process { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public string? RuleType { get; set; }
|
||||
|
||||
[Reactive]
|
||||
public bool AutoSort { get; set; }
|
||||
|
||||
@@ -51,6 +54,7 @@ public class RoutingRuleDetailsViewModel : MyReactiveObject
|
||||
Domain = Utils.List2String(SelectedSource.Domain, true);
|
||||
IP = Utils.List2String(SelectedSource.Ip, true);
|
||||
Process = Utils.List2String(SelectedSource.Process, true);
|
||||
RuleType = SelectedSource.RuleType?.ToString();
|
||||
}
|
||||
|
||||
private async Task SaveRulesAsync()
|
||||
@@ -73,6 +77,7 @@ public class RoutingRuleDetailsViewModel : MyReactiveObject
|
||||
}
|
||||
SelectedSource.Protocol = ProtocolItems?.ToList();
|
||||
SelectedSource.InboundTag = InboundTagItems?.ToList();
|
||||
SelectedSource.RuleType = RuleType.IsNullOrEmpty() ? null : (ERuleType)Enum.Parse(typeof(ERuleType), RuleType);
|
||||
|
||||
var hasRule = SelectedSource.Domain?.Count > 0
|
||||
|| SelectedSource.Ip?.Count > 0
|
||||
|
||||
Reference in New Issue
Block a user