Browse Source

Merge branch 'V20221019' into fix-csh

pull/2980/head
zhoupzh 2 years ago
parent
commit
35295b79c3
3 changed files with 8 additions and 0 deletions
  1. +1
    -0
      options/locale/locale_en-US.ini
  2. +1
    -0
      options/locale/locale_zh-CN.ini
  3. +6
    -0
      routers/repo/cloudbrain.go

+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -1058,6 +1058,7 @@ modify_image=Modify Image
image_exist=Image name has been used, please use a new one.
image_committing=Image is submitting, please try again later.
image_commit_fail=Failed to submit image, please try again later.
image_over_20g=Failed to submit image, the size of image can not be over 20GB.
image_not_exist=Image does not exits.
image_edit_fail=Failed to edit image, please try again later.
image_delete_fail=Failed to delete image, please try again later.


+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -1059,6 +1059,7 @@ modify_image=修改镜像
image_exist=镜像Tag已被使用,请修改镜像Tag。
image_committing=镜像正在提交中,请稍后再试。
image_commit_fail=提交镜像失败,请稍后再试。
image_over_20g=提交镜像失败,镜像大小不能超过20GB。
image_not_exist=镜像不存在。
image_edit_fail=编辑镜像失败,请稍后再试。
image_delete_fail=删除镜像失败,请稍后再试。


+ 6
- 0
routers/repo/cloudbrain.go View File

@@ -1147,6 +1147,8 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain

} else if models.IsErrorImageCommitting(err) {
ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_committing")))
} else if isOver20GError(err) {
ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_over_20g")))
} else {
ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_commit_fail")))
}
@@ -1156,6 +1158,10 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain
ctx.JSON(200, models.BaseOKMessage)
}

func isOver20GError(err error) bool {
return strings.Contains(err.Error(), "over max image size 20GB")
}

func checkTopics(Topics string) ([]string, string) {
var topics = make([]string, 0)
var topicsStr = strings.TrimSpace(Topics)


Loading…
Cancel
Save