mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-06 21:25:04 +03:00
feat(clients): bind host rules to individual clients in subscriptions (#6620)
Host rules applied per inbound only, so every client of an inbound got the same subscription endpoints (#6618). A client can now be bound to one or more host rules, and its raw, JSON and Clash subscriptions render only those hosts, in either subscription order; an unbound client is unchanged. A binding whose hosts are deleted, disabled or excluded from the format fails closed: the client gets no links there but stays in traffic accounting. Host edits keep row ids, so bindings survive them; nil leaves a stored binding alone and an empty list clears it.
This commit is contained in:
@@ -32,6 +32,8 @@ export const ClientRecordSchema = z
|
||||
auth: z.string().optional(),
|
||||
flow: z.string().optional(),
|
||||
security: z.string().optional(),
|
||||
// Host rules the client is bound to; null/omitted preserves, empty clears.
|
||||
clientHostRuleIds: z.array(z.number().int()).nullable().optional(),
|
||||
totalGB: z.number().optional(),
|
||||
expiryTime: z.number().optional(),
|
||||
limitIp: z.number().optional(),
|
||||
@@ -324,6 +326,8 @@ export const ClientFormSchema = z.object({
|
||||
auth: z.string(),
|
||||
flow: z.string(),
|
||||
security: z.string(),
|
||||
// Host rules the client is bound to; null/omitted preserves, empty clears.
|
||||
clientHostRuleIds: z.array(z.number().int()).nullable().optional(),
|
||||
reverseTag: z.string(),
|
||||
totalGB: z.number().min(0),
|
||||
delayedStart: z.boolean(),
|
||||
|
||||
Reference in New Issue
Block a user