mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 11:59:13 +00:00
Code clean
This commit is contained in:
parent
929520775d
commit
a559586e71
6 changed files with 14 additions and 5 deletions
|
@ -54,7 +54,7 @@ public class ActionPrecheckManager(Config config)
|
||||||
private async Task<List<string>> ValidateNodeAndCoreSupport(ProfileItem item, ECoreType? coreType = null)
|
private async Task<List<string>> ValidateNodeAndCoreSupport(ProfileItem item, ECoreType? coreType = null)
|
||||||
{
|
{
|
||||||
var errors = new List<string>();
|
var errors = new List<string>();
|
||||||
|
|
||||||
coreType ??= AppManager.Instance.GetCoreType(item, item.ConfigType);
|
coreType ??= AppManager.Instance.GetCoreType(item, item.ConfigType);
|
||||||
|
|
||||||
if (item.ConfigType is EConfigType.Custom)
|
if (item.ConfigType is EConfigType.Custom)
|
||||||
|
@ -77,7 +77,6 @@ public class ActionPrecheckManager(Config config)
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (item.ConfigType)
|
switch (item.ConfigType)
|
||||||
{
|
{
|
||||||
case EConfigType.VMess:
|
case EConfigType.VMess:
|
||||||
|
@ -136,7 +135,7 @@ public class ActionPrecheckManager(Config config)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var childItem = await AppManager.Instance.GetProfileItem(child);
|
var childItem = await AppManager.Instance.GetProfileItem(child);
|
||||||
if (childItem is null)
|
if (childItem is null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,13 +28,14 @@ public partial class CoreConfigSingboxService(Config config)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.Msg = ResUI.InitialConfiguration;
|
ret.Msg = ResUI.InitialConfiguration;
|
||||||
|
|
||||||
if (node?.ConfigType is EConfigType.PolicyGroup or EConfigType.ProxyChain)
|
if (node?.ConfigType is EConfigType.PolicyGroup or EConfigType.ProxyChain)
|
||||||
{
|
{
|
||||||
switch (node.ConfigType)
|
switch (node.ConfigType)
|
||||||
{
|
{
|
||||||
case EConfigType.PolicyGroup:
|
case EConfigType.PolicyGroup:
|
||||||
return await GenerateClientMultipleLoadConfig(node);
|
return await GenerateClientMultipleLoadConfig(node);
|
||||||
|
|
||||||
case EConfigType.ProxyChain:
|
case EConfigType.ProxyChain:
|
||||||
return await GenerateClientChainConfig(node);
|
return await GenerateClientChainConfig(node);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,9 +236,11 @@ public partial class CoreConfigSingboxService
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.ProxyChain:
|
case EConfigType.ProxyChain:
|
||||||
await GenChainOutboundsList(childProfiles, singboxConfig, baseTagName);
|
await GenChainOutboundsList(childProfiles, singboxConfig, baseTagName);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ public partial class CoreConfigV2rayService(Config config)
|
||||||
{
|
{
|
||||||
case EConfigType.PolicyGroup:
|
case EConfigType.PolicyGroup:
|
||||||
return await GenerateClientMultipleLoadConfig(node);
|
return await GenerateClientMultipleLoadConfig(node);
|
||||||
|
|
||||||
case EConfigType.ProxyChain:
|
case EConfigType.ProxyChain:
|
||||||
return await GenerateClientChainConfig(node);
|
return await GenerateClientChainConfig(node);
|
||||||
}
|
}
|
||||||
|
|
|
@ -511,9 +511,11 @@ public partial class CoreConfigV2rayService
|
||||||
await GenOutboundsListWithChain(childProfiles, v2rayConfig, baseTagName);
|
await GenOutboundsListWithChain(childProfiles, v2rayConfig, baseTagName);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.ProxyChain:
|
case EConfigType.ProxyChain:
|
||||||
await GenChainOutboundsList(childProfiles, v2rayConfig, baseTagName);
|
await GenChainOutboundsList(childProfiles, v2rayConfig, baseTagName);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public partial class AddGroupServerWindow : WindowBase<AddGroupServerViewModel>
|
||||||
case EConfigType.PolicyGroup:
|
case EConfigType.PolicyGroup:
|
||||||
this.Title = ResUI.TbConfigTypePolicyGroup;
|
this.Title = ResUI.TbConfigTypePolicyGroup;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.ProxyChain:
|
case EConfigType.ProxyChain:
|
||||||
this.Title = ResUI.TbConfigTypeProxyChain;
|
this.Title = ResUI.TbConfigTypeProxyChain;
|
||||||
gridPolicyGroup.IsVisible = false;
|
gridPolicyGroup.IsVisible = false;
|
||||||
|
@ -115,18 +116,22 @@ public partial class AddGroupServerWindow : WindowBase<AddGroupServerViewModel>
|
||||||
ViewModel?.MoveServer(EMove.Top);
|
ViewModel?.MoveServer(EMove.Top);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.U:
|
case Key.U:
|
||||||
ViewModel?.MoveServer(EMove.Up);
|
ViewModel?.MoveServer(EMove.Up);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.D:
|
case Key.D:
|
||||||
ViewModel?.MoveServer(EMove.Down);
|
ViewModel?.MoveServer(EMove.Down);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.B:
|
case Key.B:
|
||||||
ViewModel?.MoveServer(EMove.Bottom);
|
ViewModel?.MoveServer(EMove.Bottom);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.Delete:
|
case Key.Delete:
|
||||||
ViewModel?.ChildRemoveAsync();
|
ViewModel?.ChildRemoveAsync();
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
@ -162,5 +167,4 @@ public partial class AddGroupServerWindow : WindowBase<AddGroupServerViewModel>
|
||||||
ViewModel.SelectedChildren = lstChild.SelectedItems.Cast<ProfileItem>().ToList();
|
ViewModel.SelectedChildren = lstChild.SelectedItems.Cast<ProfileItem>().ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue