mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6071] [MERGED] inbounds: allow custom monthly traffic reset days #6070
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#6070
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/6071
Author: @Ki-Seki
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @MHSanaei
Base:
main← Head:feat/monthly-traffic-reset-day📝 Commits (3)
1b2b457inbounds: allow custom monthly traffic reset days95806b6Merge branch 'main' into feat/monthly-traffic-reset-day32609daMerge branch 'main' into feat/monthly-traffic-reset-day📊 Changes
37 files changed (+179 additions, -16 deletions)
View changed files
📝
docs/architecture.md(+2 -2)📝
docs/content/docs/en/config/inbounds.mdx(+3 -0)📝
docs/content/docs/fa/config/inbounds.mdx(+3 -0)📝
docs/content/docs/ru/config/inbounds.mdx(+3 -0)📝
docs/content/docs/zh/config/inbounds.mdx(+3 -0)📝
frontend/public/openapi.json(+9 -0)📝
frontend/src/generated/examples.ts(+1 -0)📝
frontend/src/generated/schemas.ts(+8 -0)📝
frontend/src/generated/types.ts(+1 -0)📝
frontend/src/generated/zod.ts(+1 -0)📝
frontend/src/lib/xray/inbound-form-adapter.ts(+4 -0)📝
frontend/src/models/dbinbound.ts(+3 -0)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+12 -0)📝
frontend/src/schemas/forms/inbound-form.ts(+1 -0)📝
frontend/src/test/inbound-form-adapter.test.ts(+7 -0)📝
internal/database/model/model.go(+1 -0)📝
internal/web/job/periodic_traffic_reset_job.go(+24 -3)➕
internal/web/job/periodic_traffic_reset_job_test.go(+31 -0)📝
internal/web/runtime/remote.go(+3 -0)📝
internal/web/runtime/remote_test.go(+6 -3)...and 17 more files
📄 Description
Summary
Adds a configurable reset day (1–31) for monthly inbound traffic resets. Monthly jobs now check each panel-local midnight and reset only inbounds due that day; shorter months fall back to their final day.
The setting is supported by the panel form, API/OpenAPI schema, generated TypeScript types, multi-node synchronization, all UI locales, and user/architecture documentation. Existing inbounds and older API/node payloads continue to default to day 1.
Why
Monthly traffic quotas often follow billing dates other than the first day of the calendar month. This lets an inbound reset on dates such as the 15th without changing the existing hourly, daily, or weekly behavior.
Refs #3462.
Type of change
Areas affected
How was this tested?
go test ./...go build ./...npm run typechecknpm run lintnpm run test(96 files, 885 tests)npm run buildnpm run build-storybookScreenshots / recordings
Breaking changes
None. The database column defaults to 1, and missing or zero values from older clients/nodes are normalized to day 1.
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.