mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
fix: 解决计划任务备份下载路径错误的问题 (#3743)
This commit is contained in:
parent
e309b9c030
commit
8b0d73b5d5
@ -43,15 +43,15 @@ func (u *CronjobService) handleApp(cronjob model.Cronjob, startTime time.Time) e
|
||||
if err := handleAppBackup(&app, backupDir, record.FileName); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := backupRepo.CreateRecord(&record); err != nil {
|
||||
global.LOG.Errorf("save backup record failed, err: %v", err)
|
||||
return err
|
||||
}
|
||||
downloadPath, err := u.uploadCronjobBackFile(cronjob, accountMap, path.Join(backupDir, record.FileName))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
record.FileDir = path.Dir(downloadPath)
|
||||
if err := backupRepo.CreateRecord(&record); err != nil {
|
||||
global.LOG.Errorf("save backup record failed, err: %v", err)
|
||||
return err
|
||||
}
|
||||
u.removeExpiredBackup(cronjob, accountMap, record)
|
||||
}
|
||||
return nil
|
||||
@ -121,7 +121,6 @@ func (u *CronjobService) handleDatabase(cronjob model.Cronjob, startTime time.Ti
|
||||
return err
|
||||
}
|
||||
record.FileDir = path.Dir(downloadPath)
|
||||
|
||||
if err := backupRepo.CreateRecord(&record); err != nil {
|
||||
global.LOG.Errorf("save backup record failed, err: %v", err)
|
||||
return err
|
||||
@ -153,7 +152,6 @@ func (u *CronjobService) handleDirectory(cronjob model.Cronjob, startTime time.T
|
||||
}
|
||||
record.FileDir = path.Dir(downloadPath)
|
||||
record.FileName = fileName
|
||||
|
||||
if err := backupRepo.CreateRecord(&record); err != nil {
|
||||
global.LOG.Errorf("save backup record failed, err: %v", err)
|
||||
return err
|
||||
@ -184,7 +182,6 @@ func (u *CronjobService) handleSystemLog(cronjob model.Cronjob, startTime time.T
|
||||
}
|
||||
record.FileDir = path.Dir(downloadPath)
|
||||
record.FileName = fileName
|
||||
|
||||
if err := backupRepo.CreateRecord(&record); err != nil {
|
||||
global.LOG.Errorf("save backup record failed, err: %v", err)
|
||||
return err
|
||||
|
@ -253,7 +253,7 @@
|
||||
multiple
|
||||
class="selectClass"
|
||||
v-model="dialogData.rowData!.backupAccountList"
|
||||
@change="changeAccount"
|
||||
@change="changeAccount(true)"
|
||||
>
|
||||
<div v-for="item in backupOptions" :key="item.label">
|
||||
<el-option :value="item.value" :label="item.label" />
|
||||
@ -523,10 +523,10 @@ const loadBackups = async () => {
|
||||
}
|
||||
backupOptions.value.push({ label: i18n.global.t('setting.' + item.type), value: item.type });
|
||||
}
|
||||
changeAccount();
|
||||
changeAccount(false);
|
||||
};
|
||||
|
||||
const changeAccount = async () => {
|
||||
const changeAccount = async (handleChange: boolean) => {
|
||||
accountOptions.value = [];
|
||||
for (const item of backupOptions.value) {
|
||||
let exit = false;
|
||||
@ -540,6 +540,9 @@ const changeAccount = async () => {
|
||||
accountOptions.value.push(item);
|
||||
}
|
||||
}
|
||||
if (handleChange) {
|
||||
dialogData.value.rowData.defaultDownload = '';
|
||||
}
|
||||
};
|
||||
|
||||
const loadAppInstalls = async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user