Files
dns-server/.trae/documents/plan_20260114_150542.md
2026-01-14 23:08:46 +08:00

46 lines
1.4 KiB
Markdown
Raw 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.
## 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方法如需要
### 配置数据结构
```json
{
"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. 测试验证