From a463f237b1ee7fe372e5b9367a7aadae7db8b328 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 6 Jul 2023 14:30:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E4=BF=AE=E6=94=B9=E5=A4=87=E4=BB=BD=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#1560?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/backup.go | 4 ++-- backend/app/dto/setting.go | 2 +- backend/app/service/backup.go | 1 + .../src/views/setting/backup-account/index.vue | 18 ++++++++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/backend/app/dto/backup.go b/backend/app/dto/backup.go index 90a543dc9..a3a2d0980 100644 --- a/backend/app/dto/backup.go +++ b/backend/app/dto/backup.go @@ -38,7 +38,7 @@ type CommonBackup struct { DetailName string `json:"detailName"` } type CommonRecover struct { - Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO"` + Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO OneDrive"` Type string `json:"type" validate:"required,oneof=app mysql redis website"` Name string `json:"name"` DetailName string `json:"detailName"` @@ -62,7 +62,7 @@ type BackupRecords struct { } type DownloadRecord struct { - Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO"` + Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO OneDrive"` FileDir string `json:"fileDir" validate:"required"` FileName string `json:"fileName" validate:"required"` } diff --git a/backend/app/dto/setting.go b/backend/app/dto/setting.go index 61f2f49dd..aa12157d9 100644 --- a/backend/app/dto/setting.go +++ b/backend/app/dto/setting.go @@ -76,7 +76,7 @@ type PortUpdate struct { } type SnapshotCreate struct { - From string `json:"from" validate:"required,oneof=OSS S3 SFTP MINIO COS KODO"` + From string `json:"from" validate:"required,oneof=OSS S3 SFTP MINIO COS KODO OneDrive"` Description string `json:"description" validate:"max=256"` } type SnapshotRecover struct { diff --git a/backend/app/service/backup.go b/backend/app/service/backup.go index bbbb86d85..fc576a442 100644 --- a/backend/app/service/backup.go +++ b/backend/app/service/backup.go @@ -238,6 +238,7 @@ func (u *BackupService) Update(req dto.BackupOperate) error { upMap := make(map[string]interface{}) upMap["bucket"] = req.Bucket upMap["credential"] = req.Credential + upMap["backup_path"] = req.BackupPath upMap["vars"] = req.Vars backup.Vars = req.Vars diff --git a/frontend/src/views/setting/backup-account/index.vue b/frontend/src/views/setting/backup-account/index.vue index f1d3f7984..3bcaf02f5 100644 --- a/frontend/src/views/setting/backup-account/index.vue +++ b/frontend/src/views/setting/backup-account/index.vue @@ -81,7 +81,8 @@ - {{ s3Data.backupPath }} + {{ s3Data.backupPath }} + {{ $t('setting.unSetting') }} {{ dateFormat(0, 0, s3Data.createdAt) }} @@ -134,7 +135,8 @@ - {{ ossData.backupPath }} + {{ ossData.backupPath }} + {{ $t('setting.unSetting') }} {{ dateFormat(0, 0, ossData.createdAt) }} @@ -188,7 +190,8 @@ - {{ cosData.backupPath }} + {{ cosData.backupPath }} + {{ $t('setting.unSetting') }} {{ dateFormat(0, 0, cosData.createdAt) }} @@ -221,7 +224,8 @@
- {{ oneDriveData.backupPath }} + {{ oneDriveData.backupPath }} + {{ $t('setting.unSetting') }} {{ dateFormat(0, 0, oneDriveData.createdAt) }} @@ -268,7 +272,8 @@ {{ kodoData.bucket }} - {{ kodoData.backupPath }} + {{ kodoData.backupPath }} + {{ $t('setting.unSetting') }} {{ dateFormat(0, 0, kodoData.createdAt) }} @@ -306,7 +311,8 @@ {{ minioData.bucket }} - {{ minioData.backupPath }} + {{ minioData.backupPath }} + {{ $t('setting.unSetting') }} {{ dateFormat(0, 0, minioData.createdAt) }}