mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6237] [Feature]: Add client autocomplete/browser to routing rule fields #4234
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#4234
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 @neerro on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6237
Is your feature request related to a problem?
The recently merged pull request (#6165) introduced a fantastic "category browser" for geosite and geoip databases, which solves the problem of having to remember and type category names from memory for routing rules.
However, this problem also exists for Client fields. In many routing rules, such as those that route traffic to or from specific clients (e.g., in "outbound" or "fallback" rules), we need to specify a client by their email or ID.
Currently, the user must type the client identifier manually. This is error-prone and inconvenient, especially when a panel has many clients. A typo here means the rule will not apply to the intended client, and the panel provides no immediate feedback or help to prevent this.
Describe the solution you'd like
I would like to see the same pattern used in the source-IP, IP, and domain fields (#6165) applied to any field in the rule form that expects a client identifier (usually email).
Specifically, I propose that for client selection fields in the routing form:
Why this is important
This enhancement would bring a consistent UX to the routing rules panel, making it much more user-friendly. It eliminates guesswork, reduces errors, and makes the panel more accessible, especially for users managing complex routing configurations with many clients.
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
Which parts of the panel would this affect?
Frontend (UI / panel pages)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Aug 17, 2026):
The request is accurate about the current state of the form, and most of what it asks for can be built without the new backend endpoint you propose.
Confirmed in the source:
frontend/src/pages/xray/routing/RuleFormModal.tsx, theipfield (line 257) and thedomainfield (line 268) render<GeoTokenInput>, while theuserfield (lines 271-280) is a plain<Input placeholder="email address" />. The inconsistency you describe is real.inboundTag,outboundTagandbalancerTagfields in that same form (lines 293-313) are already<Select>s populated from existing panel data, so a data-driven picker here follows an established pattern.On the proposed
/panel/api/xray/clientsendpoint, that data is already served:GET /panel/api/clients/listis registered atinternal/web/controller/client.go:48and returns every client withemail,group,enableandinboundIds.GET /panel/api/clients/list/pagedsits next to it (client.go:49) and acceptssearchandfilterquery params, which is the better source for a panel with many clients.frontend/src/pages/inbounds/clients/AttachExistingClientsModal.tsx:58already consumes/panel/api/clients/listto render close to the UI you describe: a searchable, group-filterable, multi-select client table. A routing-rule picker could reuse that shape instead of adding an endpoint.The validation half is also well-defined.
ClientRecord.Emailis unique panel-wide (gorm:"uniqueIndex;not null",internal/database/model/model.go:903), and the email written into an inbound'ssettings.clientsis the identity key Xray itself sees (splitSettingsClients,internal/xray/hot_diff.go:211-213). So "does this typed string match an existing client" has an exact answer, and it can be answered in the browser from the already-fetched list, with no server round-trip. Geodata validation needs one (GeoTokenInput.tsx:41, debounced 600 ms at line 14), which is why the two cases are not symmetric.Two points worth settling before any implementation:
GeoTokenInputthrough atypeprop, as suggested, would mix an unrelated data source and a different validation path into a component that is currently geodata-specific: it hardcodesGeoBrowserModaland the geodata warning keys (GeoTokenInput.tsx:18-24and104-113). A separate small component reusing the sameaddonAfterdatabase-button pattern may stay cleaner. That is a maintainer call.mtg-multiprocess outside Xray (internal/mtproto/), so a client that exists only on an MTProto inbound would never be matched by auserrule. Whether the picker filters or marks those is worth deciding up front. This second point is inferred from the process architecture, not from a specific matching routine I read.I found no existing issue requesting this, so it stays open with the
enhancementlabel as filed.@MHSanaei for a decision on whether to take this, and on which of the two component shapes above to prefer.
This reply was generated automatically; a maintainer may follow up.
@neerro commented on GitHub (Aug 17, 2026):
I'd like to expand this. The panel recently introduced the Group feature, which allows organizing users by themes or categories. This is extremely useful for administrators.
Therefore, I propose we go a step further and add the ability to select not only clients but also client groups in the routing rule form.
Here's how I envision this working:
User Group, appears in the routing rule form.GeoTokenInputcomponent introduced in #6165.emaillevel, this likely means the rule should expand to a list ofuseremails belonging to the selected groups.Why this is beneficial:
I believe this would become a highly valued feature for administrators managing large user bases.