feat: show node connection status and traffic stats in admin panel
Enable sing-box Clash/V2Ray APIs for per-user metrics, persist cumulative traffic in SQLite, and refresh the dashboard every five seconds. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -37,10 +37,31 @@ curl -I "http://66.hyf2.cc/$(grep ^PANEL_PATH= /opt/jiedian/.env | cut -d= -f2)/
|
||||
|
||||
> 443 端口已被 sing-box Reality 占用,面板走 80 端口子路径。请妥善保管 `PANEL_PATH`,相当于隐藏入口。
|
||||
|
||||
面板可查看每个节点的 **在线状态、连接数、实时速率、累计流量**(数据来自 sing-box Clash API + V2Ray 统计,仅监听 127.0.0.1)。
|
||||
|
||||
---
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 面板流量/在线状态显示「不可用」
|
||||
|
||||
sing-box 统计 API 未就绪,按顺序检查:
|
||||
|
||||
```bash
|
||||
systemctl is-active sing-box
|
||||
ss -tlnp | grep -E '9090|9091' # Clash API / V2Ray gRPC
|
||||
grep CLASH_API_SECRET /opt/jiedian/.env
|
||||
python3 /opt/jiedian/scripts/render-server.py
|
||||
systemctl restart sing-box jiedian-panel
|
||||
```
|
||||
|
||||
升级后若未重装,需重新生成 sing-box 配置并重启服务,才会启用 `experimental.clash_api` 与 `v2ray_api`。
|
||||
|
||||
### 在线状态始终离线但客户端能连
|
||||
|
||||
- 有流量时面板会按速率推断在线;若仍显示离线,执行 `curl -s -H "Authorization: Bearer $(grep CLASH_API_SECRET /opt/jiedian/.env | cut -d= -f2)" http://127.0.0.1:9090/connections | head` 查看连接 metadata 是否含 user 字段
|
||||
- 修改节点或升级后需重新渲染配置:`python3 /opt/jiedian/scripts/render-server.py && systemctl restart sing-box`
|
||||
|
||||
### 面板打不开 / 404
|
||||
|
||||
1. **路径不对**:必须用完整路径,末尾带 `/`,例如 `http://域名/jiedian-xxxx/login`
|
||||
|
||||
Reference in New Issue
Block a user