Compare commits

..

4 commits

Author SHA1 Message Date
DHR60
990b2b07fa
Merge 69d027840e into b5800f7dfc 2026-02-15 13:50:44 +00:00
DHR60
69d027840e Fix 2026-02-15 21:50:29 +08:00
DHR60
84a1eb8445 Optimize ProfileItem acquisition speed 2026-02-15 16:48:44 +08:00
DHR60
f900ce7f3f Fix 2026-02-15 16:48:44 +08:00
2 changed files with 13 additions and 11 deletions

View file

@ -187,10 +187,10 @@ public static class CoreConfigHandler
var newItems = new List<ProfileItem> { node }; var newItems = new List<ProfileItem> { node };
if (node.ConfigType.IsGroupType()) if (node.ConfigType.IsGroupType())
{ {
var groupChildList = await GroupProfileManager.GetAllChildProfileItems(node); var (groupChildList, _) = await GroupProfileManager.GetChildProfileItems(node);
foreach (var childItem in groupChildList) foreach (var childItem in groupChildList.Where(childItem => !context.AllProxiesMap.ContainsKey(childItem.IndexId)))
{ {
context.AllProxiesMap[childItem.IndexId] = childItem; await FillNodeContext(context, childItem, false);
} }
node.SetProtocolExtra(node.GetProtocolExtra() with node.SetProtocolExtra(node.GetProtocolExtra() with
{ {

View file

@ -433,15 +433,17 @@ public partial class CoreConfigSingboxService
{ {
GenDnsProtectCustom(); GenDnsProtectCustom();
var localDnsServer = _coreConfig.dns?.servers?.FirstOrDefault(s => s.tag == Global.SingboxLocalDNSTag); _coreConfig.dns?.servers?.RemoveAll(s => s.tag == Global.SingboxLocalDNSTag);
if (localDnsServer == null)
{
return;
}
localDnsServer.type = null;
localDnsServer.server = null;
var dnsItem = context.RawDnsItem; var dnsItem = context.RawDnsItem;
localDnsServer.address = string.IsNullOrEmpty(dnsItem?.DomainDNSAddress) ? Global.DomainPureIPDNSAddress.FirstOrDefault() : dnsItem?.DomainDNSAddress; var localDnsServer = new Server4Sbox()
{
address = string.IsNullOrEmpty(dnsItem?.DomainDNSAddress)
? Global.DomainPureIPDNSAddress.FirstOrDefault()
: dnsItem?.DomainDNSAddress,
tag = Global.SingboxLocalDNSTag,
detour = Global.DirectTag,
};
_coreConfig.dns?.servers?.Add(localDnsServer);
} }
private Rule4Sbox BuildProtectDomainRule() private Rule4Sbox BuildProtectDomainRule()