mirror of https://github.com/2dust/v2rayN
Improve and optimize
parent
42c4f9a6c6
commit
1360051f0c
|
@ -528,5 +528,12 @@ public class Global
|
||||||
@""
|
@""
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static readonly List<string> OutboundTags =
|
||||||
|
[
|
||||||
|
ProxyTag,
|
||||||
|
DirectTag,
|
||||||
|
BlockTag
|
||||||
|
];
|
||||||
|
|
||||||
#endregion const
|
#endregion const
|
||||||
}
|
}
|
||||||
|
|
|
@ -1369,7 +1369,7 @@ public class CoreConfigSingboxService
|
||||||
|
|
||||||
private async Task<string?> GenRoutingUserRuleOutbound(string outboundTag, SingboxConfig singboxConfig)
|
private async Task<string?> GenRoutingUserRuleOutbound(string outboundTag, SingboxConfig singboxConfig)
|
||||||
{
|
{
|
||||||
if (outboundTag is Global.ProxyTag or Global.DirectTag or Global.BlockTag)
|
if (Global.OutboundTags.Contains(outboundTag))
|
||||||
{
|
{
|
||||||
return outboundTag;
|
return outboundTag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -631,7 +631,7 @@ public class CoreConfigV2rayService
|
||||||
|
|
||||||
private async Task<string?> GenRoutingUserRuleOutbound(string outboundTag, V2rayConfig v2rayConfig)
|
private async Task<string?> GenRoutingUserRuleOutbound(string outboundTag, V2rayConfig v2rayConfig)
|
||||||
{
|
{
|
||||||
if (outboundTag is Global.ProxyTag or Global.DirectTag or Global.BlockTag)
|
if (Global.OutboundTags.Contains(outboundTag))
|
||||||
{
|
{
|
||||||
return outboundTag;
|
return outboundTag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,8 @@ public partial class RoutingRuleDetailsWindow : WindowBase<RoutingRuleDetailsVie
|
||||||
clbInboundTag.SelectionChanged += ClbInboundTag_SelectionChanged;
|
clbInboundTag.SelectionChanged += ClbInboundTag_SelectionChanged;
|
||||||
|
|
||||||
ViewModel = new RoutingRuleDetailsViewModel(rulesItem, UpdateViewHandler);
|
ViewModel = new RoutingRuleDetailsViewModel(rulesItem, UpdateViewHandler);
|
||||||
cmbOutboundTag.ItemsSource = new List<string> { Global.ProxyTag, Global.DirectTag, Global.BlockTag };
|
|
||||||
|
cmbOutboundTag.ItemsSource = Global.OutboundTags;
|
||||||
Global.RuleProtocols.ForEach(it =>
|
Global.RuleProtocols.ForEach(it =>
|
||||||
{
|
{
|
||||||
clbProtocol.Items.Add(it);
|
clbProtocol.Items.Add(it);
|
||||||
|
|
|
@ -16,9 +16,11 @@ public partial class RoutingRuleDetailsWindow
|
||||||
clbInboundTag.SelectionChanged += ClbInboundTag_SelectionChanged;
|
clbInboundTag.SelectionChanged += ClbInboundTag_SelectionChanged;
|
||||||
|
|
||||||
ViewModel = new RoutingRuleDetailsViewModel(rulesItem, UpdateViewHandler);
|
ViewModel = new RoutingRuleDetailsViewModel(rulesItem, UpdateViewHandler);
|
||||||
cmbOutboundTag.Items.Add(Global.ProxyTag);
|
|
||||||
cmbOutboundTag.Items.Add(Global.DirectTag);
|
Global.OutboundTags.ForEach(it =>
|
||||||
cmbOutboundTag.Items.Add(Global.BlockTag);
|
{
|
||||||
|
cmbOutboundTag.Items.Add(it);
|
||||||
|
});
|
||||||
Global.RuleProtocols.ForEach(it =>
|
Global.RuleProtocols.ForEach(it =>
|
||||||
{
|
{
|
||||||
clbProtocol.Items.Add(it);
|
clbProtocol.Items.Add(it);
|
||||||
|
|
Loading…
Reference in New Issue