1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 22:18:07 +08:00

fix: 解决 PostgreSQL 上传恢复报错的问题 (#3560)

This commit is contained in:
ssongliu 2024-01-10 16:45:43 +08:00 committed by GitHub
parent 3ffae2a9d4
commit 4591e44a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,11 @@
:stroke-width="12" :stroke-width="12"
:percentage="uploadPercent" :percentage="uploadPercent"
></el-progress> ></el-progress>
<div v-if="type === 'mysql'" style="width: 80%" class="el-upload__tip"> <div
v-if="type === 'mysql' || type === 'mariadb' || type === 'postgresql'"
style="width: 80%"
class="el-upload__tip"
>
<span class="input-help">{{ $t('database.supportUpType') }}</span> <span class="input-help">{{ $t('database.supportUpType') }}</span>
<span class="input-help"> <span class="input-help">
{{ $t('database.zipFormat') }} {{ $t('database.zipFormat') }}
@ -130,20 +134,24 @@ const acceptParams = async (params: DialogProps): Promise<void> => {
remark.value = params.remark; remark.value = params.remark;
const pathRes = await loadBaseDir(); const pathRes = await loadBaseDir();
if (type.value === 'mysql') { switch (type.value) {
title.value = name.value + ' [ ' + detailName.value + ' ]'; case 'mysql':
} case 'mariadb':
if (type.value === 'website' || type.value === 'app') { case 'postgresql':
title.value = name.value; title.value = name.value + ' [ ' + detailName.value + ' ]';
} if (detailName.value) {
let dir = type.value === 'mysql' || type.value === 'mariadb' ? 'database/' + type.value : type.value; baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/${detailName.value}/`;
if (detailName.value) { } else {
baseDir.value = `${pathRes.data}/uploads/${dir}/${name.value}/${detailName.value}/`; baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/`;
} else { }
baseDir.value = `${pathRes.data}/uploads/${dir}/${name.value}/`; break;
} case 'website':
if (type.value === 'website') { title.value = name.value;
baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${detailName.value}/`; baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${detailName.value}/`;
break;
case 'app':
title.value = name.value;
baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/`;
} }
upVisible.value = true; upVisible.value = true;
search(); search();