mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6948] feat(clients): append external links in bulk adjustments #6534
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#6534
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/6948
Author: @HamedSanaei
Created: 10/26/2026
Status: 🔄 Open
Base:
main← Head:codex/bulk-append-external-links📝 Commits (2)
f57433ffeat(clients): append external links in bulk adjustments7147b77fix(clients): isolate bulk queries and surface link validation📊 Changes
41 files changed (+1900 additions, -365 deletions)
View changed files
📝
docs/content/docs/en/reference/api/clients.mdx(+26 -5)📝
docs/public/openapi.json(+159 -14)📝
frontend/public/openapi.json(+159 -14)📝
frontend/src/generated/examples.ts(+22 -0)📝
frontend/src/generated/schemas.ts(+101 -0)📝
frontend/src/generated/types.ts(+26 -0)📝
frontend/src/generated/zod.ts(+30 -0)📝
frontend/src/hooks/useClients.ts(+14 -9)📝
frontend/src/pages/api-docs/endpoints.ts(+42 -4)➕
frontend/src/pages/clients/ClientBulkAdjustModal.css(+4 -0)➕
frontend/src/pages/clients/ClientBulkAdjustModal.stories.tsx(+64 -0)📝
frontend/src/pages/clients/ClientBulkAdjustModal.tsx(+134 -64)➕
frontend/src/pages/clients/ClientExternalLinksFields.tsx(+171 -0)📝
frontend/src/pages/clients/ClientFormModal.tsx(+21 -205)📝
frontend/src/pages/clients/ClientsPage.tsx(+2 -1)📝
frontend/src/schemas/client.ts(+3 -0)➕
frontend/src/schemas/external-link.ts(+58 -0)➕
frontend/src/test/client-bulk-external-links.test.tsx(+180 -0)📝
internal/web/controller/client.go(+19 -7)➕
internal/web/controller/client_bulk_external_link_test.go(+96 -0)...and 21 more files
📄 Description
Summary
Clients → Bulk Adjust currently cannot add external links or subscriptions to a selection. Add an Append external links mode that reuses the client editor's Link/Subscription fields and appends to the existing per-client lists, preserving existing entries, metadata, and order. Invalid rows display inline feedback; the single-client editor opens its Links tab before an invalid entry can be saved.
Why
Closes #6816.
A separate append mode gives link additions a single transaction without mixing them with quota or runtime adjustments. The existing limits/settings mode keeps its behavior. The implementation uses the existing client external-link model and
normalizeExternalLinks, with batched reads/inserts and per-client(kind, value)duplicate detection.The closed #5625/#6571 reviews informed the batching, metadata preservation, optional-field documentation, and complete locale/codegen updates.
Type of change
Areas affected
How was this tested?
externalLinksand reported “no adjustment specified”; the component regression failed on the absent append tab.make verifypassed, including 217 frontend test files / 2,026 tests and the Go/frontend/Storybook builds.make race: the initial full local run passed. The final local rerun passed the changed service package but hit the unchanged Discord heartbeat flood test with a broken pipe; that package passed when rerun alone with the same shuffle seed. The final commit also passed the full CI race job.make gen-check docs-openapi-checkpassed. Documentation typecheck, lint, format check, and all 112 tests passed.Local gates ran in a Linux checkout whose changed files matched the working checkout byte for byte.
Screenshots / recordings
Mobile (390 px)
Breaking changes
None. API callers use
externalLinksonPOST /panel/api/clients/bulkAdjustseparately from other adjustments. The response reports added/duplicate row counts, missing-client errors, and the number of clients receiving additions. Append requests do not restart Xray.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.