Files
dns-server/dns/.trae/documents/修复拦截和放行功能.md
Alex Yang cdac4fcf43 update
2026-01-16 11:09:11 +08:00

45 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
1. **修复规则添加逻辑**
* 修改`blockDomain`函数,使用正确的规则格式(如 `||domain^`
* 修改`unblockDomain`函数,使用正确的放行规则格式(如 `@@||domain^`
* 确保规则经过预处理后再发送到API
2. **更新本地规则列表**
* 添加规则成功后,更新`rules``filteredRules`数组
* 调用`renderRulesList`函数重新渲染规则列表
* 更新规则数量统计
3. **确保规则同步**
* 验证规则是否正确添加到本地规则列表
* 确保日志页面和规则页面的数据一致性
4. **优化用户体验**
* 改进操作反馈,显示更详细的成功/失败信息
* 确保规则添加后立即在日志中反映状态变化
5. **测试功能**
* 测试拦截域名功能
* 测试放行域名功能
* 验证规则是否正确添加到本地规则列表
* 验证日志状态是否正确更新
**修改文件**
* `/root/dns/static/js/logs.js`:修复`blockDomain``unblockDomain`函数
* 确保与`/root/dns/static/js/modules/rules.js`的规则处理逻辑保持一致