diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index 12396f308..a3428dc61 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -41,6 +41,19 @@ const checkName = (rule: any, value: any, callback: any) => { } }; +const checkImageName = (rule: any, value: any, callback: any) => { + if (value === '' || typeof value === 'undefined' || value == null) { + callback(new Error(i18n.global.t('commons.rule.commonName'))); + } else { + const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-z:A-Z0-9_.\u4e00-\u9fa5-]{0,30}$/; + if (!reg.test(value) && value !== '') { + callback(new Error(i18n.global.t('commons.rule.imageName'))); + } else { + callback(); + } + } +}; + const checkLinuxName = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { callback(new Error(i18n.global.t('commons.rule.linuxName'))); @@ -59,6 +72,7 @@ interface CommonRule { requiredSelect: FormItemRule; requiredSelectBusiness: FormItemRule; name: FormItemRule; + imageName: FormItemRule; linuxName: FormItemRule; password: FormItemRule; email: FormItemRule; @@ -86,6 +100,11 @@ export const Rules: CommonRule = { message: i18n.global.t('commons.rule.requiredSelect'), trigger: 'change', }, + imageName: { + required: true, + validator: checkImageName, + trigger: 'blur', + }, name: { required: true, validator: checkName, diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 24199388f..89d075f54 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -99,6 +99,7 @@ export default { requiredInput: 'Please enter the required fields', requiredSelect: 'Please select the required fields', commonName: 'Support English, Chinese, numbers, .-_, length 1-30', + imageName: 'Support English, Chinese, numbers, :.-_, length 1-30', complexityPassword: 'Please enter a password with more than 8 characters and must contain letters, digits, and special symbols', commonPassword: 'Please enter a password with more than 6 characters', @@ -636,6 +637,7 @@ export default { backup: 'Backup', noTypeForCreate: 'No backup type is currently created', serverDisk: 'Server disks', + currentPath: 'Current path', OSS: 'Ali OSS', S3: 'Amazon S3', backupAccount: 'Backup account', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 103012f12..9523e74c5 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -99,6 +99,7 @@ export default { requiredInput: '请填写必填项', requiredSelect: '请选择必选项', commonName: '支持英文、中文、数字、.-_,长度1-30', + imageName: '支持英文、中文、数字、:.-_,长度1-30', complexityPassword: '请输入 8 位以上、必须含有字母、数字、特殊符号的密码', commonPassword: '请输入 6 位以上长度密码', linuxName: '支持英文、数字、.-_,长度1-30', @@ -653,6 +654,7 @@ export default { backup: '备份', noTypeForCreate: '当前无可创建备份类型', serverDisk: '服务器磁盘', + currentPath: '当前路径', OSS: '阿里云 OSS', S3: '亚马逊 S3 云存储', backupAccount: '备份账号', diff --git a/frontend/src/views/container/image/build/index.vue b/frontend/src/views/container/image/build/index.vue index ed69fee26..9ebb123ea 100644 --- a/frontend/src/views/container/image/build/index.vue +++ b/frontend/src/views/container/image/build/index.vue @@ -47,7 +47,7 @@ placeholder="Wait for build output..." :indent-with-tab="true" :tabSize="4" - style="max-height: 500px" + style="max-height: 300px" :lineWrapping="true" :matchBrackets="true" theme="cobalt" @@ -100,7 +100,7 @@ const varifyPath = (rule: any, value: any, callback: any) => { callback(); }; const rules = reactive({ - name: [Rules.requiredInput, Rules.name], + name: [Rules.requiredInput, Rules.imageName], from: [Rules.requiredSelect], dockerfile: [Rules.requiredInput, { validator: varifyPath, trigger: 'change', required: true }], }); @@ -110,6 +110,7 @@ const acceptParams = async () => { form.dockerfile = ''; form.tagStr = ''; form.name = ''; + logInfo.value = ''; }; const emit = defineEmits<{ (e: 'search'): void }>(); diff --git a/frontend/src/views/host/terminal/command/index.vue b/frontend/src/views/host/terminal/command/index.vue index 52a08c1f8..f8cdb0e15 100644 --- a/frontend/src/views/host/terminal/command/index.vue +++ b/frontend/src/views/host/terminal/command/index.vue @@ -14,7 +14,7 @@ - + diff --git a/frontend/src/views/setting/index.vue b/frontend/src/views/setting/index.vue index f6b8e0a0b..e0b76428e 100644 --- a/frontend/src/views/setting/index.vue +++ b/frontend/src/views/setting/index.vue @@ -106,6 +106,12 @@ const SaveSetting = async (formEl: FormInstance | undefined, key: string, val: a globalStore.setThemeConfig({ ...themeConfig.value, theme: val }); switchDark(); break; + case 'SessionTimeout': + if (Number(val) < 300) { + ElMessage.error(i18n.t('setting.sessionTimeoutError')); + search(); + return; + } case 'PanelName': globalStore.setThemeConfig({ ...themeConfig.value, panelName: val }); break; diff --git a/frontend/src/views/setting/tabs/backup.vue b/frontend/src/views/setting/tabs/backup.vue index 95f1d842e..8d70cc650 100644 --- a/frontend/src/views/setting/tabs/backup.vue +++ b/frontend/src/views/setting/tabs/backup.vue @@ -17,14 +17,14 @@  {{ loadBackupName(item.type) }}
{{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }}
- + {{ item.varsJson['dir'] }} @@ -73,7 +73,7 @@ diff --git a/frontend/src/views/setting/tabs/panel.vue b/frontend/src/views/setting/tabs/panel.vue index d3886571e..adf6b03ca 100644 --- a/frontend/src/views/setting/tabs/panel.vue +++ b/frontend/src/views/setting/tabs/panel.vue @@ -95,7 +95,7 @@ @@ -199,11 +199,6 @@ const passForm = reactive({ retryPassword: '', }); -const sessionTimeoutRules = [ - Rules.number, - { min: 300, type: 'number', message: i18n.global.t('setting.sessionTimeoutError'), trigger: 'blur' }, -]; - interface Props { settingInfo: any; }