feat: require confirmation before restoring backup (#4300)

#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

#### What this PR does / why we need it:

在恢复备份的界面,改为需要先点击开始恢复按钮再显示上传区域。

#### Which issue(s) this PR fixes:

Fixes #4295 

#### Does this PR introduce a user-facing change?

```release-note
None 
```
pull/4301/head^2
Ryan Wang 2023-07-26 14:44:23 +08:00 committed by GitHub
parent 25725e520e
commit a617ea164c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View File

@ -1013,6 +1013,7 @@ core:
first: 1. The restore process may last for a long time, please do not refresh the page during this period.
second: 2. During the restore process, although the existing data will not be cleaned up, if there is a conflict, the data will be overwritten.
third: 3. After the restore is completed, you will be prompted to stop running Halo, and you may need to run it manually after stopping.
start: Start restore
exception:
not_found:
message: Page not found

View File

@ -1013,6 +1013,7 @@ core:
first: 1. 恢复过程可能会持续较长时间,期间请勿刷新页面。
second: 2. 在恢复的过程中,虽然已有的数据不会被清理掉,但如果有冲突的数据将被覆盖。
third: 3. 恢复完成之后会提示停止运行 Halo停止之后可能需要手动运行。
start: 开始恢复
exception:
not_found:
message: 没有找到该页面

View File

@ -1013,6 +1013,7 @@ core:
first: 1. 還原過程可能需要較長時間,期間請勿重新整理頁面。
second: 2. 在還原過程中,雖然已有的資料不會被清除,但若有衝突的資料將被覆蓋。
third: 3. 還原完成後會提示停止運行 Halo停止後可能需要手動啟動。
start: 開始還原
exception:
not_found:
message: 沒有找到該頁面

View File

@ -1,6 +1,6 @@
<script lang="ts" setup>
import UppyUpload from "@/components/upload/UppyUpload.vue";
import { Dialog, Toast, VAlert, VLoading } from "@halo-dev/components";
import { Dialog, Toast, VAlert, VButton, VLoading } from "@halo-dev/components";
import { useQuery } from "@tanstack/vue-query";
import axios from "axios";
import { computed } from "vue";
@ -10,6 +10,7 @@ import { useI18n } from "vue-i18n";
const { t } = useI18n();
const complete = ref(false);
const showUploader = ref(false);
const onUploaded = () => {
Dialog.success({
@ -64,9 +65,14 @@ useQuery({
</li>
</ul>
</template>
<template v-if="!showUploader" #actions>
<VButton @click="showUploader = true">
{{ $t("core.backup.restore.start") }}
</VButton>
</template>
</VAlert>
</div>
<div class="flex items-center justify-center px-4 py-3">
<div v-if="showUploader" class="flex items-center justify-center px-4 py-3">
<UppyUpload
:restrictions="{
maxNumberOfFiles: 1,