diff --git a/backend/app/service/backup.go b/backend/app/service/backup.go index 22aff6a61..cbb0ae719 100644 --- a/backend/app/service/backup.go +++ b/backend/app/service/backup.go @@ -36,13 +36,36 @@ func NewIBackupService() IBackupService { func (u *BackupService) List() ([]dto.BackupInfo, error) { ops, err := backupRepo.List(commonRepo.WithOrderBy("created_at desc")) var dtobas []dto.BackupInfo + ossExist, s3Exist, sftpExist, minioExist := false, false, false, false for _, group := range ops { + switch group.Type { + case "OSS": + ossExist = true + case "S3": + s3Exist = true + case "SFTP": + sftpExist = true + case "MINIO": + minioExist = true + } var item dto.BackupInfo if err := copier.Copy(&item, &group); err != nil { return nil, errors.WithMessage(constant.ErrStructTransform, err.Error()) } dtobas = append(dtobas, item) } + if !ossExist { + dtobas = append(dtobas, dto.BackupInfo{Type: "OSS"}) + } + if !s3Exist { + dtobas = append(dtobas, dto.BackupInfo{Type: "S3"}) + } + if !sftpExist { + dtobas = append(dtobas, dto.BackupInfo{Type: "SFTP"}) + } + if !minioExist { + dtobas = append(dtobas, dto.BackupInfo{Type: "MINIO"}) + } return dtobas, err } diff --git a/frontend/src/api/interface/backup.ts b/frontend/src/api/interface/backup.ts index d08cab9e2..52db5d5fa 100644 --- a/frontend/src/api/interface/backup.ts +++ b/frontend/src/api/interface/backup.ts @@ -9,6 +9,7 @@ export namespace Backup { credential: string; vars: string; varsJson: object; + createdAt: Date; } export interface BackupOperate { id: number; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 33969cc3c..0056577bb 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -699,6 +699,7 @@ export default { duplicatePassword: 'The new password cannot be the same as the original password, please re-enter!', backup: 'Backup', + createBackupAccount: 'Create {0} backup account', noTypeForCreate: 'No backup type is currently created', serverDisk: 'Server disks', currentPath: 'Current path', @@ -734,6 +735,7 @@ export default { complexityHelper: 'The password must contain at least eight characters and contain at least three uppercase letters, lowercase letters, digits, and special characters', mfa: 'MFA', + mfaHelper: 'After this function is enabled, the mobile application verification code will be verified', mfaHelper1: 'Download a MFA verification mobile app such as:', mfaHelper2: 'Scan the following QR code using the mobile app to obtain the 6-digit verification code', mfaHelper3: 'Enter six digits from the app', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index bcb523a30..6e1bcba6b 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -239,7 +239,7 @@ export default { database: { delete: '删除操作无法回滚,请输入 "', deleteHelper: '" 删除此数据库', - create: '创建数据库', + create: '新建数据库', noMysql: '当前未检测到 {0} 数据库,请进入应用商店点击安装!', mysqlBadStatus: '当前 mysql 应用状态异常,请在', adjust: '中查看原因或修改配置', @@ -713,6 +713,7 @@ export default { duplicatePassword: '新密码不能与原始密码一致,请重新输入!', backup: '备份', + createBackupAccount: '添加 {0} 备份账号', noTypeForCreate: '当前无可创建备份类型', serverDisk: '服务器磁盘', currentPath: '当前路径', @@ -767,8 +768,9 @@ export default { expiredHelper: '当前密码已过期,请重新修改密码:', timeoutHelper: '【 {0} 天后 】面板密码即将过期,过期后需要重新设置密码', complexity: '密码复杂度验证', - complexityHelper: '密码必须满足密码长度大于 8 位且包含字母、数字及特殊字符', + complexityHelper: '开启后密码必须满足密码长度大于 8 位且包含字母、数字及特殊字符', mfa: '两步验证', + mfaHelper: '开启后会验证手机应用验证码', mfaHelper1: '下载两步验证手机应用 如:', mfaHelper2: '使用手机应用扫描以下二维码,获取 6 位验证码', mfaHelper3: '输入手机应用上的 6 位数字', diff --git a/frontend/src/views/container/compose/create/index.vue b/frontend/src/views/container/compose/create/index.vue index ad14bdac8..4620fd60b 100644 --- a/frontend/src/views/container/compose/create/index.vue +++ b/frontend/src/views/container/compose/create/index.vue @@ -1,5 +1,5 @@