diff --git a/backend/utils/postgresql/client/remote.go b/backend/utils/postgresql/client/remote.go index 8a030fc7a..d3119eee4 100644 --- a/backend/utils/postgresql/client/remote.go +++ b/backend/utils/postgresql/client/remote.go @@ -8,6 +8,7 @@ import ( "io" "os" "os/exec" + "sort" "strings" "time" @@ -134,7 +135,7 @@ func (r *Remote) Backup(info BackupInfo) error { } fileNameItem := info.TargetDir + "/" + strings.TrimSuffix(info.FileName, ".gz") backupCommand := exec.Command("bash", "-c", - fmt.Sprintf("docker run --rm --net=host -i %s -e PGPASSWORD='%s' /bin/bash -c 'pg_dump -h %s -p %d --no-owner -Fc -U %s %s' > %s", + fmt.Sprintf("docker run --rm --net=host -i %s /bin/bash -c 'PGPASSWORD=%s pg_dump -h %s -p %d --no-owner -Fc -U %s %s' > %s", imageTag, r.Password, r.Address, r.Port, r.User, info.Name, fileNameItem)) _ = backupCommand.Run() b := make([]byte, 5) @@ -177,7 +178,7 @@ func (r *Remote) Recover(info RecoverInfo) error { }() } recoverCommand := exec.Command("bash", "-c", - fmt.Sprintf("docker run --rm --net=host -i %s -e PGPASSWORD='%s' /bin/bash -c 'pg_restore -h %s -p %d --verbose --clean --no-privileges --no-owner -Fc -U %s -d %s --role=%s' < %s", + fmt.Sprintf("docker run --rm --net=host -i %s /bin/bash -c 'PGPASSWORD=%s pg_restore -h %s -p %d --verbose --clean --no-privileges --no-owner -Fc -U %s -d %s --role=%s' < %s", imageTag, r.Password, r.Address, r.Port, r.User, info.Name, info.Username, fileName)) pipe, _ := recoverCommand.StdoutPipe() stderrPipe, _ := recoverCommand.StderrPipe() @@ -296,7 +297,11 @@ func loadImageTag() (string, error) { return itemTag, nil } - itemTag = "postgres:16.1-alpine" + sort.Strings(versions) + if len(versions) != 0 { + itemTag = versions[len(versions)-1] + } + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) defer cancel() if _, err := client.ImagePull(ctx, itemTag, image.PullOptions{}); err != nil { diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 85192abe4..8feefb721 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1834,7 +1834,7 @@ const message = { gotoInstalled: 'Go to install', search: 'Search', limitHelper: 'The application has already been installed.', - deleteHelper: `"{0}" has been associated with the following resource(s) and can't be deleted`, + deleteHelper: `"{0}" has been associated with the following resource(s). Please check and try again!`, checkTitle: 'Hint', website: 'website', database: 'database', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index fd2fd16d2..51a170feb 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1716,7 +1716,7 @@ const message = { gotoInstalled: '去安裝', search: '搜索', limitHelper: '該應用已安裝,不支持重復安裝', - deleteHelper: '{0}已經關聯以下資源,無法刪除', + deleteHelper: '{0}已經關聯以下資源,請檢查後重試!', checkTitle: '提示', website: '網站', database: '數據庫', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 484f7c064..0243f7cf3 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1715,7 +1715,7 @@ const message = { gotoInstalled: '去安装', search: '搜索', limitHelper: '该应用已安装,不支持重复安装', - deleteHelper: '{0}已经关联以下资源,无法删除', + deleteHelper: '{0}已经关联以下资源,请检查后重试!', checkTitle: '提示', website: '网站', database: '数据库',