[Feature Request] 支持在 daed 及 wing GraphQL API 中为节点配置 add_latency 参数
- Dominant language
- Go
- Stars
- 6.2k
- Forks
- 402
- Avg merge
- 1h 8m
- Merged PRs (30d)
- 1
Description
### Greetings
_No response_
### Feature Request
### 1. 描述你想要的特性
希望能在 `daed` 面板及后端数据服务(即 `dae-wing` 的 GraphQL API 与数据库模型)中,增加对节点 `filter` 附加参数(如 `add_latency`)的解析与存储支持。
目前,原生 [dae](file:///home/louyong/daed/wing/dae-core/example.dae) 核心已完美支持在 [group](file:///home/louyong/daed-ext-panel/src/lib/api.ts#130-138) 的 `filter` 规则尾部添加 `[add_latency: XXXms]` 注解,但这一强大的核心特性由于 `daed` 面板的数据库表结构以及 API 模型的局限性,导致经过面板渲染(如 [mutation_utils.go](file:///home/louyong/daed/wing/graphql/service/node/mutation_utils.go) 内部强行构造空的 `FilterAnnotation`)后,参数被彻底剥离,用户无法通过 Web 面板或其 API 配置并持久化该特性。
### 2. 这个特性的应用场景
在部署 OpenWrt 软路由或管理复杂网络环境时,**主备节点的无缝容灾切换(Failover)** 是高频的硬核刚需。
借助 `add_latency` 注解配合 `min_moving_avg` 策略,用户可以最优雅且精确地实现流量接管:
```dae
group {
my_failover_group {
filter: name(HK_node)
# 为备用节点人为增加 5000ms 的排序延迟
# 只要主节点存活,测速排序永远优先主节点;主节点一旦故障超时,瞬间无缝切换至备用节点
filter: name(US_node) [add_latency: 5000ms]
policy: min_moving_avg
}
}
```
当前,由于 `daed` 尚无法生成上述携带注解的 DSL 规则,过度依赖 Web 面板进行节点编排的用户完全无法应用这套原生系统提供的优秀流量调度机制。
### Use Cases
.
### Potential Benefits
.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the node filter path through daed-ext-panel/src/lib/api.ts, wing/graphql/service/node/mutation_utils.go, the dae-wing GraphQL API, and the database model. Compare the existing dae filter annotation syntax with the model and mutation handling. Done means add_latency annotations can be parsed, stored, and rendered through the panel and API without being stripped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, graphql
- Domain
- backend-api-design, databases, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100