fix: mysql 数据库命名规则调整

This commit is contained in:
ssongliu 2022-12-26 16:15:42 +08:00 committed by ssongliu
parent cfeb158d0a
commit cecfecfe94
4 changed files with 11 additions and 4 deletions

View file

@ -495,7 +495,14 @@ func updateInstallInfoInDB(appKey, appName, param string, isRestart bool, value
"param": strings.ReplaceAll(appInstall.Param, oldVal, newVal),
"env": strings.ReplaceAll(appInstall.Env, oldVal, newVal),
}, commonRepo.WithByID(appInstall.ID))
}
if param == "user-password" {
oldVal = fmt.Sprintf("\"PANEL_DB_USER_PASSWORD\":\"%v\"", appInstall.Password)
newVal = fmt.Sprintf("\"PANEL_DB_USER_PASSWORD\":\"%v\"", value)
_ = appInstallRepo.BatchUpdateBy(map[string]interface{}{
"param": strings.ReplaceAll(appInstall.Param, oldVal, newVal),
"env": strings.ReplaceAll(appInstall.Env, oldVal, newVal),
}, commonRepo.WithByID(appInstall.ID))
}
if param == "port" {
oldVal = fmt.Sprintf("\"PANEL_APP_PORT_HTTP\":%v", appInstall.Port)

View file

@ -58,7 +58,7 @@ const checkDBName = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) {
callback(new Error(i18n.global.t('commons.rule.dbName')));
} else {
const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9_.-]{0,30}$/;
const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,16}$/;
if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.dbName')));
} else {

View file

@ -104,7 +104,7 @@ export default {
requiredSelect: 'Please select the required fields',
commonName: 'Support English, Chinese, numbers, .-, and _ length 1-30',
simpleName: 'Support English, numbers and _ length 1-30',
dbName: 'Support English, numbers, .-, and _ length 1-30',
dbName: 'Support English, Chinese, numbers, .-, and _ length 1-16',
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',

View file

@ -104,7 +104,7 @@ export default {
requiredSelect: '请选择必选项',
commonName: '支持英文中文数字.-和_,长度1-30',
simpleName: '支持英文数字_,长度1-30',
dbName: '支持英文数字:.-_,长度1-30',
dbName: '支持英文中文数字.-_,长度1-16',
imageName: '支持英文中文数字:.-_,长度1-30',
complexityPassword: '请输入 8 位以上必须含有字母数字特殊符号的密码',
commonPassword: '请输入 6 位以上长度密码',