[PR #5687] [MERGED] feat(ui): client-realtime-speed #5961

Closed
opened 2026-11-02 04:05:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5687
Author: @NikanZeyaei
Created: 6/30/2026
Status: ✅ Merged
Merged: 7/4/2026
Merged by: @Mahyardana

Base: main ← Head: feature/client-realtime-speed


📝 Commits (4)

  • d2ca2b6 refactor(inbounds): extract TRAFFIC_POLL_INTERVAL_S to shared util
  • f57bf65 feat(clients): derive per-client live speed from traffic WebSocket deltas
  • 971dbf8 feat(clients): render speed column and mobile card line
  • fae99bf i18n(clients): add pages.clients.speed key to all 13 locales

📊 Changes

19 files changed (+93 additions, -6 deletions)

View changed files

➕ frontend/src/components/clients/ClientSpeedTag.tsx (+26 -0)
📝 frontend/src/hooks/useClients.ts (+23 -1)
➕ frontend/src/lib/traffic/poll-interval.ts (+1 -0)
📝 frontend/src/pages/clients/ClientsPage.css (+6 -0)
📝 frontend/src/pages/clients/ClientsPage.tsx (+23 -1)
📝 frontend/src/pages/inbounds/useInbounds.ts (+1 -4)
📝 internal/web/translation/ar-EG.json (+1 -0)
📝 internal/web/translation/en-US.json (+1 -0)
📝 internal/web/translation/es-ES.json (+1 -0)
📝 internal/web/translation/fa-IR.json (+1 -0)
📝 internal/web/translation/id-ID.json (+1 -0)
📝 internal/web/translation/ja-JP.json (+1 -0)
📝 internal/web/translation/pt-BR.json (+1 -0)
📝 internal/web/translation/ru-RU.json (+1 -0)
📝 internal/web/translation/tr-TR.json (+1 -0)
📝 internal/web/translation/uk-UA.json (+1 -0)
📝 internal/web/translation/vi-VN.json (+1 -0)
📝 internal/web/translation/zh-CN.json (+1 -0)
📝 internal/web/translation/zh-TW.json (+1 -0)

📄 Description

Summary

Closes https://github.com/MHSanaei/3x-ui/issues/5653
Adds a real-time upload/download speed column to the Clients page (and a speed line on the mobile card) derived from the existing per-email 5 s deltas in the traffic WebSocket event. Backend, DB, and OpenAPI are untouched.

Why

The Clients page only showed cumulative up/down totals, so an admin watching a spike on the dashboard's "overall speed" could not tell which client was driving it. The data was already on the wire (xray-core emits per-email deltas, the Go job broadcasts them as traffic.clientTraffics[], the Inbounds page already consumes the sibling traffics[] array) — only the client-side render was missing.

Closes the per-client real-time speed feature request.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Open the panel → Clients tab → confirm a ↑ x/s / ↓ y/s tag appears in the new Speed column for active clients, updates every 5 s, and falls to — within one poll after a client goes idle. Resize to mobile width to confirm the same line shows under the cumulative traffic bar on each card. Switch between en, zh, ru, fa, ar to confirm the header translates and RTL renders cleanly.

Screenshots / recordings

2026-06-30 15 53 14

Breaking changes

None.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5687 **Author:** [@NikanZeyaei](https://github.com/NikanZeyaei) **Created:** 6/30/2026 **Status:** ✅ Merged **Merged:** 7/4/2026 **Merged by:** [@Mahyardana](https://github.com/Mahyardana) **Base:** `main` ← **Head:** `feature/client-realtime-speed` --- ### 📝 Commits (4) - [`d2ca2b6`](https://github.com/MHSanaei/3x-ui/commit/d2ca2b6f1dc7dbc961789a2f921285f2f9d08a4a) refactor(inbounds): extract TRAFFIC_POLL_INTERVAL_S to shared util - [`f57bf65`](https://github.com/MHSanaei/3x-ui/commit/f57bf6512b07ecb6f8b799f309ea991341930198) feat(clients): derive per-client live speed from traffic WebSocket deltas - [`971dbf8`](https://github.com/MHSanaei/3x-ui/commit/971dbf86eab123e7f76b0c5a2a60ede8fe2f5731) feat(clients): render speed column and mobile card line - [`fae99bf`](https://github.com/MHSanaei/3x-ui/commit/fae99bf0151afe2f66872b15a6e39f67f5603cb8) i18n(clients): add pages.clients.speed key to all 13 locales ### 📊 Changes **19 files changed** (+93 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/components/clients/ClientSpeedTag.tsx` (+26 -0) 📝 `frontend/src/hooks/useClients.ts` (+23 -1) ➕ `frontend/src/lib/traffic/poll-interval.ts` (+1 -0) 📝 `frontend/src/pages/clients/ClientsPage.css` (+6 -0) 📝 `frontend/src/pages/clients/ClientsPage.tsx` (+23 -1) 📝 `frontend/src/pages/inbounds/useInbounds.ts` (+1 -4) 📝 `internal/web/translation/ar-EG.json` (+1 -0) 📝 `internal/web/translation/en-US.json` (+1 -0) 📝 `internal/web/translation/es-ES.json` (+1 -0) 📝 `internal/web/translation/fa-IR.json` (+1 -0) 📝 `internal/web/translation/id-ID.json` (+1 -0) 📝 `internal/web/translation/ja-JP.json` (+1 -0) 📝 `internal/web/translation/pt-BR.json` (+1 -0) 📝 `internal/web/translation/ru-RU.json` (+1 -0) 📝 `internal/web/translation/tr-TR.json` (+1 -0) 📝 `internal/web/translation/uk-UA.json` (+1 -0) 📝 `internal/web/translation/vi-VN.json` (+1 -0) 📝 `internal/web/translation/zh-CN.json` (+1 -0) 📝 `internal/web/translation/zh-TW.json` (+1 -0) </details> ### 📄 Description ## Summary Closes https://github.com/MHSanaei/3x-ui/issues/5653 Adds a real-time upload/download speed column to the Clients page (and a speed line on the mobile card) derived from the existing per-email 5 s deltas in the `traffic` WebSocket event. Backend, DB, and OpenAPI are untouched. ## Why The Clients page only showed cumulative up/down totals, so an admin watching a spike on the dashboard's "overall speed" could not tell which client was driving it. The data was already on the wire (xray-core emits per-email deltas, the Go job broadcasts them as `traffic.clientTraffics[]`, the Inbounds page already consumes the sibling `traffics[]` array) — only the client-side render was missing. Closes the per-client real-time speed feature request. ## Type of change - [ ] Bug fix - [x] New feature - [x] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? Open the panel → Clients tab → confirm a `↑ x/s / ↓ y/s` tag appears in the new **Speed** column for active clients, updates every 5 s, and falls to `—` within one poll after a client goes idle. Resize to mobile width to confirm the same line shows under the cumulative traffic bar on each card. Switch between en, zh, ru, fa, ar to confirm the header translates and RTL renders cleanly. ## Screenshots / recordings <img width="1280" height="309" alt="2026-06-30 15 53 14" src="https://github.com/user-attachments/assets/a1e3667c-c385-412a-b986-2fa86acac2be" /> ## Breaking changes None. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [ ] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [ ] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5961
No description provided.