[PR #5524] [MERGED] feat(clients): bulk-set XTLS flow from the Adjust dialog #5913

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5524
Author: @rqzbeh
Created: 6/23/2026
Status: ✅ Merged
Merged: 6/24/2026
Merged by: @MHSanaei

Base: main ← Head: feat/bulk-client-flow-adjust


📝 Commits (2)

  • fab06f0 feat(clients): bulk-set XTLS flow from the Adjust dialog
  • 99e9978 fix(clients): keep days/traffic write when bulk flow is ineligible

📊 Changes

11 files changed (+360 additions, -31 deletions)

View changed files

📝 frontend/public/openapi.json (+3 -2)
📝 frontend/src/hooks/useClients.ts (+3 -3)
📝 frontend/src/pages/api-docs/endpoints.ts (+2 -2)
📝 frontend/src/pages/clients/ClientBulkAdjustModal.tsx (+22 -4)
📝 frontend/src/pages/clients/ClientsPage.tsx (+2 -2)
📝 frontend/src/schemas/client.ts (+2 -1)
📝 internal/web/controller/client.go (+2 -1)
📝 internal/web/service/client_bulk.go (+102 -14)
➕ internal/web/service/client_bulk_flow_test.go (+217 -0)
📝 internal/web/service/sync_scale_postgres_test.go (+1 -1)
📝 internal/web/translation/en-US.json (+4 -1)

📄 Description

Summary

Add a "Set flow" dropdown to the bulk Adjust dialog so an admin can set or clear the XTLS flow on all selected clients at once, alongside the existing days/traffic adjustments.

Why

Flow can already be set per client in the credential tab, but there was no way to change it for many clients at once. Admins migrating inbounds to XTLS Vision (or away from it) had to edit clients one by one. This reuses the existing bulk-adjust path to make it a single action.

The dropdown is empty by default (saving has no effect on flow). Options:

  • No change (default)
  • Disable — clears flow on every selected client
  • xtls-rprx-vision
  • xtls-rprx-vision-udp443

Type of change

  • New feature

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation

How was this tested?

  • New backend tests in internal/web/service/client_bulk_flow_test.go:
    • vision flow set on an eligible VLESS inbound, then cleared via "Disable"; both request a restart; re-setting the same value is a no-op (no restart).
    • vision flow refused on an ineligible inbound (ws transport) — reported as skipped, flow left untouched.
    • empty / unknown directive with no days/traffic errors as "no adjustment".
  • go test ./internal/web/service ./internal/web/controller — all pass (363).
  • npm run lint, npm run typecheck pass; npm run gen produces no diff (codegen gate clean).
  • Manual: Clients page → select clients → More → Adjust → pick a flow → Apply; flow column updates, ineligible clients reported skipped.

Screenshots / recordings

Breaking changes

None. Flow rides the existing inbound-settings → SyncInbound path (ClientRecord.Flow + client_inbounds.flow_override); no new endpoint, DB column, or migration. The /panel/api/clients/bulkAdjust request gains an optional flow field (omitted = unchanged). Setting a vision flow is gated by inboundCanEnableTlsFlow: ineligible inbounds are left untouched and reported as skipped; clearing is always allowed. A real flow change requests an xray restart (local) or a node reconcile (remote).

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 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/5524 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 6/23/2026 **Status:** ✅ Merged **Merged:** 6/24/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/bulk-client-flow-adjust` --- ### 📝 Commits (2) - [`fab06f0`](https://github.com/MHSanaei/3x-ui/commit/fab06f0f0d7d0a88f5f214421a830c3e0b07d611) feat(clients): bulk-set XTLS flow from the Adjust dialog - [`99e9978`](https://github.com/MHSanaei/3x-ui/commit/99e9978d635d15367b36cee354cc74a7582b774c) fix(clients): keep days/traffic write when bulk flow is ineligible ### 📊 Changes **11 files changed** (+360 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `frontend/public/openapi.json` (+3 -2) 📝 `frontend/src/hooks/useClients.ts` (+3 -3) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+2 -2) 📝 `frontend/src/pages/clients/ClientBulkAdjustModal.tsx` (+22 -4) 📝 `frontend/src/pages/clients/ClientsPage.tsx` (+2 -2) 📝 `frontend/src/schemas/client.ts` (+2 -1) 📝 `internal/web/controller/client.go` (+2 -1) 📝 `internal/web/service/client_bulk.go` (+102 -14) ➕ `internal/web/service/client_bulk_flow_test.go` (+217 -0) 📝 `internal/web/service/sync_scale_postgres_test.go` (+1 -1) 📝 `internal/web/translation/en-US.json` (+4 -1) </details> ### 📄 Description ## Summary Add a "Set flow" dropdown to the bulk **Adjust** dialog so an admin can set or clear the XTLS flow on all selected clients at once, alongside the existing days/traffic adjustments. ## Why Flow can already be set per client in the credential tab, but there was no way to change it for many clients at once. Admins migrating inbounds to XTLS Vision (or away from it) had to edit clients one by one. This reuses the existing bulk-adjust path to make it a single action. The dropdown is empty by default (saving has no effect on flow). Options: - **No change** (default) - **Disable** — clears flow on every selected client - **xtls-rprx-vision** - **xtls-rprx-vision-udp443** ## Type of change - [x] New feature ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [x] Xray config generation ## How was this tested? - New backend tests in `internal/web/service/client_bulk_flow_test.go`: - vision flow set on an eligible VLESS inbound, then cleared via "Disable"; both request a restart; re-setting the same value is a no-op (no restart). - vision flow refused on an ineligible inbound (ws transport) — reported as skipped, flow left untouched. - empty / unknown directive with no days/traffic errors as "no adjustment". - `go test ./internal/web/service ./internal/web/controller` — all pass (363). - `npm run lint`, `npm run typecheck` pass; `npm run gen` produces no diff (codegen gate clean). - Manual: Clients page → select clients → More → Adjust → pick a flow → Apply; flow column updates, ineligible clients reported skipped. ## Screenshots / recordings <!-- Dropdown added to the existing Adjust dialog. --> ## Breaking changes None. Flow rides the existing inbound-settings → `SyncInbound` path (`ClientRecord.Flow` + `client_inbounds.flow_override`); no new endpoint, DB column, or migration. The `/panel/api/clients/bulkAdjust` request gains an optional `flow` field (omitted = unchanged). Setting a vision flow is gated by `inboundCanEnableTlsFlow`: ineligible inbounds are left untouched and reported as skipped; clearing is always allowed. A real flow change requests an xray restart (local) or a node reconcile (remote). ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck` pass. - [ ] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:58 +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#5913
No description provided.