Skip to content

Commit 7f78dd1

Browse files
fix: rename c_max_lifetime to h_max_reusable_secs in xmux settings
1 parent 886eb46 commit 7f78dd1

File tree

9 files changed

+44
-48
lines changed

9 files changed

+44
-48
lines changed

app/models/host.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class XMuxSettings(BaseModel):
6464
c_max_reuse_times: str | int | None = Field(
6565
None, pattern=r"^\d{1,16}(-\d{1,16})?$", serialization_alias="cMaxReuseTimes"
6666
)
67-
c_max_lifetime: str | int | None = Field(
68-
None, pattern=r"^\d{1,16}(-\d{1,16})?$", serialization_alias="cMaxLifetime"
67+
h_max_reusable_secs: str | int | None = Field(
68+
None, pattern=r"^\d{1,16}(-\d{1,16})?$", serialization_alias="hMaxReusableSecs"
6969
)
7070
h_max_request_times: str | int | None = Field(
7171
None, pattern=r"^\d{1,16}(-\d{1,16})?$", serialization_alias="hMaxRequestTimes"

app/operation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from datetime import datetime as dt, timedelta as td, timezone as tz
1+
from datetime import datetime as dt, timezone as tz
22
from enum import IntEnum
33

44
from fastapi import HTTPException

dashboard/public/statics/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@
775775
"maxConcurrency": "Max Concurrency",
776776
"maxConnections": "Max Connections",
777777
"cMaxReuseTimes": "Max Reuse Times",
778-
"cMaxLifetime": "Max Lifetime",
778+
"hMaxReusableSecs": "Max Reusable Seconds",
779779
"hMaxRequestTimes": "Max Request Times",
780780
"hKeepAlivePeriod": "Keep Alive Period",
781781
"downloadSettings": "Download Settings",

dashboard/public/statics/locales/fa.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@
655655
"maxConcurrency": "حداکثر همزمانی",
656656
"maxConnections": "حداکثر اتصالات",
657657
"cMaxReuseTimes": "حداکثر دفعات استفاده مجدد",
658-
"cMaxLifetime": "حداکثر طول عمر",
658+
"hMaxReusableSecs": "حداکثر زمان استفاده مجدد (ثانیه)",
659659
"hMaxRequestTimes": "حداکثر دفعات درخواست",
660660
"hKeepAlivePeriod": "دوره نگهداری اتصال",
661661
"downloadSettings": "تنظیمات دانلود",

dashboard/public/statics/locales/ru.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@
971971
"maxConcurrency": "Максимум параллельных",
972972
"maxConnections": "Максимум соединений",
973973
"cMaxReuseTimes": "Максимум повторных использований",
974-
"cMaxLifetime": "Максимальный срок службы",
974+
"hMaxReusableSecs": "Максимальное время повторного использования (сек)",
975975
"hMaxRequestTimes": "Максимум запросов",
976976
"hKeepAlivePeriod": "Период поддержания соединения",
977977
"downloadSettings": "Настройки загрузки",

dashboard/public/statics/locales/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@
10141014
"maxConcurrency": "最大并发数",
10151015
"maxConnections": "最大连接数",
10161016
"cMaxReuseTimes": "最大重用次数",
1017-
"cMaxLifetime": "最大生命周期",
1017+
"hMaxReusableSecs": "最大可复用秒数",
10181018
"hMaxRequestTimes": "最大请求次数",
10191019
"hKeepAlivePeriod": "保活周期",
10201020
"downloadSettings": "下载设置",

dashboard/src/components/dialogs/HostModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,10 +1323,10 @@ const HostModal: React.FC<HostModalProps> = ({ isDialogOpen, onOpenChange, onSub
13231323

13241324
<FormField
13251325
control={form.control}
1326-
name="transport_settings.xhttp_settings.xmux.c_max_lifetime"
1326+
name="transport_settings.xhttp_settings.xmux.h_max_reusable_secs"
13271327
render={({ field }) => (
13281328
<FormItem className="col-span-2 md:col-span-1">
1329-
<FormLabel>{t('hostsDialog.xhttp.cMaxLifetime')}</FormLabel>
1329+
<FormLabel>{t('hostsDialog.xhttp.hMaxReusableSecs')}</FormLabel>
13301330
<FormControl>
13311331
<Input {...field} value={field.value || ''} />
13321332
</FormControl>

dashboard/src/components/hosts/Hosts.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export interface HostFormValues {
107107
max_concurrency?: string
108108
max_connections?: string
109109
c_max_reuse_times?: string
110-
c_max_lifetime?: string
110+
h_max_reusable_secs?: string
111111
h_max_request_times?: string
112112
h_keep_alive_period?: number
113113
}
@@ -167,7 +167,7 @@ const transportSettingsSchema = z
167167
max_concurrency: z.string().nullish().optional(),
168168
max_connections: z.string().nullish().optional(),
169169
c_max_reuse_times: z.string().nullish().optional(),
170-
c_max_lifetime: z.string().nullish().optional(),
170+
h_max_reusable_secs: z.string().nullish().optional(),
171171
h_max_request_times: z.string().nullish().optional(),
172172
h_keep_alive_period: z.number().nullish().optional(),
173173
})
@@ -549,7 +549,7 @@ export default function Hosts({ data, onAddHost, isDialogOpen, onSubmit, editing
549549
max_concurrency: host.transport_settings.xhttp_settings.xmux.maxConcurrency ?? undefined,
550550
max_connections: host.transport_settings.xhttp_settings.xmux.maxConnections ?? undefined,
551551
c_max_reuse_times: host.transport_settings.xhttp_settings.xmux.cMaxReuseTimes ?? undefined,
552-
c_max_lifetime: host.transport_settings.xhttp_settings.xmux.cMaxLifetime ?? undefined,
552+
h_max_reusable_secs: host.transport_settings.xhttp_settings.xmux.hMaxReusableSecs ?? undefined,
553553
h_max_request_times: host.transport_settings.xhttp_settings.xmux.hMaxRequestTimes ?? undefined,
554554
h_keep_alive_period: host.transport_settings.xhttp_settings.xmux.hKeepAlivePeriod ?? undefined,
555555
}

dashboard/src/service/api/index.ts

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Do not edit manually.
44
* PasarGuardAPI
55
* Unified GUI Censorship Resistant Solution
6-
* OpenAPI spec version: 1.3.1
6+
* OpenAPI spec version: 1.3.2
77
*/
88
import { useMutation, useQuery } from '@tanstack/react-query'
99
import type {
@@ -227,7 +227,7 @@ export type XMuxSettingsOutputHKeepAlivePeriod = number | null
227227

228228
export type XMuxSettingsOutputHMaxRequestTimes = string | null
229229

230-
export type XMuxSettingsOutputCMaxLifetime = string | null
230+
export type XMuxSettingsOutputHMaxReusableSecs = string | null
231231

232232
export type XMuxSettingsOutputCMaxReuseTimes = string | null
233233

@@ -239,7 +239,7 @@ export interface XMuxSettingsOutput {
239239
maxConcurrency?: XMuxSettingsOutputMaxConcurrency
240240
maxConnections?: XMuxSettingsOutputMaxConnections
241241
cMaxReuseTimes?: XMuxSettingsOutputCMaxReuseTimes
242-
cMaxLifetime?: XMuxSettingsOutputCMaxLifetime
242+
hMaxReusableSecs?: XMuxSettingsOutputHMaxReusableSecs
243243
hMaxRequestTimes?: XMuxSettingsOutputHMaxRequestTimes
244244
hKeepAlivePeriod?: XMuxSettingsOutputHKeepAlivePeriod
245245
}
@@ -248,7 +248,7 @@ export type XMuxSettingsInputHKeepAlivePeriod = number | null
248248

249249
export type XMuxSettingsInputHMaxRequestTimes = string | number | null
250250

251-
export type XMuxSettingsInputCMaxLifetime = string | number | null
251+
export type XMuxSettingsInputHMaxReusableSecs = string | number | null
252252

253253
export type XMuxSettingsInputCMaxReuseTimes = string | number | null
254254

@@ -260,7 +260,7 @@ export interface XMuxSettingsInput {
260260
max_concurrency?: XMuxSettingsInputMaxConcurrency
261261
max_connections?: XMuxSettingsInputMaxConnections
262262
c_max_reuse_times?: XMuxSettingsInputCMaxReuseTimes
263-
c_max_lifetime?: XMuxSettingsInputCMaxLifetime
263+
h_max_reusable_secs?: XMuxSettingsInputHMaxReusableSecs
264264
h_max_request_times?: XMuxSettingsInputHMaxRequestTimes
265265
h_keep_alive_period?: XMuxSettingsInputHKeepAlivePeriod
266266
}
@@ -277,6 +277,16 @@ export type XHttpSettingsOutputXPaddingBytes = string | null
277277

278278
export type XHttpSettingsOutputNoGrpcHeader = boolean | null
279279

280+
export interface XHttpSettingsOutput {
281+
mode?: XHttpModes
282+
no_grpc_header?: XHttpSettingsOutputNoGrpcHeader
283+
x_padding_bytes?: XHttpSettingsOutputXPaddingBytes
284+
sc_max_each_post_bytes?: XHttpSettingsOutputScMaxEachPostBytes
285+
sc_min_posts_interval_ms?: XHttpSettingsOutputScMinPostsIntervalMs
286+
xmux?: XHttpSettingsOutputXmux
287+
download_settings?: XHttpSettingsOutputDownloadSettings
288+
}
289+
280290
export type XHttpSettingsInputDownloadSettings = number | null
281291

282292
export type XHttpSettingsInputXmux = XMuxSettingsInput | null
@@ -299,16 +309,6 @@ export const XHttpModes = {
299309
'stream-one': 'stream-one',
300310
} as const
301311

302-
export interface XHttpSettingsOutput {
303-
mode?: XHttpModes
304-
no_grpc_header?: XHttpSettingsOutputNoGrpcHeader
305-
x_padding_bytes?: XHttpSettingsOutputXPaddingBytes
306-
sc_max_each_post_bytes?: XHttpSettingsOutputScMaxEachPostBytes
307-
sc_min_posts_interval_ms?: XHttpSettingsOutputScMinPostsIntervalMs
308-
xmux?: XHttpSettingsOutputXmux
309-
download_settings?: XHttpSettingsOutputDownloadSettings
310-
}
311-
312312
export interface XHttpSettingsInput {
313313
mode?: XHttpModes
314314
no_grpc_header?: XHttpSettingsInputNoGrpcHeader
@@ -581,8 +581,6 @@ export type UserResponseOnHoldExpireDuration = number | null
581581

582582
export type UserResponseNote = string | null
583583

584-
export type UserResponseDataLimitResetStrategy = UserDataLimitResetStrategy | null
585-
586584
/**
587585
* data_limit can be 0 or greater
588586
*/
@@ -628,6 +626,8 @@ export type UserModifyOnHoldExpireDuration = number | null
628626

629627
export type UserModifyNote = string | null
630628

629+
export type UserModifyDataLimitResetStrategy = UserDataLimitResetStrategy | null
630+
631631
/**
632632
* data_limit can be 0 or greater
633633
*/
@@ -637,19 +637,6 @@ export type UserModifyExpire = string | number | null
637637

638638
export type UserModifyProxySettings = ProxyTableInput | null
639639

640-
export type UserDataLimitResetStrategy = (typeof UserDataLimitResetStrategy)[keyof typeof UserDataLimitResetStrategy]
641-
642-
// eslint-disable-next-line @typescript-eslint/no-redeclare
643-
export const UserDataLimitResetStrategy = {
644-
no_reset: 'no_reset',
645-
day: 'day',
646-
week: 'week',
647-
month: 'month',
648-
year: 'year',
649-
} as const
650-
651-
export type UserModifyDataLimitResetStrategy = UserDataLimitResetStrategy | null
652-
653640
export interface UserModify {
654641
proxy_settings?: UserModifyProxySettings
655642
expire?: UserModifyExpire
@@ -665,6 +652,19 @@ export interface UserModify {
665652
status?: UserModifyStatus
666653
}
667654

655+
export type UserDataLimitResetStrategy = (typeof UserDataLimitResetStrategy)[keyof typeof UserDataLimitResetStrategy]
656+
657+
// eslint-disable-next-line @typescript-eslint/no-redeclare
658+
export const UserDataLimitResetStrategy = {
659+
no_reset: 'no_reset',
660+
day: 'day',
661+
week: 'week',
662+
month: 'month',
663+
year: 'year',
664+
} as const
665+
666+
export type UserResponseDataLimitResetStrategy = UserDataLimitResetStrategy | null
667+
668668
export type UserCreateStatus = UserStatusCreate | null
669669

670670
export type UserCreateNextPlan = NextPlanModel | null
@@ -1443,19 +1443,15 @@ export interface General {
14431443

14441444
export type GRPCSettingsInitialWindowsSize = number | null
14451445

1446-
export type GRPCSettingsPermitWithoutStream = boolean | null
1447-
14481446
export type GRPCSettingsHealthCheckTimeout = number | null
14491447

14501448
export type GRPCSettingsIdleTimeout = number | null
14511449

1452-
export type GRPCSettingsMultiMode = boolean | null
1453-
14541450
export interface GRPCSettings {
1455-
multi_mode?: GRPCSettingsMultiMode
1451+
multi_mode?: boolean
14561452
idle_timeout?: GRPCSettingsIdleTimeout
14571453
health_check_timeout?: GRPCSettingsHealthCheckTimeout
1458-
permit_without_stream?: GRPCSettingsPermitWithoutStream
1454+
permit_without_stream?: boolean
14591455
initial_windows_size?: GRPCSettingsInitialWindowsSize
14601456
}
14611457

0 commit comments

Comments
 (0)