mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-25 03:29:13 +08:00
fix: 解决数据库同步后备份路径错误的问题 (#1830)
This commit is contained in:
parent
d4e6232664
commit
80e845f320
@ -176,5 +176,6 @@ func handleMysqlRecover(req dto.CommonRecover, isRollback bool) error {
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
isOk = true
|
||||
return nil
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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 -_',
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user