mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5677] [MERGED] feat(hosts): bulk-add multiple hosts to multiple inbounds #5958
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#5958
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/5677
Author: @AmirRnz
Created: 6/30/2026
Status: ✅ Merged
Merged: 7/8/2026
Merged by: @MHSanaei
Base:
main← Head:feat/multi-hosts-bulk📝 Commits (10+)
849e075feat(hosts): bulk-add multiple hosts to multiple inbounds79eb894feat(hosts): group override records by group_id and support group editing368a9fefix: import Popover in HostList9659de3fix: use messageApi in HostFormModal5d347c9fix(hosts): resolve 4 bugs found in host-group code review54d02d4Merge remote-tracking branch 'origin/main' into feat/multi-hosts-bulk9db9002Merge branch 'main' into feat/multi-hosts-bulk2e5e4fffix(hosts): address code review feedback (optimize bulk inserts, add validation tests, and remove comments)41815f4Merge remote-tracking branch 'origin/main' into feat/multi-hosts-bulk77b88d4Merge branch 'main' into feat/multi-hosts-bulk📊 Changes
33 files changed (+1815 additions, -1081 deletions)
View changed files
📝
frontend/public/openapi.json(+474 -328)📝
frontend/src/api/queries/useHostMutations.ts(+19 -19)📝
frontend/src/generated/examples.ts(+48 -0)📝
frontend/src/generated/schemas.ts(+174 -159)📝
frontend/src/generated/types.ts(+35 -0)📝
frontend/src/generated/zod.ts(+36 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+35 -25)📝
frontend/src/pages/hosts/HostFormModal.tsx(+67 -35)📝
frontend/src/pages/hosts/HostList.tsx(+92 -37)📝
frontend/src/pages/hosts/HostsPage.tsx(+29 -40)📝
frontend/src/schemas/api/host.ts(+9 -21)📝
internal/database/db.go(+42 -95)📝
internal/database/host_test.go(+1 -2)📝
internal/database/model/model.go(+1 -4)📝
internal/web/controller/host.go(+24 -41)📝
internal/web/controller/host_test.go(+55 -33)📝
internal/web/entity/entity.go(+119 -101)📝
internal/web/service/host.go(+273 -61)📝
internal/web/service/host_test.go(+243 -55)📝
internal/web/translation/ar-EG.json(+3 -2)...and 13 more files
📄 Description
Summary
Adds a bulk host creation flow that lets users select multiple inbounds
and enter multiple host addresses in one form submission, with optional
per-host port overrides (e.g.
host.com,host.com:443,[2001:db8::1]:80).Why
Managing hosts becomes painful at scale. A user with many inbounds and
repeated host addresses (e.g.
1.1.1.1and1.1.1.2for every inbound)was forced to do it one by one. This change lets them set up all
combinations in a single submit.
A common real-world example: using Cloudflare CDN clean IPs. You may
have a set of working Cloudflare IPs (e.g.
104.21.x.x,172.67.x.x)that you want to attach to all of your inbounds so clients can find the
fastest route. With 10 inbounds and 5 IPs that's 50 individual form
submissions. This change reduces that to a single submit — pick all 10
inbounds, paste the 5 IPs, done.
The same pain applies when IPs need to be rotated or updated. Cloudflare
clean IPs change over time and users periodically need to swap out stale
addresses for fresh ones. Previously that meant deleting the old entries
and re-adding the new ones one by one across every inbound. With bulk add,
re-populating a fresh set of IPs across all inbounds takes seconds.
Type of change
Areas affected
How was this tested?
Deployed and tested on a live VPS (Linux) — all scenarios below were
verified end-to-end with a real SQLite database and the full Go binary.
Screenshots / recordings
you can find it in the next comment
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.