mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5261] [MERGED] feat(ui): show per-inbound live speed #5834
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5834
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5261
Author: @NikanZeyaei
Created: 6/13/2026
Status: ✅ Merged
Merged: 6/14/2026
Merged by: @MHSanaei
Base:
main← Head:feature/inbound-speed📝 Commits (10+)
604bbdbfeat(utils): add speedFormat utility and testsb8460adfeat(inbounds): add InboundSpeedEntry type1071722feat(inbounds): add speed column to inbound list6673990feat(inbounds): show speed in inbound stats modal121d684feat(inbounds): compute inbound speed from traffic deltasb28aed3feat(inbounds): wire inbound speed through pagef10a5d3feat(i18n): add speed translation for all locales87261ccMerge branch 'main' into feature/inbound-speedcfa3e7cMerge branch 'main' into feature/inbound-speed3c893a5refactor(inbounds): dedupe live-speed UI and harden formatting📊 Changes
22 files changed (+198 additions, -5 deletions)
View changed files
📝
frontend/src/pages/inbounds/InboundsPage.tsx(+2 -0)📝
frontend/src/pages/inbounds/list/InboundList.tsx(+3 -0)➕
frontend/src/pages/inbounds/list/InboundSpeedTag.tsx(+39 -0)📝
frontend/src/pages/inbounds/list/InboundStatsModal.tsx(+14 -1)📝
frontend/src/pages/inbounds/list/types.ts(+6 -0)📝
frontend/src/pages/inbounds/list/useInboundColumns.tsx(+18 -2)📝
frontend/src/pages/inbounds/useInbounds.ts(+43 -1)➕
frontend/src/test/size-formatter.test.ts(+54 -0)📝
frontend/src/utils/index.ts(+6 -1)📝
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)...and 2 more files
📄 Description
Summary
Closes #4886
Adds a live speed column to the inbounds list showing per-inbound upload/download throughput (bytes/sec). The speed is also shown in the mobile stats modal. The backend already broadcasts per-inbound byte deltas over the WebSocket every 5 seconds; this PR closes the frontend UX gap by consuming those deltas and rendering them.
Why
Users could see cumulative traffic per inbound, but had no way to tell how much bandwidth an inbound was using right now. The WebSocket traffic message already carries
traffics: [{ tag, up, down, isInbound }], so no backend data work was needed — only frontend display and formatting.Type of change
Areas affected
How was this tested?
cd frontend && npm run typecheck— passes.cd frontend && npm run test -- size-formatter.test.ts --run— passes.go build ./internal/xray/... ./internal/web/...— passes.Implementation details
Frontend (TypeScript/React):
SizeFormatter.speedFormat(bps)infrontend/src/utils/index.tsfor "↑ X KB/s / ↓ Y MB/s" style rendering, plus unit tests infrontend/src/test/size-formatter.test.ts.InboundSpeedEntrytype infrontend/src/pages/inbounds/list/types.ts.frontend/src/pages/inbounds/useInbounds.ts:payload.trafficsfrom the WebSocket traffic event.IsInbound !== false) and mapsTagto inbound rows.delta.Up / 5anddelta.Down / 5to get bytes/sec.inboundSpeed: Record<number, InboundSpeed>.frontend/src/pages/inbounds/list/useInboundColumns.tsx, wired throughfrontend/src/pages/inbounds/list/InboundList.tsx.frontend/src/pages/inbounds/list/InboundStatsModal.tsxfor the mobile card view.inboundSpeedthroughfrontend/src/pages/inbounds/InboundsPage.tsx.Translations:
pages.inbounds.speedkey to all 13 supported language files.Files changed
frontend/src/utils/index.tsfrontend/src/test/size-formatter.test.tsfrontend/src/pages/inbounds/list/types.tsfrontend/src/pages/inbounds/useInbounds.tsfrontend/src/pages/inbounds/list/useInboundColumns.tsxfrontend/src/pages/inbounds/list/InboundList.tsxfrontend/src/pages/inbounds/list/InboundStatsModal.tsxfrontend/src/pages/inbounds/InboundsPage.tsxinternal/web/translation/en-US.jsoninternal/web/translation/vi-VN.jsoninternal/web/translation/zh-CN.jsoninternal/web/translation/zh-TW.jsoninternal/web/translation/ru-RU.jsoninternal/web/translation/pt-BR.jsoninternal/web/translation/uk-UA.jsoninternal/web/translation/tr-TR.jsoninternal/web/translation/id-ID.jsoninternal/web/translation/ja-JP.jsoninternal/web/translation/fa-IR.jsoninternal/web/translation/es-ES.jsoninternal/web/translation/ar-EG.jsonScreenshots / recordings
https://github.com/user-attachments/assets/b1ae8262-dceb-48a2-9caf-9abf062b8b07
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.