diff --git a/backend/app/service/backup_mysql.go b/backend/app/service/backup_mysql.go index 86270fd7a..4ddb26c48 100644 --- a/backend/app/service/backup_mysql.go +++ b/backend/app/service/backup_mysql.go @@ -176,5 +176,6 @@ func handleMysqlRecover(req dto.CommonRecover, isRollback bool) error { }); err != nil { return err } + isOk = true return nil } diff --git a/backend/app/service/database_mysql.go b/backend/app/service/database_mysql.go index 3735c0d32..ae5f0fcf8 100644 --- a/backend/app/service/database_mysql.go +++ b/backend/app/service/database_mysql.go @@ -143,6 +143,15 @@ func (u *MysqlService) LoadFromRemote(from string) error { return err } + mysqlName := from + if from == "local" { + app, err := appInstallRepo.LoadBaseInfo("mysql", "") + if err != nil { + return err + } + mysqlName = app.Name + } + databases, err := mysqlRepo.List(remoteDBRepo.WithByFrom(from)) if err != nil { return err @@ -164,6 +173,7 @@ func (u *MysqlService) LoadFromRemote(from string) error { if err := copier.Copy(&createItem, &data); err != nil { return errors.WithMessage(constant.ErrStructTransform, err.Error()) } + createItem.MysqlName = mysqlName if err := mysqlRepo.Create(context.Background(), &createItem); err != nil { return err } diff --git a/backend/utils/mysql/client/local.go b/backend/utils/mysql/client/local.go index dbf08075d..e14eb80c3 100644 --- a/backend/utils/mysql/client/local.go +++ b/backend/utils/mysql/client/local.go @@ -270,10 +270,9 @@ func (r *Local) SyncDB(version string) ([]SyncDBInfo, error) { continue } dataItem := SyncDBInfo{ - Name: parts[0], - From: r.From, - MysqlName: r.From, - Format: parts[1], + Name: parts[0], + From: r.From, + Format: parts[1], } userLines, err := r.ExecSQLForRows(fmt.Sprintf("SELECT USER,HOST FROM mysql.DB WHERE DB = '%s'", parts[0]), 300) if err != nil { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 0faf356c6..1a5a24f81 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -174,7 +174,7 @@ const message = { numberRange: 'Number range: {0} - {1}', paramName: 'Support English, numbers, .- and _, length 2-30', paramComplexity: - 'Support English, numbers, {0}, length 6-30,Special characters cannot be at the beginning and end', + 'Support English, numbers, {0}, length 6-128,Special characters cannot be at the beginning and end', paramUrlAndPort: 'The format is http(s)://(domain name/ip):(port)', nginxDoc: 'Only supports English case, numbers, and .', appName: 'Support English, numbers, - and _, length 2-30, and cannot start and end with -_', diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue index 96a1b73de..1d8080e99 100644 --- a/frontend/src/views/database/mysql/index.vue +++ b/frontend/src/views/database/mysql/index.vue @@ -464,7 +464,7 @@ const buttons = [ click: (row: Database.MysqlDBInfo) => { let params = { type: 'mysql', - name: mysqlName.value || row.name, + name: row.mysqlName, detailName: row.name, }; uploadRef.value!.acceptParams(params);