mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5533] [Feature]: Centralized Links Management and Bulk Assignment to Clients #3862
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#3862
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?
Originally created by @saeedhasani on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5533
Is your feature request related to a problem?
The new External Links / External Subscriptions feature introduced in v3.4.0 is very useful, but currently links can only be added individually inside each client.
For small deployments this is acceptable, but for larger panels with hundreds or thousands of users it becomes extremely difficult to manage.
A common use case is adding:
Currently administrators must manually open every client and add the same link repeatedly.
This does not scale and makes maintenance difficult.
Describe the solution you'd like
Introduce a dedicated Links section in the sidebar, similar to how Inbounds are managed.
Example:
Sidebar
Inside the Links section, administrators can:
After creating a link, it should be possible to assign it to multiple clients at once, similar to the current inbound assignment workflow.
Example Workflow
If the administrator later updates the link, all assigned clients automatically receive the updated version.
Benefits
Additional Suggestion
It would be useful if Links could support:
This would make link management much easier for large-scale installations.
Thank you for your great work on 3x-ui.
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 24, 2026):
The feature request is well-understood and technically sound. Here is a precise summary of what currently exists and what an implementation would need to add, to help you scope the PR.
Current architecture (confirmed in source)
External links are modeled in
internal/database/model/model.goasClientExternalLink, a table with a directClientIdforeign key:There is no global link entity and no many-to-many relationship. The service layer (
internal/web/service/client_external_link.go) operates exclusively on a single client at a time viaSetExternalLinksByEmail/GetExternalLinksForRecord. The subscription generator (internal/sub/external_config.go) queries byclient_idas well.What a centralized links implementation would need to touch
Database (
internal/database/model/model.go,internal/database/db.go): A new globalExternalLinktable (id, kind, value, remark, enabled, …) and a join table (e.g.client_link_assignments) linking it to one or more clients. The existing per-clientclient_external_linkstable could remain for backwards compatibility, or be migrated.Service layer (
internal/web/service/): New service file for CRUD on global links and for bulk assignment. The bulk-assign operation would need to be transactional, inserting or upserting rows into the join table for each selected client.Controller / API (
internal/web/controller/): New REST endpoints for global link CRUD and bulk assignment. The existingPOST /panel/api/clients/:email/externalLinksendpoint is per-client and would be unaffected.Subscription generator (
internal/sub/external_config.go):getClientExternalLinksBySubIdqueriesclient_external_linksbyclient_id. It would need to also join againstclient_link_assignments→external_linksto include globally-assigned links.Frontend (
frontend/src/): A new sidebar entry, page, and form components for global link management, plus multi-select client assignment UI (similar in shape to how inbound assignment works). The existing Links tab insideClientFormModal.tsx(lines 743–792) would be unaffected for per-client overrides.OpenAPI spec: The generator in
tools/openapigen/would pick up new endpoints automatically once the controller routes are registered; re-running the generator and committing the updatedinternal/web/dist/openapi.jsonis part of the build.Scope note
The additional metadata you suggested (tags, categories, enable/disable, usage count) is straightforward to add to the global
ExternalLinkmodel, and the enabled flag in particular is worth including from the start because the subscription generator would need to respect it.If you open a PR, it would be worth proposing the schema in the PR description first so the data model can be reviewed before the full implementation is built on top of it.
This comment was generated automatically; a maintainer may follow up.