fix: stop panel stats from hanging on Clash /traffic WebSocket
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+13
-5
@@ -112,9 +112,19 @@ python3 scripts/render-server.py
|
||||
systemctl restart sing-box jiedian-panel
|
||||
```
|
||||
|
||||
### 面板流量/在线状态显示「不可用」
|
||||
### 面板流量/在线状态显示「不可用」或一直「检测中」后超时
|
||||
|
||||
sing-box Clash API 未就绪,按顺序检查:
|
||||
常见原因是面板请求 sing-box **Clash API 的 `/traffic`**。该接口是 **WebSocket 实时流**,用普通 HTTP GET 会一直占用连接,直到 Nginx 60s 超时返回 **504**,前端 `/api/stats` 失败即显示「不可用」。
|
||||
|
||||
**处理**:更新代码并重启面板(已改为只读 `/connections`,不再阻塞请求):
|
||||
|
||||
```bash
|
||||
cd /opt/jiedian
|
||||
git pull
|
||||
systemctl restart jiedian-panel
|
||||
```
|
||||
|
||||
若仍显示「不可用」,再检查 Clash API 是否启用:
|
||||
|
||||
```bash
|
||||
systemctl is-active sing-box
|
||||
@@ -141,10 +151,8 @@ systemctl restart sing-box jiedian-panel
|
||||
```bash
|
||||
curl -s -H "Authorization: Bearer $(grep ^CLASH_API_SECRET= /opt/jiedian/.env | cut -d= -f2)" \
|
||||
http://127.0.0.1:9090/connections | python3 -m json.tool | head -80
|
||||
curl -s -H "Authorization: Bearer $(grep ^CLASH_API_SECRET= /opt/jiedian/.env | cut -d= -f2)" \
|
||||
http://127.0.0.1:9090/traffic
|
||||
```
|
||||
若 `connections` 为空但 `traffic` 有速率,说明在传流量但连接详情未上报,单节点场景面板会用全局速率推断在线。
|
||||
若 `connections` 为空但客户端确实在传流量,单节点场景面板会用连接汇总速率推断在线。
|
||||
|
||||
### 面板打不开 / 404
|
||||
|
||||
|
||||
Reference in New Issue
Block a user