Skip to content

Commit

Permalink
feat: Update Application Name Restrictions (#7706)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Jan 13, 2025
1 parent 539addc commit 4dee4e1
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion frontend/src/global/form-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ const checkAppName = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) {
callback(new Error(i18n.global.t('commons.rule.appName')));
} else {
const reg = /^(?![_-])[a-zA-Z0-9_-]{1,29}[a-zA-Z0-9]$/;
const reg = /^(?![_-])[a-z0-9_-]{1,29}[a-zA-Z0-9]$/;
if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.appName')));
} else {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const message = {
paramComplexity: `This field mustn't start and end with special characters and must consist of English, numbers, "{0}" characters with a length of 6-128.`,
paramUrlAndPort: 'This field must be in the format of "http(s)://(domain name/ip):(port)".',
nginxDoc: 'This field must consist of English, numbers and "." characters.',
appName: `This field mustn't start and end with "-" and "_" characters and must consist of English, numbers, "-", and "_" characters with a length of 2-30.`,
appName: 'Supports lowercase letters, numbers, -, and _, length 2-30, and cannot start or end with - or _',
containerName: 'Supports letters, numbers, -, _ and .; cannot start with - _ or .; length: 2-128',
mirror: 'The mirror acceleration address should start with http(s)://, support English letters (both uppercase and lowercase), numbers, . / and -, and should not contain blank lines.',
disableFunction: 'Only support letters ,underscores,and,',
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ const message = {
paramUrlAndPort:
'このフィールドは、「https)://(domain name/ip):(ポート)」の形式でなければなりません。',
nginxDoc: 'このフィールドは英語数字、「」で構成されている必要があります文字。',
appName: `このフィールドは、「 - 」と「_」文字で開始および終了してはなりません。英語、数字、 "、および「_」文字で2〜30の文字で構成されている必要があります。`,
appName:
'小文字の英字数字-および_をサポートし長さは230-または_で始まったり終わったりすることはできません',
containerName: '文数字-_および。;- _またはで始めることはできません長さ:2-128',
mirror: 'ミラーアクセラレーションアドレスはhttps)://、英語の文字(大文字と小文字の両方)、数字をサポートする必要があります。/および - 、そして空白の行を含めてはなりません。',
disableFunction: 'サポートレターアンダースコアおよび',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const message = {
paramUrlAndPort: 'Ruangan ini mesti dalam format "http(s)://(nama domain/IP):(port)".',
nginxDoc: 'Ruangan ini mesti terdiri daripada aksara rumi, nombor, dan ".".',
appName:
'Ruangan ini tidak boleh bermula atau berakhir dengan "-" dan "_" dan mesti terdiri daripada aksara rumi, nombor, "-", dan "_" dengan panjang 2-30 aksara.',
'Menyokong huruf kecil, nombor, -, dan _, panjang 2-30, dan tidak boleh bermula atau berakhir dengan - atau _',
containerName:
'Menyokong huruf, nombor, -, _ dan .; tidak boleh bermula dengan -, _ atau .; panjang: 2-128 aksara.',
mirror: 'Alamat pecutan cermin mesti bermula dengan http(s)://, menyokong huruf (huruf besar dan kecil), nombor, ., / dan -, serta tidak boleh mengandungi baris kosong.',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const message = {
paramUrlAndPort: 'Este campo deve estar no formato "http(s)://(nome do domínio/IP):(porta)".',
nginxDoc: 'Este campo deve conter letras, números e ".".',
appName:
'Este campo não deve começar ou terminar com "-" ou "_" e deve conter letras, números, "-", e "_" com comprimento de 2-30.',
'Suporta letras minúsculas, números, - e _, comprimento de 2 a 30, e não pode começar ou terminar com - ou _',
containerName:
'Suporta letras, números, "-", "_" e "."; não pode começar com "-", "_" ou "."; comprimento: 2-128.',
mirror: 'O endereço de aceleração do mirror deve começar com http(s)://, suportar letras (maiúsculas e minúsculas), números, ".", "/" e "-", e não deve conter linhas em branco.',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const message = {
paramUrlAndPort: 'Это поле должно быть в формате "http(s)://(доменное имя/ip):(порт)".',
nginxDoc: 'Это поле должно состоять из английских букв, цифр и ".".',
appName:
'Это поле не должно начинаться и заканчиваться символами "-" и "_" и должно состоять из английских букв, цифр, "-" и "_" длиной 2-30.',
'Поддерживает строчные буквы, цифры, - и _, длина 2-30, и не может начинаться или заканчиваться на - или _',
containerName: 'Поддерживаются буквы, цифры, -, _ и .; не может начинаться с - _ или .; длина: 2-128',
mirror: 'Адрес ускорения зеркала должен начинаться с http(s)://, поддерживает английские буквы (как заглавные, так и строчные), цифры, . / и -, и не должен содержать пустых строк.',
disableFunction: 'Поддерживаются только буквы, подчеркивания и запятые',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const message = {
paramComplexity: '支援英文數字、{0},長度6-128特殊字元不能在首尾',
paramUrlAndPort: '格式為 http(s)://(域名/ip):(埠)',
nginxDoc: '僅支援英文大小寫數字,和.',
appName: '援英文數字-和_,長度2-30,並且不能以-_開頭和結尾',
appName: '援小寫英文數字-和_,長度2-30,並且不能以-_開頭和結尾',
containerName: '支援字母數字、_-.,不能以-_或.開頭,長度2-128',
mirror: '支援以 http(s):// 開頭,英文大小寫,數字,. / 和 - 的鏡像加速地址,且不能有空行',
disableFunction: '僅支援字母下劃線和,',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const message = {
paramComplexity: '支持英文数字、{0},长度6-128特殊字符不能在首尾',
paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)',
nginxDoc: '仅支持英文大小写数字,和.',
appName: '持英文数字-和_,长度2-30,并且不能以-_开头和结尾',
appName: '持小写英文数字-和_,长度2-30,并且不能以-_开头和结尾',
containerName: '支持字母数字、_-.,不能以-_或.开头,长度2-128',
mirror: '支持以 http(s):// 开头,英文大小写,数字,. / 和 - 的镜像加速地址,且不能有空行',
disableFunction: '仅支持字母下划线和,',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/app-store/detail/install/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const installData = ref<InstallProps>({
});
const open = ref(false);
const rules = ref<FormRules>({
name: [Rules.paramSimple],
name: [Rules.appName],
params: [],
version: [Rules.requiredSelect],
containerName: [Rules.containerName],
Expand Down

0 comments on commit 4dee4e1

Please sign in to comment.