diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 75314f6ec..f6518b930 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1216,7 +1216,8 @@ cloudbrain.benchmark.evaluate_train=Train Script cloudbrain.benchmark.evaluate_test=Test Script cloudbrain.benchmark.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"Target detection","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"Target re-identification","second":[{"id":1,"value":"Vehicle re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"Image-based person re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"Multi-target tracking","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} cloudbrain.morethanonejob=You already have a running or waiting task, create it after that task is over. - +cloudbrain.morethanonejob1=You have created a similar task that is waiting or running, please wait for the task to finish before creating it. +cloudbrain.morethanonejob2=You can view all your Cloud Brain tasks in Personal Center > Cloud Brain Tasks . modelarts.infer_job_model = Model modelarts.infer_job_model_file = Model File diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index a6a841b76..29dfc31c4 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1230,6 +1230,8 @@ cloudbrain.benchmark.evaluate_test=测试程序 cloudbrain.benchmark.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"目标检测","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"目标重识别","second":[{"id":1,"value":"车辆重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"基于图像的行人重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"多目标跟踪","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} cloudbrain.benchmark.model.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"目标检测","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"目标重识别","second":[{"id":1,"value":"车辆重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"基于图像的行人重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"多目标跟踪","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} cloudbrain.morethanonejob=您已经创建了一个正在等待或运行中的同类任务,请等待任务结束再创建。 +cloudbrain.morethanonejob1=您已经有 同类任务 正在等待或运行中,请等待任务结束再创建; +cloudbrain.morethanonejob2=可以在 “个人中心 > 云脑任务” 查看您所有的云脑任务。 modelarts.infer_job_model = 模型名称 modelarts.infer_job_model_file = 模型文件 diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 92c95de4e..95c708e03 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -752,47 +752,48 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo ctx.NotFound(ctx.Req.URL.RequestURI(), nil) return } - - result, err := cloudbrain.GetJob(task.JobID) - if err != nil { - log.Info("error:" + err.Error()) - ctx.NotFound(ctx.Req.URL.RequestURI(), nil) - return - } prepareSpec4Show(ctx, task) if ctx.Written() { return } + if task.Status==string(models.JobWaiting) || task.Status==string(models.JobRunning) { + result, err := cloudbrain.GetJob(task.JobID) + if err != nil { + log.Info("error:" + err.Error()) + ctx.NotFound(ctx.Req.URL.RequestURI(), nil) + return + } + + if result != nil { + jobRes, _ := models.ConvertToJobResultPayload(result.Payload) + taskRoles := jobRes.TaskRoles + taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) + ctx.Data["taskRes"] = taskRes + ctx.Data["ExitDiagnostics"] = taskRes.TaskStatuses[0].ExitDiagnostics + oldStatus := task.Status + task.Status = taskRes.TaskStatuses[0].State + task.ContainerIp = "" + task.ContainerID = taskRes.TaskStatuses[0].ContainerID + models.ParseAndSetDurationFromCloudBrainOne(jobRes, task) + + if task.DeletedAt.IsZero() { //normal record + if oldStatus != task.Status { + notification.NotifyChangeCloudbrainStatus(task, oldStatus) + } + err = models.UpdateJob(task) + if err != nil { + ctx.Data["error"] = err.Error() + return + } + } else { //deleted record - if result != nil { - jobRes, _ := models.ConvertToJobResultPayload(result.Payload) - taskRoles := jobRes.TaskRoles - taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) - ctx.Data["taskRes"] = taskRes - ctx.Data["ExitDiagnostics"] = taskRes.TaskStatuses[0].ExitDiagnostics - oldStatus := task.Status - task.Status = taskRes.TaskStatuses[0].State - task.ContainerIp = "" - task.ContainerID = taskRes.TaskStatuses[0].ContainerID - models.ParseAndSetDurationFromCloudBrainOne(jobRes, task) - - if task.DeletedAt.IsZero() { //normal record - if oldStatus != task.Status { - notification.NotifyChangeCloudbrainStatus(task, oldStatus) - } - err = models.UpdateJob(task) - if err != nil { - ctx.Data["error"] = err.Error() - return } - } else { //deleted record + ctx.Data["result"] = jobRes + } else { + log.Info("error:" + err.Error()) + return } - - ctx.Data["result"] = jobRes - } else { - log.Info("error:" + err.Error()) - return } user, err := models.GetUserByID(task.UserID) diff --git a/templates/custom/alert_cb.tmpl b/templates/custom/alert_cb.tmpl index 3ea03b8e5..c4c8d9998 100644 --- a/templates/custom/alert_cb.tmpl +++ b/templates/custom/alert_cb.tmpl @@ -1,11 +1,10 @@ {{if .NotStopTaskCount}} -
- +
-
您已经有 同类任务 正在等待或运行中,请等待任务结束再创建
-
可以在 “个人中心 > 云脑任务” 查看您所有的云脑任务
+
{{.i18n.Tr "repo.cloudbrain.morethanonejob1" | Safe }}
+
{{.i18n.Tr "repo.cloudbrain.morethanonejob2" | Safe}}
diff --git a/templates/repo/badge.tmpl b/templates/repo/badge.tmpl index 61b542be8..86b482c4a 100644 --- a/templates/repo/badge.tmpl +++ b/templates/repo/badge.tmpl @@ -1,7 +1,7 @@
{{range .AllBadges }}
-
{{.CategoryName}}   (已点亮{{.LightedNum}}个)
+
{{.CategoryName}}   (已点亮 {{.LightedNum}} 个)
diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index a07c4e22d..03583779e 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -32,7 +32,9 @@
{{template "repo/header" .}}
- {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

{{.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} @@ -151,7 +153,7 @@

- {{.i18n.Tr "repo.cloudbrain.cancel"}} @@ -283,7 +285,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} @@ -354,7 +356,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/cloudbrain/inference/new.tmpl b/templates/repo/cloudbrain/inference/new.tmpl index aacead3fd..df737f995 100644 --- a/templates/repo/cloudbrain/inference/new.tmpl +++ b/templates/repo/cloudbrain/inference/new.tmpl @@ -40,7 +40,9 @@
{{template "repo/header" .}}
- {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

@@ -272,7 +274,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 7fb2bd146..b75e75cdf 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -24,7 +24,9 @@
- {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} @@ -200,7 +202,7 @@
- - {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

{{.i18n.Tr "repo.modelarts.train_job.new"}} @@ -232,7 +234,7 @@
- - {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

{{.i18n.Tr "repo.modelarts.train_job.new"}} @@ -205,7 +207,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/grampus/trainjob/npu/new.tmpl b/templates/repo/grampus/trainjob/npu/new.tmpl index dde6c8592..22cc6dc17 100755 --- a/templates/repo/grampus/trainjob/npu/new.tmpl +++ b/templates/repo/grampus/trainjob/npu/new.tmpl @@ -58,7 +58,9 @@ {{template "repo/header" .}}
- {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

{{.i18n.Tr "repo.modelarts.train_job.new"}} @@ -229,7 +231,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 699190f2b..48d64cf56 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -39,7 +39,9 @@
{{template "repo/header" .}}
- {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

@@ -300,7 +302,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/modelarts/notebook/new.tmpl b/templates/repo/modelarts/notebook/new.tmpl index 8b3931c71..e149d6095 100755 --- a/templates/repo/modelarts/notebook/new.tmpl +++ b/templates/repo/modelarts/notebook/new.tmpl @@ -11,11 +11,12 @@
- {{template "base/alert" .}} -
+ {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} + - {{template "custom/alert_cb" .}}
{{.CsrfTokenHtml}} @@ -106,7 +107,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 6323df73f..d52ce26ab 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -63,7 +63,9 @@ {{template "repo/header" .}}
- {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

{{.i18n.Tr "repo.modelarts.train_job.new"}} @@ -291,7 +293,7 @@
- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/modelsafety/new.tmpl b/templates/repo/modelsafety/new.tmpl index 34e9d53f5..94f52cc1f 100644 --- a/templates/repo/modelsafety/new.tmpl +++ b/templates/repo/modelsafety/new.tmpl @@ -55,7 +55,9 @@
{{$Grampus := (or (eq (index (SubJumpablePath .Link) 1) "create_grampus_gpu") (eq (index (SubJumpablePath .Link) 1) "create_grampus_npu"))}} - {{template "base/alert" .}} + {{if eq .NotStopTaskCount 0}} + {{template "base/alert" .}} + {{end}} {{template "custom/alert_cb" .}}

{{.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} @@ -314,7 +316,7 @@

- {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/resource_desc.tmpl b/templates/resource_desc.tmpl index 30ae3ff14..066f5d090 100644 --- a/templates/resource_desc.tmpl +++ b/templates/resource_desc.tmpl @@ -65,7 +65,7 @@ ${el.dockerDir} - ${el.example_repo} + ${el.example_repo} ${el.note}`; }); html2 = html2.replace( diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index d4e97a961..1310069f6 100755 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -21,7 +21,7 @@
{{range $k,$v :=.RecentBadges}} {{if le $k 3}} -
+
{{else}} {{end}} diff --git a/web_src/less/_user.less b/web_src/less/_user.less index 29ca96255..7afa72383 100644 --- a/web_src/less/_user.less +++ b/web_src/less/_user.less @@ -233,14 +233,4 @@ -webkit-line-clamp: 2; -webkit-box-orient: vertical; } - .badge-section-title:before { - content: ""; - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - width: 3px; - height: 1em; - background-color: #000; - } }