mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
fix: 解决数据库上传备份恢复失败的问题 (#1027)
This commit is contained in:
parent
574a504ec3
commit
43652b2a54
@ -111,9 +111,9 @@ func (u *BackupService) DownloadRecord(info dto.DownloadRecord) (string, error)
|
|||||||
return "", fmt.Errorf("new cloud storage client failed, err: %v", err)
|
return "", fmt.Errorf("new cloud storage client failed, err: %v", err)
|
||||||
}
|
}
|
||||||
targetPath := fmt.Sprintf("%s/download/%s/%s", constant.DataDir, info.FileDir, info.FileName)
|
targetPath := fmt.Sprintf("%s/download/%s/%s", constant.DataDir, info.FileDir, info.FileName)
|
||||||
if _, err := os.Stat(path.Base(targetPath)); err != nil && os.IsNotExist(err) {
|
if _, err := os.Stat(path.Dir(targetPath)); err != nil && os.IsNotExist(err) {
|
||||||
if err = os.MkdirAll(path.Base(targetPath), os.ModePerm); err != nil {
|
if err = os.MkdirAll(path.Dir(targetPath), os.ModePerm); err != nil {
|
||||||
global.LOG.Errorf("mkdir %s failed, err: %v", path.Base(targetPath), err)
|
global.LOG.Errorf("mkdir %s failed, err: %v", path.Dir(targetPath), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
srcPath := fmt.Sprintf("%s/%s", info.FileDir, info.FileName)
|
srcPath := fmt.Sprintf("%s/%s", info.FileDir, info.FileName)
|
||||||
|
@ -257,6 +257,9 @@ func (u *MysqlService) ChangeAccess(info dto.ChangeDBInfo) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if info.Value == mysql.Permission {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
app, err := appInstallRepo.LoadBaseInfo("mysql", "")
|
app, err := appInstallRepo.LoadBaseInfo("mysql", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -149,6 +149,7 @@ const search = async () => {
|
|||||||
|
|
||||||
const onRecover = async (row: File.File) => {
|
const onRecover = async (row: File.File) => {
|
||||||
let params = {
|
let params = {
|
||||||
|
source: 'LOCAL',
|
||||||
type: type.value,
|
type: type.value,
|
||||||
name: name.value,
|
name: name.value,
|
||||||
detailName: detailName.value,
|
detailName: detailName.value,
|
||||||
|
@ -201,6 +201,7 @@ const onBackup = async () => {
|
|||||||
};
|
};
|
||||||
const onRecover = async () => {
|
const onRecover = async () => {
|
||||||
let param = {
|
let param = {
|
||||||
|
source: currentRow.value.source,
|
||||||
type: 'redis',
|
type: 'redis',
|
||||||
name: '',
|
name: '',
|
||||||
detailName: '',
|
detailName: '',
|
||||||
|
Loading…
Reference in New Issue
Block a user