mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-09 14:16:07 +00:00
feat(sub): per-inbound sort order for subscription links
Add a subSortIndex field to inbounds that controls the order of links in subscription output only: the raw sub body, the HTML sub page, and the JSON/Clash formats (all served from the same query). Lower values come first; ties keep id order. The panel inbound list is unaffected. The value is editable in the inbound form next to the share-address fields, propagates to nodes via wireInbound, and follows the usual node-sync rules (copied on import, mirrored while not dirty, never a structural change). Rescoped from #5214 by @Ponywka.
This commit is contained in:
@@ -292,6 +292,7 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"shareAddrStrategy": "node",
|
||||
"sniffing": null,
|
||||
"streamSettings": null,
|
||||
"subSortIndex": 1,
|
||||
"tag": "in-443-tcp",
|
||||
"total": 0,
|
||||
"trafficReset": "never",
|
||||
|
||||
@@ -1319,6 +1319,12 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
},
|
||||
"sniffing": {},
|
||||
"streamSettings": {},
|
||||
"subSortIndex": {
|
||||
"description": "1-based sort order of this inbound's links in subscription output only (lower first; ties by id)",
|
||||
"example": 1,
|
||||
"minimum": 1,
|
||||
"type": "integer"
|
||||
},
|
||||
"tag": {
|
||||
"example": "in-443-tcp",
|
||||
"type": "string"
|
||||
@@ -1359,6 +1365,7 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
"shareAddrStrategy",
|
||||
"sniffing",
|
||||
"streamSettings",
|
||||
"subSortIndex",
|
||||
"tag",
|
||||
"total",
|
||||
"trafficReset",
|
||||
|
||||
@@ -293,6 +293,7 @@ export interface Inbound {
|
||||
shareAddrStrategy: string;
|
||||
sniffing: unknown;
|
||||
streamSettings: unknown;
|
||||
subSortIndex: number;
|
||||
tag: string;
|
||||
total: number;
|
||||
trafficReset: string;
|
||||
|
||||
@@ -314,6 +314,7 @@ export const InboundSchema = z.object({
|
||||
shareAddrStrategy: z.enum(['node', 'listen', 'custom']),
|
||||
sniffing: z.unknown(),
|
||||
streamSettings: z.unknown(),
|
||||
subSortIndex: z.number().int().min(1),
|
||||
tag: z.string(),
|
||||
total: z.number().int(),
|
||||
trafficReset: z.enum(['never', 'hourly', 'daily', 'weekly', 'monthly']),
|
||||
|
||||
Reference in New Issue
Block a user