feat(core): 增强IPv6支持和优化功能

- 添加IPv6可用性检查,优化用户界面反馈。
- 实现IPv6检测方法,确保用户在启用IPv6时获得准确提示。
- 更新下载线程设置,修正aria2c参数以提高兼容性。
This commit is contained in:
欧阳淇淇
2025-08-02 16:12:19 +08:00
parent 291c471b9e
commit 1c749079a2
4 changed files with 127 additions and 20 deletions

View File

@@ -333,7 +333,7 @@ class HostsManager:
print(f"清理hosts文件失败: {e}")
return False
def apply_ip(self, hostname, ip_address):
def apply_ip(self, hostname, ip_address, clean=True):
if not self.original_content:
if not self.backup():
return False
@@ -347,8 +347,9 @@ class HostsManager:
return False
try:
# 首先清理已有的同域名记录
self.clean_hostname_entries(hostname)
# 首先清理已有的同域名记录(如果需要)
if clean:
self.clean_hostname_entries(hostname)
# 然后添加新记录
lines = self.original_content.splitlines()