diff --git a/frontend/src/business/components/performance/test/EditPerformanceTestPlan.vue b/frontend/src/business/components/performance/test/EditPerformanceTestPlan.vue index 2f20972c6c..ecc3fa1dec 100644 --- a/frontend/src/business/components/performance/test/EditPerformanceTestPlan.vue +++ b/frontend/src/business/components/performance/test/EditPerformanceTestPlan.vue @@ -210,9 +210,13 @@ this.$router.push({path: '/performance/test/all'}) }, validTestPlan() { + let reg = /^[\u4e00-\u9fa5_a-zA-Z0-9\s.·-]+$/; if (!this.testPlan.name) { this.$error(this.$t('load_test.test_name_is_null')); return false; + } else if (!reg.test(this.testPlan.name)) { + this.$error(this.$t('load_test.special_characters_are_not_supported')); + return false; } if (!this.testPlan.projectId) { diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 359255d5a4..74c3a8e4f3 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -254,7 +254,8 @@ export default { 'select_resource_pool': 'Please Select Resource Pool', 'resource_pool_is_null': 'Resource Pool is empty', 'download_log_file': 'Download', - 'user_name': 'Creator' + 'user_name': 'Creator', + 'special_characters_are_not_supported': 'Test name does not support special characters', }, api_test: { creator: "Creator", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index e3d764f495..cc3d490d2d 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -252,7 +252,8 @@ export default { 'resource_pool_is_null': '资源池为空', 'download_log_file': '下载完整日志文件', 'pressure_prediction_chart': '压力预估图', - 'user_name': '创建人' + 'user_name': '创建人', + 'special_characters_are_not_supported': '测试名称不支持特殊字符', }, api_test: { creator: "创建人", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index c341132c82..2ff1e2058e 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -253,7 +253,8 @@ export default { 'resource_pool_is_null': '資源池為空', 'download_log_file': '下載完整日誌文件', 'pressure_prediction_chart': '壓力預估圖', - 'user_name': '創建人' + 'user_name': '創建人', + 'special_characters_are_not_supported': '測試名稱不支持特殊字符', }, api_test: { title: "測試",