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"
:percentage="uploadPercent"
></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.zipFormat') }}
@ -130,20 +134,24 @@ const acceptParams = async (params: DialogProps): Promise<void> => {
remark.value = params.remark;
const pathRes = await loadBaseDir();
if (type.value === 'mysql') {
title.value = name.value + ' [ ' + detailName.value + ' ]';
}
if (type.value === 'website' || type.value === 'app') {
title.value = name.value;
}
let dir = type.value === 'mysql' || type.value === 'mariadb' ? 'database/' + type.value : type.value;
if (detailName.value) {
baseDir.value = `${pathRes.data}/uploads/${dir}/${name.value}/${detailName.value}/`;
} else {
baseDir.value = `${pathRes.data}/uploads/${dir}/${name.value}/`;
}
if (type.value === 'website') {
baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${detailName.value}/`;
switch (type.value) {
case 'mysql':
case 'mariadb':
case 'postgresql':
title.value = name.value + ' [ ' + detailName.value + ' ]';
if (detailName.value) {
baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/${detailName.value}/`;
} else {
baseDir.value = `${pathRes.data}/uploads/database/${type.value}/${name.value}/`;
}
break;
case 'website':
title.value = name.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;
search();