[PR #4338] [MERGED] fix: single inbound traffic reset resets all inbounds (#4334) #5663

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4338
Author: @abdalrahmanx9
Created: 5/13/2026
Status: ✅ Merged
Merged: 5/13/2026
Merged by: @MHSanaei

Base: main ← Head: fix/single-inbound-traffic-reset


📝 Commits (1)

  • a7dbbb1 fix: single inbound traffic reset resets all inbounds (#4334)

📊 Changes

15 files changed (+33 additions, -1 deletions)

View changed files

📝 frontend/src/pages/inbounds/InboundsPage.vue (+1 -1)
📝 web/controller/inbound.go (+19 -0)
📝 web/translation/ar-EG.json (+1 -0)
📝 web/translation/en-US.json (+1 -0)
📝 web/translation/es-ES.json (+1 -0)
📝 web/translation/fa-IR.json (+1 -0)
📝 web/translation/id-ID.json (+1 -0)
📝 web/translation/ja-JP.json (+1 -0)
📝 web/translation/pt-BR.json (+1 -0)
📝 web/translation/ru-RU.json (+1 -0)
📝 web/translation/tr-TR.json (+1 -0)
📝 web/translation/uk-UA.json (+1 -0)
📝 web/translation/vi-VN.json (+1 -0)
📝 web/translation/zh-CN.json (+1 -0)
📝 web/translation/zh-TW.json (+1 -0)

📄 Description

Description

Clicking "Reset traffic" on a single inbound (via the 3-dot menu on the Inbounds page) resets traffic counters for all inbounds — not just the selected one. It also propagates the reset to remote nodes, resetting client traffic on those nodes.

How to reproduce

  1. Go to the Inbounds page
  2. Click the 3-dot menu on any inbound row
  3. Click "Reset traffic"
  4. All inbound up/down counters are reset to 0

Root cause

confirmResetTraffic(dbInbound) in InboundsPage.vue receives the selected inbound as a parameter and displays its remark in the confirmation dialog, but the API call was hardcoded to POST /panel/api/inbounds/resetAllTraffics — ignoring the inbound ID entirely.

Additionally, the backend had a correctly-scoped service method ResetInboundTraffic(id) (web/service/inbound.go:3032) but it was never exposed via an API route.

Fix

  • Frontend: Changed the API call to POST /panel/api/inbounds/${dbInbound.id}/resetTraffic
  • Backend: Added POST /:id/resetTraffic route wired to a new resetInboundTraffic handler that calls the existing ResetInboundTraffic(id) service method (which correctly uses WHERE id = ?)
  • i18n: Added resetInboundTrafficSuccess key to all 13 translation files

Closes #4334


🔄 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/4338 **Author:** [@abdalrahmanx9](https://github.com/abdalrahmanx9) **Created:** 5/13/2026 **Status:** ✅ Merged **Merged:** 5/13/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/single-inbound-traffic-reset` --- ### 📝 Commits (1) - [`a7dbbb1`](https://github.com/MHSanaei/3x-ui/commit/a7dbbb18a9459139d81e32d2422ee898f91a7186) fix: single inbound traffic reset resets all inbounds (#4334) ### 📊 Changes **15 files changed** (+33 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/inbounds/InboundsPage.vue` (+1 -1) 📝 `web/controller/inbound.go` (+19 -0) 📝 `web/translation/ar-EG.json` (+1 -0) 📝 `web/translation/en-US.json` (+1 -0) 📝 `web/translation/es-ES.json` (+1 -0) 📝 `web/translation/fa-IR.json` (+1 -0) 📝 `web/translation/id-ID.json` (+1 -0) 📝 `web/translation/ja-JP.json` (+1 -0) 📝 `web/translation/pt-BR.json` (+1 -0) 📝 `web/translation/ru-RU.json` (+1 -0) 📝 `web/translation/tr-TR.json` (+1 -0) 📝 `web/translation/uk-UA.json` (+1 -0) 📝 `web/translation/vi-VN.json` (+1 -0) 📝 `web/translation/zh-CN.json` (+1 -0) 📝 `web/translation/zh-TW.json` (+1 -0) </details> ### 📄 Description ## Description Clicking "Reset traffic" on a single inbound (via the 3-dot menu on the Inbounds page) resets traffic counters for **all** inbounds — not just the selected one. It also propagates the reset to remote nodes, resetting client traffic on those nodes. ## How to reproduce 1. Go to the Inbounds page 2. Click the 3-dot menu on any inbound row 3. Click "Reset traffic" 4. All inbound up/down counters are reset to 0 ## Root cause `confirmResetTraffic(dbInbound)` in `InboundsPage.vue` receives the selected inbound as a parameter and displays its remark in the confirmation dialog, but the API call was hardcoded to `POST /panel/api/inbounds/resetAllTraffics` — ignoring the inbound ID entirely. Additionally, the backend had a correctly-scoped service method `ResetInboundTraffic(id)` (`web/service/inbound.go:3032`) but it was never exposed via an API route. ## Fix - **Frontend**: Changed the API call to `POST /panel/api/inbounds/${dbInbound.id}/resetTraffic` - **Backend**: Added `POST /:id/resetTraffic` route wired to a new `resetInboundTraffic` handler that calls the existing `ResetInboundTraffic(id)` service method (which correctly uses `WHERE id = ?`) - **i18n**: Added `resetInboundTrafficSuccess` key to all 13 translation files Closes #4334 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:08 +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#5663
No description provided.