mirror of https://github.com/1Panel-dev/1Panel
fix: 解决快照上传失败的问题 (#2270)
parent
9837c60a88
commit
47cfa0c730
|
@ -194,7 +194,8 @@ func snapUpload(snap snapHelper, account string, file string) {
|
||||||
_ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"upload": err.Error()})
|
_ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"upload": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
target := path.Join(backup.BackupPath, "system_snapshot", path.Base(file))
|
target := path.Join(strings.TrimPrefix(backup.BackupPath, "/"), "system_snapshot", path.Base(file))
|
||||||
|
global.LOG.Debugf("start upload snapshot to %s, dir: %s", backup.Type, target)
|
||||||
if _, err := client.Upload(source, target); err != nil {
|
if _, err := client.Upload(source, target); err != nil {
|
||||||
snap.Status.Upload = err.Error()
|
snap.Status.Upload = err.Error()
|
||||||
_ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"upload": err.Error()})
|
_ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"upload": err.Error()})
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div>
|
||||||
<el-drawer v-model="drawerVisiable" size="30%">
|
<el-drawer v-model="drawerVisiable" size="30%">
|
||||||
<template #header>
|
<template #header>
|
||||||
<DrawerHeader :header="$t('setting.importSnapshot')" :back="handleClose" />
|
<DrawerHeader :header="$t('setting.importSnapshot')" :back="handleClose" />
|
||||||
</template>
|
</template>
|
||||||
<el-form ref="formRef" label-position="top" :model="form" :rules="rules">
|
<el-form ref="formRef" label-position="top" :model="form" :rules="rules" v-loading="loading">
|
||||||
<el-row type="flex" justify="center">
|
<el-row type="flex" justify="center">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item :label="$t('setting.backupAccount')" prop="from">
|
<el-form-item :label="$t('setting.backupAccount')" prop="from">
|
||||||
|
@ -101,13 +101,20 @@ const submitImport = async (formEl: FormInstance | undefined) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadBackups = async () => {
|
const loadBackups = async () => {
|
||||||
const res = await getBackupList();
|
loading.value = true;
|
||||||
|
await getBackupList()
|
||||||
|
.then((res) => {
|
||||||
|
loading.value = false;
|
||||||
backupOptions.value = [];
|
backupOptions.value = [];
|
||||||
for (const item of res.data) {
|
for (const item of res.data) {
|
||||||
if (item.type !== 'LOCAL' && item.id !== 0) {
|
if (item.type !== 'LOCAL' && item.id !== 0) {
|
||||||
backupOptions.value.push({ label: i18n.global.t('setting.' + item.type), value: item.type });
|
backupOptions.value.push({ label: i18n.global.t('setting.' + item.type), value: item.type });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadFiles = async () => {
|
const loadFiles = async () => {
|
||||||
|
|
Loading…
Reference in New Issue