mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-20 18:11:00 +00:00
feat(sub): add per-client subscription HWID limits (#5802)
* feat(sub): add per-client subscription HWID limits * fix(sub): address HWID review on shared subId and bulk create * fix(sub): store HWID devices by sub_id and drop anchor client workaround * fix(sub): restore UA auto-detect and HTML page routing in subs() The cherry-pick of the HWID gate onto main's refactored SUBController had dropped main's UA-based format auto-detection and sub-page handling from subs(). Restore those branches, slotting enforceHwid after the HTML page and before format detection so the gate only applies to machine-readable subscription bodies. Also adapt tests to main's options-struct constructor and to the ClientService.Update signature extended with limitHwid. * fix(frontend): drop axios from HttpUtil.delete The bulk-delete rework's committed version still referenced axios, which this file no longer imports, breaking typecheck in CI. Use the httpRequest wrapper like the other verbs. --------- Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
@@ -283,6 +283,7 @@ export const EXAMPLES: Record<string, unknown> = {
|
||||
"group": "",
|
||||
"id": 0,
|
||||
"keepAlive": 0,
|
||||
"limitHwid": 0,
|
||||
"limitIp": 0,
|
||||
"password": "",
|
||||
"preSharedKey": "",
|
||||
|
||||
@@ -1199,6 +1199,9 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
"keepAlive": {
|
||||
"type": "integer"
|
||||
},
|
||||
"limitHwid": {
|
||||
"type": "integer"
|
||||
},
|
||||
"limitIp": {
|
||||
"type": "integer"
|
||||
},
|
||||
@@ -1256,6 +1259,7 @@ export const SCHEMAS: Record<string, unknown> = {
|
||||
"group",
|
||||
"id",
|
||||
"keepAlive",
|
||||
"limitHwid",
|
||||
"limitIp",
|
||||
"password",
|
||||
"preSharedKey",
|
||||
|
||||
@@ -294,6 +294,7 @@ export interface ClientRecord {
|
||||
group: string;
|
||||
id: number;
|
||||
keepAlive: number;
|
||||
limitHwid: number;
|
||||
limitIp: number;
|
||||
password: string;
|
||||
preSharedKey: string;
|
||||
|
||||
@@ -314,6 +314,7 @@ export const ClientRecordSchema = z.object({
|
||||
group: z.string(),
|
||||
id: z.number().int(),
|
||||
keepAlive: z.number().int(),
|
||||
limitHwid: z.number().int(),
|
||||
limitIp: z.number().int(),
|
||||
password: z.string(),
|
||||
preSharedKey: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user