diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index 1fff0dbe..d528becc 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -64,7 +64,7 @@ public class SpeedtestService(Config config, Func updateF var lstSelected = new List(); foreach (var it in selecteds) { - if (it.ConfigType == EConfigType.Custom) + if (it.ConfigType is EConfigType.Custom or EConfigType.PolicyGroup or EConfigType.ProxyChain) { continue; } @@ -116,10 +116,6 @@ public class SpeedtestService(Config config, Func updateF List tasks = []; foreach (var it in selecteds) { - if (it.ConfigType == EConfigType.Custom) - { - continue; - } tasks.Add(Task.Run(async () => { try @@ -199,10 +195,6 @@ public class SpeedtestService(Config config, Func updateF { continue; } - if (it.ConfigType == EConfigType.Custom) - { - continue; - } tasks.Add(Task.Run(async () => { await DoRealPing(it); @@ -216,7 +208,10 @@ public class SpeedtestService(Config config, Func updateF } finally { - await processService?.StopAsync(); + if (processService != null) + { + await processService?.StopAsync(); + } } return true; } @@ -233,10 +228,6 @@ public class SpeedtestService(Config config, Func updateF await UpdateFunc(it.IndexId, "", ResUI.SpeedtestingSkip); continue; } - if (it.ConfigType == EConfigType.Custom) - { - continue; - } await concurrencySemaphore.WaitAsync(); tasks.Add(Task.Run(async () => @@ -272,7 +263,10 @@ public class SpeedtestService(Config config, Func updateF } finally { - await processService?.StopAsync(); + if (processService != null) + { + await processService?.StopAsync(); + } concurrencySemaphore.Release(); } })); diff --git a/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs index e9db8a90..eb947b11 100644 --- a/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml.cs @@ -28,7 +28,7 @@ public partial class RoutingRuleDetailsWindow : WindowBase(); + cmbRuleType.ItemsSource = Utils.GetEnumNames().AppendEmpty(); if (!rulesItem.Id.IsNullOrEmpty()) { diff --git a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs index f19a89bf..220f58b2 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs @@ -21,7 +21,7 @@ public partial class RoutingRuleDetailsWindow clbProtocol.ItemsSource = Global.RuleProtocols; clbInboundTag.ItemsSource = Global.InboundTags; cmbNetwork.ItemsSource = Global.RuleNetworks; - cmbRuleType.ItemsSource = Utils.GetEnumNames(); + cmbRuleType.ItemsSource = Utils.GetEnumNames().AppendEmpty(); if (!rulesItem.Id.IsNullOrEmpty()) {