[PR #6399] [MERGED] feat(clients): support setting HWID limit and MTProto ad-tag in bulk adjust #6252

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6399
Author: @rqzbeh
Created: 9/3/2026
Status: ✅ Merged
Merged: 9/10/2026
Merged by: @MHSanaei

Base: main ← Head: feat/clients-bulk-adjust-hwid-adtag


📝 Commits (10+)

  • 5966b2d feat(clients): support setting HWID limit and MTProto ad-tag in bulk adjust
  • 6694c5b Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag
  • 5b1edfe fix(clients): gate adTag to MTProto inbounds and avoid inbound rewrite for limitHwid
  • c477b64 Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag
  • 2c33afb Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag
  • 5e3cae5 Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag
  • cde5508 Merge branch 'main' of https://github.com/MHSanaei/3x-ui into feat/clients-bulk-adjust-hwid-adtag
  • f20280a Merge remote-tracking branch 'origin/main' into pr/6399
  • 73a8519 fix(clients): stamp updated_at only on the clients a bulk adjust changed
  • dee5556 docs(api): regenerate the bulkAdjust reference for limitHwid and adTag

📊 Changes

29 files changed (+626 additions, -121 deletions)

View changed files

📝 docs/content/docs/en/reference/api/clients.mdx (+17 -13)
📝 docs/public/openapi.json (+4 -2)
📝 frontend/public/openapi.json (+4 -2)
📝 frontend/src/hooks/useClients.ts (+12 -3)
📝 frontend/src/pages/api-docs/endpoints.ts (+2 -2)
📝 frontend/src/pages/clients/ClientBulkAdjustModal.tsx (+39 -4)
📝 frontend/src/pages/clients/ClientsPage.tsx (+9 -2)
📝 frontend/src/pages/groups/GroupsPage.tsx (+2 -2)
📝 frontend/src/schemas/client.ts (+24 -3)
📝 internal/web/controller/client.go (+7 -5)
📝 internal/web/service/client_bulk.go (+130 -36)
📝 internal/web/service/client_bulk_fanout_test.go (+1 -1)
📝 internal/web/service/client_bulk_flow_test.go (+323 -7)
📝 internal/web/service/client_bulk_reenable_test.go (+11 -11)
📝 internal/web/service/node_bulk_dispatch_test.go (+1 -1)
📝 internal/web/service/sync_scale_postgres_test.go (+1 -1)
📝 internal/web/translation/ar-EG.json (+3 -2)
📝 internal/web/translation/en-US.json (+3 -2)
📝 internal/web/translation/es-ES.json (+3 -2)
📝 internal/web/translation/fa-IR.json (+3 -2)

...and 9 more files

📄 Description

Summary

Adds HWID device limit and Telegram MTProto sponsor channel (ad-tag) adjustment to the multi-client bulk adjust modal and backend API endpoint.

Why

Previously, adjusting HWID device limit (limitHwid) or configuring a Telegram MTProto sponsor channel tag (adTag) had to be performed manually one client at a time in the single-client edit modal. When managing multiple clients, administrators already adjust traffic, expiry, and flow in bulk; adding HWID limit and Telegram sponsor channel to ClientBulkAdjustModal and POST /panel/api/clients/bulkAdjust streamlines client administration.

Type of change

  • New feature

Areas affected

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

How was this tested?

  • Backend tests in internal/web/service/:
    • TestBulkAdjust_HwidLimit: Setting HWID limit to N, resetting to 0 (unlimited), verifying device limit updates on client records without triggering unnecessary core restarts.
    • TestBulkAdjust_MtprotoAdTagSetAndClear: Setting 32-hex ad-tag on MTProto inbounds, clearing with "none", and rejecting malformed tags.
    • Existing TestBulkAdjust_FlowSetAndClear, TestBulkAdjust_FlowIneligibleSkipped, and re-enablement tests.
  • Frontend checks in frontend/:
    • npm run typecheck (zero TypeScript errors)
    • npm run lint (clean oxlint)
    • npm run build (successful production Vite build)
    • npx vitest run src/test/i18n-dead-keys.test.ts (verified translation coverage and no dead keys across all 13 locales)
  • API route contracts:
    • go test -v ./internal/web/ -run TestRouteRegistryContract (passes with updated OpenAPI doc)

Screenshots / recordings

N/A

Breaking changes

None

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, and npm run build 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.

🤖 Generated with Claude Code


🔄 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/6399 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 9/3/2026 **Status:** ✅ Merged **Merged:** 9/10/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/clients-bulk-adjust-hwid-adtag` --- ### 📝 Commits (10+) - [`5966b2d`](https://github.com/MHSanaei/3x-ui/commit/5966b2d3d58e2e168a43d0b19b0bdbf762e22958) feat(clients): support setting HWID limit and MTProto ad-tag in bulk adjust - [`6694c5b`](https://github.com/MHSanaei/3x-ui/commit/6694c5b292f0d170abf2ffb799671301157cb124) Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag - [`5b1edfe`](https://github.com/MHSanaei/3x-ui/commit/5b1edfe5783232a9e71cc7281823d551de044005) fix(clients): gate adTag to MTProto inbounds and avoid inbound rewrite for limitHwid - [`c477b64`](https://github.com/MHSanaei/3x-ui/commit/c477b6464ada9460010a2e508701261103b6f640) Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag - [`2c33afb`](https://github.com/MHSanaei/3x-ui/commit/2c33afbbd3cf241ca9609119f135179be16140b2) Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag - [`5e3cae5`](https://github.com/MHSanaei/3x-ui/commit/5e3cae5c4cbbc2d9d3eea10819a186e4b3e9010b) Merge branch 'main' into feat/clients-bulk-adjust-hwid-adtag - [`cde5508`](https://github.com/MHSanaei/3x-ui/commit/cde550811541b9fab19575c7fe513a0e1a964b8d) Merge branch 'main' of https://github.com/MHSanaei/3x-ui into feat/clients-bulk-adjust-hwid-adtag - [`f20280a`](https://github.com/MHSanaei/3x-ui/commit/f20280a7b1f069e4b1e7e2a93b503a7b7e55ee18) Merge remote-tracking branch 'origin/main' into pr/6399 - [`73a8519`](https://github.com/MHSanaei/3x-ui/commit/73a85199762589d0adb0cc37feb2232a9c94202b) fix(clients): stamp updated_at only on the clients a bulk adjust changed - [`dee5556`](https://github.com/MHSanaei/3x-ui/commit/dee55569f241509d7436df8fa9ff35fbca55e450) docs(api): regenerate the bulkAdjust reference for limitHwid and adTag ### 📊 Changes **29 files changed** (+626 additions, -121 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/reference/api/clients.mdx` (+17 -13) 📝 `docs/public/openapi.json` (+4 -2) 📝 `frontend/public/openapi.json` (+4 -2) 📝 `frontend/src/hooks/useClients.ts` (+12 -3) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+2 -2) 📝 `frontend/src/pages/clients/ClientBulkAdjustModal.tsx` (+39 -4) 📝 `frontend/src/pages/clients/ClientsPage.tsx` (+9 -2) 📝 `frontend/src/pages/groups/GroupsPage.tsx` (+2 -2) 📝 `frontend/src/schemas/client.ts` (+24 -3) 📝 `internal/web/controller/client.go` (+7 -5) 📝 `internal/web/service/client_bulk.go` (+130 -36) 📝 `internal/web/service/client_bulk_fanout_test.go` (+1 -1) 📝 `internal/web/service/client_bulk_flow_test.go` (+323 -7) 📝 `internal/web/service/client_bulk_reenable_test.go` (+11 -11) 📝 `internal/web/service/node_bulk_dispatch_test.go` (+1 -1) 📝 `internal/web/service/sync_scale_postgres_test.go` (+1 -1) 📝 `internal/web/translation/ar-EG.json` (+3 -2) 📝 `internal/web/translation/en-US.json` (+3 -2) 📝 `internal/web/translation/es-ES.json` (+3 -2) 📝 `internal/web/translation/fa-IR.json` (+3 -2) _...and 9 more files_ </details> ### 📄 Description ## Summary Adds HWID device limit and Telegram MTProto sponsor channel (ad-tag) adjustment to the multi-client bulk adjust modal and backend API endpoint. ## Why Previously, adjusting HWID device limit (`limitHwid`) or configuring a Telegram MTProto sponsor channel tag (`adTag`) had to be performed manually one client at a time in the single-client edit modal. When managing multiple clients, administrators already adjust traffic, expiry, and flow in bulk; adding HWID limit and Telegram sponsor channel to `ClientBulkAdjustModal` and `POST /panel/api/clients/bulkAdjust` streamlines client administration. ## Type of change - [x] New feature ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) ## How was this tested? - Backend tests in `internal/web/service/`: - `TestBulkAdjust_HwidLimit`: Setting HWID limit to N, resetting to 0 (unlimited), verifying device limit updates on client records without triggering unnecessary core restarts. - `TestBulkAdjust_MtprotoAdTagSetAndClear`: Setting 32-hex ad-tag on MTProto inbounds, clearing with `"none"`, and rejecting malformed tags. - Existing `TestBulkAdjust_FlowSetAndClear`, `TestBulkAdjust_FlowIneligibleSkipped`, and re-enablement tests. - Frontend checks in `frontend/`: - `npm run typecheck` (zero TypeScript errors) - `npm run lint` (clean oxlint) - `npm run build` (successful production Vite build) - `npx vitest run src/test/i18n-dead-keys.test.ts` (verified translation coverage and no dead keys across all 13 locales) - API route contracts: - `go test -v ./internal/web/ -run TestRouteRegistryContract` (passes with updated OpenAPI doc) ## Screenshots / recordings N/A ## Breaking changes None ## 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`, and `npm run build` pass. - [x] 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:25 +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#6252
No description provided.