From f97bcb44b1eefdd64b8af71359c528b15b4217a1 Mon Sep 17 00:00:00 2001 From: liuzx Date: Wed, 12 Jan 2022 17:11:42 +0800 Subject: [PATCH] update --- routers/repo/modelarts.go | 7 ++++++- routers/repo/setting.go | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 5d33b50bb..ef32e4292 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -1292,6 +1292,11 @@ func paramCheckCreateInferenceJob(form auth.CreateModelArtsInferenceJobForm) err return errors.New("分支名不能为空") } + if len(form.Description) > 255 { + log.Error("the Description length(%d) must not more than 255", form.Description) + return errors.New("描述字符不能超过255个字符") + } + return nil } @@ -1952,7 +1957,7 @@ func InferenceJobShow(ctx *context.Context) { task.Parameters = "" } - LabelName := strings.Split(strings.TrimSpace(task.LabelName), " ") + LabelName := strings.Fields(task.LabelName) ctx.Data["labelName"] = LabelName ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName diff --git a/routers/repo/setting.go b/routers/repo/setting.go index bc80a66ff..afed8a5a9 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -61,6 +61,15 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { SetModelCount(ctx) repo := ctx.Repo.Repository + _, jobCount, err := models.Cloudbrains(&models.CloudbrainsOptions{ + RepoID: repo.ID, + }) + if err != nil { + ctx.ServerError("Get job faild:", err) + return + } + ctx.Data["jobCount"] = jobCount + switch ctx.Query("action") { case "update": if ctx.HasError() {