mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-12 20:26:37 +08:00
76 lines
2.3 KiB
Plaintext
76 lines
2.3 KiB
Plaintext
明白了!更新设计:
|
|
|
|
---
|
|
|
|
## 最终设计方案
|
|
|
|
### 核心需求
|
|
|
|
| 场景 | 配置位置 | 选择内容 |
|
|
|------|----------|----------|
|
|
| 转发 | 转发创建/编辑 | 入口监听IP(从入口节点IP列表选择) |
|
|
| 隧道 | 隧道配置 | 出口节点连接IP(从出口节点IP列表选择) |
|
|
|
|
---
|
|
|
|
### 数据模型变更(3处)
|
|
|
|
```
|
|
Node.ExtraIPs sql.NullString `gorm:"column:extra_ips;type:text"` // 逗号分隔
|
|
ForwardPort.InIP sql.NullString `gorm:"column:in_ip;type:text"` // 指定监听IP
|
|
ChainTunnel.ConnectIP sql.NullString `gorm:"column:connect_ip;type:text"` // 出口连接IP
|
|
```
|
|
|
|
---
|
|
|
|
### 改动清单
|
|
|
|
#### 后端 (约200行)
|
|
|
|
| 文件 | 改动 |
|
|
|------|------|
|
|
| `model/model.go` | Node/ForwardPort/ChainTunnel 增加3个字段 |
|
|
| `repository_mutations.go` | CreateNode/UpdateNode 处理 extraIPs 参数 |
|
|
| `repository_control.go` | GetNodeRecord/ListNodeAllIPs 辅助函数 |
|
|
| `repository.go` | resolveForwardIngress 使用 forward_port.in_ip |
|
|
| `handler/mutations.go` | selectTunnelDialHost 优先使用 connectIP |
|
|
|
|
#### 前端 (约150行)
|
|
|
|
| 页面 | 改动 |
|
|
|------|------|
|
|
| 节点编辑 | 高级配置增加"额外IP" Input(逗号分隔) |
|
|
| 转发编辑 | 入口端口旁增加"监听IP" Select(从入口节点IP选择) |
|
|
| 隧道配置 | 出口节点行增加"连接IP" Select(从出口节点IP选择) |
|
|
|
|
---
|
|
|
|
### UI 示意
|
|
|
|
**节点编辑 - 高级配置**
|
|
```
|
|
额外IP地址
|
|
┌──────────────────────────────────────────┐
|
|
│ 192.168.1.100, 10.0.0.5 │
|
|
└──────────────────────────────────────────┘
|
|
用于多IP服务器,逗号分隔
|
|
```
|
|
|
|
**转发创建**
|
|
```
|
|
入口端口: [ 8080 ] 监听IP: [ 192.168.1.100 ▼ ]
|
|
├─ 203.0.113.10 (默认)
|
|
├─ 192.168.1.100
|
|
└─ 10.0.0.5
|
|
```
|
|
|
|
**隧道配置 - 出口节点**
|
|
```
|
|
出口节点: [ node-1 ▼ ] 端口: [ 8443 ] 连接IP: [ 10.0.0.5 ▼ ]
|
|
├─ 203.0.113.10 (默认)
|
|
└─ 10.0.0.5
|
|
```
|
|
|
|
---
|
|
|
|
这个方案简约清晰,是否可以开始实现? |