[PR #4177] [CLOSED] feat: add per-client real-time speed & 24h daily traffic #5619

Closed
opened 2026-10-31 20:48:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4177
Author: @stivfilippov
Created: 5/6/2026
Status: ❌ Closed

Base: main ← Head: feat/daily-traffic-speed


📝 Commits (6)

  • cb33e72 feat: add per-client real-time speed & 24h daily traffic
  • c6cf569 Merge branch 'main' into feat/daily-traffic-speed
  • 3ab1359 Merge branch 'main' into feat/daily-traffic-speed
  • 7267220 Merge branch 'main' into feat/daily-traffic-speed
  • cbfcfad Merge branch 'main' into feat/daily-traffic-speed
  • e3662f4 Merge branch 'main' into feat/daily-traffic-speed

📊 Changes

7 files changed (+136 additions, -1 deletions)

View changed files

📝 web/assets/css/custom.min.css (+1 -1)
📝 web/html/component/aClientTable.html (+23 -0)
📝 web/html/inbounds.html (+90 -0)
📝 web/service/inbound.go (+12 -0)
📝 web/translation/translate.en_US.toml (+2 -0)
📝 web/translation/translate.ru_RU.toml (+2 -0)
📝 xray/client_traffic.go (+6 -0)

📄 Description

Description

Adds two highly requested features to the client table:

  1. Real-time Speed column (Speed) – shows current per-client throughput, calculated with delta logic synced to the dashboard's stats refresh interval (default ~10s).
  2. 24h Daily Traffic column (Daily) – tracks up/down traffic per client with automatic reset at 00:00 local time.

Implementation

  • Backend: Added DailyUp, DailyDown, LastDailyReset to xray.ClientTraffic. GORM auto-migrates on startup.
  • Logic: Lazy reset in addClientTraffic() – counters zero out on first stat fetch after midnight. No cron/goroutines needed.
  • Frontend: Vue-based speed calculation uses the same delta logic as the global dashboard widget, updating in sync with Xray stats reporting. Columns are non-sortable & non-clickable as requested.
  • i18n: Added pages.inbounds.speed & pages.inbounds.dailyTraffic keys to all translation files.

Testing

  • Fresh DB → columns show - or 0
  • Active client → Speed updates in sync with panel stats refresh (~10s interval by default)
  • After 00:00 → Daily counters reset automatically on next stat update
  • Backward compatible with existing installations

Screenshots

NVIDIA_Overlay_1WT0OgSyLH

🔄 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/4177 **Author:** [@stivfilippov](https://github.com/stivfilippov) **Created:** 5/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/daily-traffic-speed` --- ### 📝 Commits (6) - [`cb33e72`](https://github.com/MHSanaei/3x-ui/commit/cb33e7292562dc9623c23677c5ce5df606e6225f) feat: add per-client real-time speed & 24h daily traffic - [`c6cf569`](https://github.com/MHSanaei/3x-ui/commit/c6cf5698526ace600af2f116c1b8953333aac4f8) Merge branch 'main' into feat/daily-traffic-speed - [`3ab1359`](https://github.com/MHSanaei/3x-ui/commit/3ab13591164a2b256841d761cd0dae0455bbd6cd) Merge branch 'main' into feat/daily-traffic-speed - [`7267220`](https://github.com/MHSanaei/3x-ui/commit/72672203e8a41cc8db58a1a1775aa8c612e0fa2d) Merge branch 'main' into feat/daily-traffic-speed - [`cbfcfad`](https://github.com/MHSanaei/3x-ui/commit/cbfcfad06297b36a8a3cd6a52bba6a3da1fce018) Merge branch 'main' into feat/daily-traffic-speed - [`e3662f4`](https://github.com/MHSanaei/3x-ui/commit/e3662f482f472c8f0751d3a1b3922f67a59b06cf) Merge branch 'main' into feat/daily-traffic-speed ### 📊 Changes **7 files changed** (+136 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `web/assets/css/custom.min.css` (+1 -1) 📝 `web/html/component/aClientTable.html` (+23 -0) 📝 `web/html/inbounds.html` (+90 -0) 📝 `web/service/inbound.go` (+12 -0) 📝 `web/translation/translate.en_US.toml` (+2 -0) 📝 `web/translation/translate.ru_RU.toml` (+2 -0) 📝 `xray/client_traffic.go` (+6 -0) </details> ### 📄 Description ## Description Adds two highly requested features to the client table: 1. **Real-time Speed column** (`Speed`) – shows current per-client throughput, calculated with delta logic synced to the dashboard's stats refresh interval (default ~10s). 2. **24h Daily Traffic column** (`Daily`) – tracks up/down traffic per client with automatic reset at 00:00 local time. ## Implementation - **Backend**: Added `DailyUp`, `DailyDown`, `LastDailyReset` to `xray.ClientTraffic`. GORM auto-migrates on startup. - **Logic**: Lazy reset in `addClientTraffic()` – counters zero out on first stat fetch after midnight. No cron/goroutines needed. - **Frontend**: Vue-based speed calculation uses the same delta logic as the global dashboard widget, updating in sync with Xray stats reporting. Columns are non-sortable & non-clickable as requested. - **i18n**: Added `pages.inbounds.speed` & `pages.inbounds.dailyTraffic` keys to all translation files. ## Testing - Fresh DB → columns show `-` or `0` - Active client → Speed updates in sync with panel stats refresh (~10s interval by default) - After 00:00 → Daily counters reset automatically on next stat update - Backward compatible with existing installations ## Screenshots <!-- Drag & drop screenshots here to show the new Speed & Daily Traffic columns --> <img width="1916" height="918" alt="NVIDIA_Overlay_1WT0OgSyLH" src="https://github.com/user-attachments/assets/8986efb6-0443-49a7-8819-4e961a4b4014" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:48:13 +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#5619
No description provided.