Add chain selection control to group outbounds

This commit is contained in:
DHR60 2025-09-23 10:59:20 +08:00
parent 587686ffce
commit 901f8101f0
2 changed files with 19 additions and 4 deletions

View file

@ -204,7 +204,7 @@ public partial class CoreConfigSingboxService
return await Task.FromResult<BaseServer4Sbox?>(null); return await Task.FromResult<BaseServer4Sbox?>(null);
} }
private async Task<int> GenGroupOutbound(ProfileItem node, SingboxConfig singboxConfig, string baseTagName = Global.ProxyTag) private async Task<int> GenGroupOutbound(ProfileItem node, SingboxConfig singboxConfig, string baseTagName = Global.ProxyTag, bool ignoreOriginChain = false)
{ {
try try
{ {
@ -239,7 +239,15 @@ public partial class CoreConfigSingboxService
switch (node.ConfigType) switch (node.ConfigType)
{ {
case EConfigType.PolicyGroup: case EConfigType.PolicyGroup:
if (ignoreOriginChain)
{
await GenOutboundsList(childProfiles, singboxConfig, profileGroupItem.MultipleLoad, baseTagName);
}
else
{
await GenOutboundsListWithChain(childProfiles, singboxConfig, profileGroupItem.MultipleLoad, baseTagName); await GenOutboundsListWithChain(childProfiles, singboxConfig, profileGroupItem.MultipleLoad, baseTagName);
}
break; break;
case EConfigType.ProxyChain: case EConfigType.ProxyChain:
await GenChainOutboundsList(childProfiles, singboxConfig, baseTagName); await GenChainOutboundsList(childProfiles, singboxConfig, baseTagName);

View file

@ -480,7 +480,7 @@ public partial class CoreConfigV2rayService
return 0; return 0;
} }
private async Task<int> GenGroupOutbound(ProfileItem node, V2rayConfig v2rayConfig, string baseTagName = Global.ProxyTag) private async Task<int> GenGroupOutbound(ProfileItem node, V2rayConfig v2rayConfig, string baseTagName = Global.ProxyTag, bool ignoreOriginChain = false)
{ {
try try
{ {
@ -515,7 +515,14 @@ public partial class CoreConfigV2rayService
switch (node.ConfigType) switch (node.ConfigType)
{ {
case EConfigType.PolicyGroup: case EConfigType.PolicyGroup:
if (ignoreOriginChain)
{
await GenOutboundsList(childProfiles, v2rayConfig, baseTagName);
}
else
{
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);