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

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/4173
Author: @stivfilippov
Created: 5/6/2026
Status: ❌ Closed

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


📝 Commits (1)

  • 982d0c7 feat: add per-client real-time speed & 24h daily traffic

📊 Changes

6 files changed (+135 additions, -0 deletions)

View changed files

📝 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 the same delta logic as the dashboard widget.
  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 matches dashboard logic. 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 every ~1s
  • After 00:00 → Daily counters reset automatically on next stat update
  • Backward compatible with existing installations

Screenshots

image

🔄 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/4173 **Author:** [@stivfilippov](https://github.com/stivfilippov) **Created:** 5/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/daily-traffic-speed` --- ### 📝 Commits (1) - [`982d0c7`](https://github.com/MHSanaei/3x-ui/commit/982d0c786be6d4d54459b15c16d7f7ad0b871e68) feat: add per-client real-time speed & 24h daily traffic ### 📊 Changes **6 files changed** (+135 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `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 the same delta logic as the dashboard widget. 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 matches dashboard logic. 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 every ~1s - 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="1920" height="919" alt="image" src="https://github.com/user-attachments/assets/4da0527c-e663-476a-8ebf-9864c244fccf" /> --- <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#5618
No description provided.