Files
dns-server/dns/.trae/documents/plan_20260114_150542.md
Alex Yang cdac4fcf43 update
2026-01-16 11:09:11 +08:00

1.4 KiB
Raw Blame History

GFWList管理页面实现计划

1. 修改 index.html

  • 在侧边栏菜单(两个位置:桌面端和移动端)添加新的菜单项"GFWList管理"
  • 创建新的页面内容区域 #gfwlist-content
  • 添加配置选项:
    • GFWList总开关checkbox
    • GFWList解析目标IP输入框
    • 通行网站开关组谷歌、YouTube、Facebook、X各checkbox
  • 添加保存和重启服务按钮

2. 修改 main.js

  • 在页面标题映射中添加 'gfwlist': 'GFWList管理'
  • contentSections 数组中添加 gfwlist-content
  • 添加hash为'gfwlist'时的页面初始化逻辑

3. 修改 config.js

  • 添加GFWList页面初始化函数 initGFWListPage()
  • 添加GFWList配置加载函数 loadGFWListConfig()
  • 添加GFWList配置保存函数 saveGFWListConfig()
  • 添加GFWList配置收集函数 collectGFWListFormData()
  • 更新 collectFormData() 以包含新的GFWList配置字段
  • 更新 populateConfigForm() 移除原有的GFWList配置已迁移到独立页面

4. 修改 api.js

  • 添加GFWList专用的API方法如需要

配置数据结构

{
  "gfwlist": {
    "enabled": true,
    "targetIP": "127.0.0.1",
    "allowGoogle": true,
    "allowYouTube": true,
    "allowFacebook": true,
    "allowTwitter": true
  }
}

实现顺序

  1. 先修改HTML添加页面结构和菜单
  2. 修改main.js添加导航支持
  3. 修改config.js添加前端逻辑
  4. 测试验证