From 20fb568aeab67f2c87d50db1377307c816b30189 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 24 Mar 2022 17:56:12 +0800 Subject: [PATCH] feed --- options/locale/locale_zh-CN.ini | 3 ++- public/home/home.js | 12 +++++++----- routers/repo/cloudbrain.go | 4 ++-- services/socketwrap/clientManager.go | 2 +- templates/user/dashboard/feeds.tmpl | 4 +++- 5 files changed, 15 insertions(+), 10 deletions(-) mode change 100644 => 100755 public/home/home.js mode change 100644 => 100755 services/socketwrap/clientManager.go mode change 100644 => 100755 templates/user/dashboard/feeds.tmpl diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 7078bdb52..8f1adc400 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -2751,10 +2751,11 @@ reject_pull_request=`建议变更 %s#%[2]s` upload_dataset=`上传了数据集文件 %s` task_gpudebugjob=`创建了CPU/GPU类型调试任务 %s` task_npudebugjob=`创建了NPU类型调试任务 %s` -task_trainjob=`创建了训练任务 %s` +task_nputrainjob=`创建了NPU类型训练任务 %s` task_inferencejob=`创建了推理任务 %s` task_benchmark=`创建了评测任务 %s` task_createmodel=`导入了新模型 %s` +task_gputrainjob=`创建了CPU/GPU类型训练任务 %s` [tool] ago=%s前 diff --git a/public/home/home.js b/public/home/home.js old mode 100644 new mode 100755 index 7512a4423..237ede3e7 --- a/public/home/home.js +++ b/public/home/home.js @@ -135,7 +135,7 @@ socket.onmessage = function (e) { html += recordPrefix + actionName; html += " " + getRepotext(record) + "" } - else if(record.OpType == "24" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "30"){ + else if(record.OpType == "24" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "30" || record.OpType == "31"){ html += recordPrefix + actionName; html += " " + record.RefName + "" } @@ -321,10 +321,11 @@ var actionNameZH={ "24":"上传了数据集文件", "25":"创建了CPU/GPU类型调试任务", "26":"创建了NPU类型调试任务", - "27":"创建了训练任务", + "27":"创建了NPU类型训练任务", "28":"创建了推理任务", "29":"创建了评测任务", - "30":"导入了新模型" + "30":"导入了新模型", + "31":"创建了CPU/GPU类型训练任务" }; var actionNameEN={ @@ -346,10 +347,11 @@ var actionNameEN={ "24":" upload dataset ", "25":" created CPU/GPU type debugging task ", "26":" created NPU type debugging task ", - "27":" created training task", + "27":" created NPU type training task", "28":" created reasoning task", "29":" created profiling task", - "30":" created new model" + "30":" created new model", + "31":" created CPU/GPU type training task", }; var repoAndOrgZH={ diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0c2db2c30..e4abed413 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -1459,14 +1459,14 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) { } func CloudBrainTrainJobDel(ctx *context.Context) { - var listType= ctx.Query("listType") + var listType = ctx.Query("listType") if err := deleteCloudbrainJob(ctx); err != nil { log.Error("deleteCloudbrainJob failed: %v", err, ctx.Data["msgID"]) ctx.ServerError(err.Error(), err) return } - var isAdminPage= ctx.Query("isadminpage") + var isAdminPage = ctx.Query("isadminpage") if ctx.IsUserSiteAdmin() && isAdminPage == "true" { ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") } else { diff --git a/services/socketwrap/clientManager.go b/services/socketwrap/clientManager.go old mode 100644 new mode 100755 index 98b0e0aa9..61f356a66 --- a/services/socketwrap/clientManager.go +++ b/services/socketwrap/clientManager.go @@ -10,7 +10,7 @@ import ( "github.com/elliotchance/orderedmap" ) -var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 25, 26, 27, 28, 29, 30} +var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 25, 26, 27, 28, 29, 30, 31} type ClientsManager struct { Clients *orderedmap.OrderedMap diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl old mode 100644 new mode 100755 index 9724de269..f7319fd5c --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -77,13 +77,15 @@ {{else if eq .GetOpType 26}} {{$.i18n.Tr "action.task_npudebugjob" .GetRepoLink .Content .RefName | Str2html}} {{else if eq .GetOpType 27}} - {{$.i18n.Tr "action.task_trainjob" .GetRepoLink .Content .RefName | Str2html}} + {{$.i18n.Tr "action.task_nputrainjob" .GetRepoLink .Content .RefName | Str2html}} {{else if eq .GetOpType 28}} {{$.i18n.Tr "action.task_inferencejob" .GetRepoLink .Content .RefName | Str2html}} {{else if eq .GetOpType 29}} {{$.i18n.Tr "action.task_benchmark" .GetRepoLink .Content .RefName | Str2html}} {{else if eq .GetOpType 30}} {{$.i18n.Tr "action.task_createmodel" .GetRepoLink .RefName .RefName | Str2html}} + {{else if eq .GetOpType 31}} + {{$.i18n.Tr "action.task_gputrainjob" .GetRepoLink .RefName .RefName | Str2html}} {{end}}

{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}