From 0ec65c3e24190b879739da554fc4bece6242459c Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Thu, 2 Mar 2023 15:46:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20OpenResty=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/global/form-rules.ts | 11 +++++++++ frontend/src/lang/modules/en.ts | 2 ++ frontend/src/lang/modules/zh.ts | 1 + .../website/nginx/performance/index.vue | 24 +++++++++++-------- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index ec40c6915..44ffdaee5 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -186,6 +186,17 @@ const checkParamUrlAndPort = (rule: any, value: any, callback: any) => { } }; +export function checkNumberRange(min: number, max: number): FormItemRule { + return { + required: true, + trigger: 'blur', + min: min, + max: max, + type: 'number', + message: i18n.global.t('commons.rule.numberRange', [min, max]), + }; +} + interface CommonRule { requiredInput: FormItemRule; requiredSelect: FormItemRule; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index b784d02ef..237f4b45d 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -136,8 +136,10 @@ export default { domain: 'domain name format error', databaseName: 'Support English, numbers, _, length 1-30', ipErr: 'IP [{0}] format error, please check', + numberRange: 'Number range: {0} - {1}', paramName: 'Support English, numbers, .- and _, length 2-30', paramComplexity: 'Support English, numbers, {0}, length 6-30', + paramUrlAndPort: 'The format is http(s)://(domain name/ip):(port)', }, res: { paramError: 'The request failed, please try again later!', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 3d02b3bb9..23e998944 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -141,6 +141,7 @@ export default { domain: '域名格式错误', databaseName: '支持英文、数字、_,长度1-30', ipErr: 'IP [{0}] 格式错误,请检查', + numberRange: '数字范围: {0} - {1}', paramName: '支持英文、数字、.-和_,长度2-30', paramComplexity: '支持英文、数字、{0},长度6-30', paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)', diff --git a/frontend/src/views/website/website/nginx/performance/index.vue b/frontend/src/views/website/website/nginx/performance/index.vue index d2e67e5e0..c160d9574 100644 --- a/frontend/src/views/website/website/nginx/performance/index.vue +++ b/frontend/src/views/website/website/nginx/performance/index.vue @@ -5,23 +5,27 @@
- + {{ $t('nginx.serverNamesHashBucketSizeHelper') }} - + {{ $t('nginx.clientHeaderBufferSizeHelper') }} - + {{ $t('nginx.clientMaxBodySizeHelper') }} - + {{ $t('nginx.keepaliveTimeoutHelper') }} @@ -57,7 +61,7 @@