diff --git a/frontend/public/openapi.json b/frontend/public/openapi.json index 8336ebcdc..6ec0768f7 100644 --- a/frontend/public/openapi.json +++ b/frontend/public/openapi.json @@ -41,6 +41,9 @@ "externalTrafficInformURI": { "type": "string" }, + "ipLimitAllowlist": { + "type": "string" + }, "ldapAutoCreate": { "type": "boolean" }, @@ -374,6 +377,7 @@ "expireDiff", "externalTrafficInformEnable", "externalTrafficInformURI", + "ipLimitAllowlist", "ldapAutoCreate", "ldapAutoDelete", "ldapBaseDN", @@ -512,6 +516,9 @@ "hasWarpSecret": { "type": "boolean" }, + "ipLimitAllowlist": { + "type": "string" + }, "ldapAutoCreate": { "type": "boolean" }, @@ -852,6 +859,7 @@ "hasTgBotToken", "hasTwoFactorToken", "hasWarpSecret", + "ipLimitAllowlist", "ldapAutoCreate", "ldapAutoDelete", "ldapBaseDN", diff --git a/frontend/src/generated/examples.ts b/frontend/src/generated/examples.ts index 7b7535ae3..177392f52 100644 --- a/frontend/src/generated/examples.ts +++ b/frontend/src/generated/examples.ts @@ -5,6 +5,7 @@ export const EXAMPLES: Record = { "expireDiff": 0, "externalTrafficInformEnable": false, "externalTrafficInformURI": "", + "ipLimitAllowlist": "", "ldapAutoCreate": false, "ldapAutoDelete": false, "ldapBaseDN": "", @@ -117,6 +118,7 @@ export const EXAMPLES: Record = { "hasTgBotToken": false, "hasTwoFactorToken": false, "hasWarpSecret": false, + "ipLimitAllowlist": "", "ldapAutoCreate": false, "ldapAutoDelete": false, "ldapBaseDN": "", diff --git a/frontend/src/generated/schemas.ts b/frontend/src/generated/schemas.ts index f4a8ab819..df0763111 100644 --- a/frontend/src/generated/schemas.ts +++ b/frontend/src/generated/schemas.ts @@ -15,6 +15,9 @@ export const SCHEMAS: Record = { "externalTrafficInformURI": { "type": "string" }, + "ipLimitAllowlist": { + "type": "string" + }, "ldapAutoCreate": { "type": "boolean" }, @@ -348,6 +351,7 @@ export const SCHEMAS: Record = { "expireDiff", "externalTrafficInformEnable", "externalTrafficInformURI", + "ipLimitAllowlist", "ldapAutoCreate", "ldapAutoDelete", "ldapBaseDN", @@ -486,6 +490,9 @@ export const SCHEMAS: Record = { "hasWarpSecret": { "type": "boolean" }, + "ipLimitAllowlist": { + "type": "string" + }, "ldapAutoCreate": { "type": "boolean" }, @@ -826,6 +833,7 @@ export const SCHEMAS: Record = { "hasTgBotToken", "hasTwoFactorToken", "hasWarpSecret", + "ipLimitAllowlist", "ldapAutoCreate", "ldapAutoDelete", "ldapBaseDN", diff --git a/frontend/src/generated/types.ts b/frontend/src/generated/types.ts index 695bbc945..49b54e9d8 100644 --- a/frontend/src/generated/types.ts +++ b/frontend/src/generated/types.ts @@ -13,6 +13,7 @@ export interface AllSetting { expireDiff: number; externalTrafficInformEnable: boolean; externalTrafficInformURI: string; + ipLimitAllowlist: string; ldapAutoCreate: boolean; ldapAutoDelete: boolean; ldapBaseDN: string; @@ -126,6 +127,7 @@ export interface AllSettingView { hasTgBotToken: boolean; hasTwoFactorToken: boolean; hasWarpSecret: boolean; + ipLimitAllowlist: string; ldapAutoCreate: boolean; ldapAutoDelete: boolean; ldapBaseDN: string; diff --git a/frontend/src/generated/zod.ts b/frontend/src/generated/zod.ts index fe67d9b5d..4068b1e6a 100644 --- a/frontend/src/generated/zod.ts +++ b/frontend/src/generated/zod.ts @@ -29,6 +29,7 @@ export const AllSettingSchema = z.object({ expireDiff: z.number().int().min(0), externalTrafficInformEnable: z.boolean(), externalTrafficInformURI: z.string(), + ipLimitAllowlist: z.string(), ldapAutoCreate: z.boolean(), ldapAutoDelete: z.boolean(), ldapBaseDN: z.string(), @@ -143,6 +144,7 @@ export const AllSettingViewSchema = z.object({ hasTgBotToken: z.boolean(), hasTwoFactorToken: z.boolean(), hasWarpSecret: z.boolean(), + ipLimitAllowlist: z.string(), ldapAutoCreate: z.boolean(), ldapAutoDelete: z.boolean(), ldapBaseDN: z.string(), diff --git a/frontend/src/models/setting.ts b/frontend/src/models/setting.ts index fb607aefe..464aa0d52 100644 --- a/frontend/src/models/setting.ts +++ b/frontend/src/models/setting.ts @@ -9,6 +9,7 @@ export class AllSetting { webBasePath = '/'; sessionMaxAge = 360; trustedProxyCIDRs = '127.0.0.1/32,::1/128'; + ipLimitAllowlist = ''; panelOutbound = ''; pageSize = 25; expireDiff = 0; diff --git a/frontend/src/pages/settings/GeneralTab.tsx b/frontend/src/pages/settings/GeneralTab.tsx index a195692bb..b4d8eae20 100644 --- a/frontend/src/pages/settings/GeneralTab.tsx +++ b/frontend/src/pages/settings/GeneralTab.tsx @@ -191,6 +191,18 @@ export default function GeneralTab({ allSetting, updateSetting }: GeneralTabProp /> + + updateSetting({ ipLimitAllowlist: e.target.value })} + /> + +