diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 09bb5015fe..94214a25c7 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -911,7 +911,9 @@ language_other = Other datasets = Datasets datasets.desc = Enable Dataset cloudbrain_helper=Use GPU/NPU resources to open notebooks, model training tasks, etc. - +cloudbrain.exitinfo=Exit Information +cloudbrain.platform=Platform +cloudbrain.endtime=End Time model_manager = Model model_noright=No right model_rename=Duplicate model name, please modify model name. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index d260653639..e93b05ffba 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -958,7 +958,9 @@ cloudbrain_jobname_err=只能以小写字母或数字开头且只包含小写字 cloudbrain_query_fail=查询云脑任务失败。 cloudbrain.mirror_tag = 镜像标签 cloudbrain.mirror_description = 镜像描述 - +cloudbrain.exitinfo=退出信息 +cloudbrain.platform=平台 +cloudbrain.endtime=结束时间 record_begintime_get_err=无法获取统计开始时间。 parameter_is_wrong=输入参数错误,请检查输入参数。 total_count_get_error=查询总页数失败。 diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0ddb1e1fee..73b1914e54 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -2,11 +2,9 @@ package repo import ( "bufio" - "code.gitea.io/gitea/modules/timeutil" "encoding/json" "errors" "fmt" - "github.com/unknwon/i18n" "io" "net/http" "os" @@ -16,6 +14,9 @@ import ( "strings" "time" + "code.gitea.io/gitea/modules/timeutil" + "github.com/unknwon/i18n" + "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/base" @@ -531,6 +532,12 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo } } + attachment, err := models.GetAttachmentByUUID(task.Uuid) + if err == nil { + ctx.Data["datasetname"] = attachment.Name + } else { + ctx.Data["datasetname"] = "" + } ctx.Data["task"] = task ctx.Data["jobName"] = task.JobName @@ -539,6 +546,9 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo version_list_task = append(version_list_task, task) ctx.Data["version_list_task"] = version_list_task ctx.Data["debugListType"] = debugListType + ctx.Data["code_path"] = cloudbrain.CodeMountPath + ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath + ctx.Data["model_path"] = cloudbrain.ModelMountPath ctx.Data["canDownload"] = cloudbrain.CanDeleteJob(ctx, task) ctx.HTML(200, tpName) } diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 109fb195fe..16e5a98f58 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -281,7 +281,7 @@ td, th { - 镜像 + {{.i18n.Tr "cloudbrain.mirror"}} @@ -292,7 +292,8 @@ td, th { - 类型 + {{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}} + @@ -313,7 +314,7 @@ td, th { - 训练程序 + {{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}} @@ -324,7 +325,7 @@ td, th { - 测试程序 + {{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_test"}} @@ -360,7 +361,7 @@ td, th { - 创建者 + {{$.i18n.Tr "repo.cloudbrain_creator"}} @@ -371,7 +372,7 @@ td, th { - 子类型 + {{$.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}} diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 1e234e0945..895a5c14f5 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -1,108 +1,501 @@ {{template "base/head" .}} + +
+
+
+
+
+
+
+
+
{{template "repo/header" .}} -
-
- {{template "base/alert" .}} - +

- +

-
-
- {{with .task}} -

任务名称: {{.DisplayJobName}}

- {{end}} -
-
-

任务结果:

- {{with .taskRes}} - {{range .TaskStatuses}} - - - - - - - -
状态 {{.State}}
- {{end}} - {{end}} -
-
- {{with .result}} - - - - - - - - - - - - - - - - - - -
硬件信息
CPU {{.Resource.CPU}}
Memory {{.Resource.Memory}}
NvidiaComGpu {{.Resource.NvidiaComGpu}}
- - - - - - - - - - - - - {{if not (eq $.task.StartTime 0)}} - - {{else}} - - - - {{if not (eq $.task.EndTime 0)}} - - {{else}} - - - - - - - - - - -
调试信息
平台 {{.Platform}}
开始时间 {{TimeSinceUnix1 $.task.StartTime}} - {{end}} -
结束时间 {{TimeSinceUnix1 $.task.EndTime}} - {{end}} -
ExitCode {{.JobStatus.AppExitCode}}
退出信息 {{.JobStatus.AppExitDiagnostics | nl2br}}
- {{end}} -
+ {{range $k ,$v := .version_list_task}} +
+ +
+
+
+ + + +
+ + {{if not (eq .StartTime 0)}} + {{TimeSinceUnix1 .StartTime}} + {{else}} + {{TimeSinceUnix1 .CreatedUnix}} + {{end}} + + + {{$.i18n.Tr "repo.modelarts.status"}}: + {{.Status}} + + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}: + {{$.duration}} + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{$.i18n.Tr "repo.cloudbrain_task"}} + +
+ {{.DisplayJobName}} +
+
+ {{$.i18n.Tr "repo.modelarts.status"}} + +
+ {{.Status}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.start_time"}} + +
+ + {{if not (eq .StartTime 0)}} + {{TimeSinceUnix1 .StartTime}} + {{else}} + {{TimeSinceUnix1 .CreatedUnix}} + {{end}} + +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} + +
+ {{$.duration}} +
+
+ {{$.i18n.Tr "cloudbrain.mirror"}} + +
+ {{.Image}} +
+
+ {{$.i18n.Tr "cloudbrain.dataset_storage_path"}} + +
+ {{$.dataset_path}} +
+
+ {{$.i18n.Tr "cloudbrain.code_storage_path"}} + +
+ {{$.code_path}} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{$.i18n.Tr "repo.cloudbrain.platform"}} + +
+ {{$.result.Platform}} +
+
+ ExitCode + +
+ {{$.result.JobStatus.AppExitCode}} +
+
+ {{$.i18n.Tr "repo.cloudbrain.endtime"}} + +
+ {{if not (eq .StartTime 0)}} + {{TimeSinceUnix1 .EndTime}} + {{else}} + -- + {{end}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.dataset"}} + +
+ {{$.datasetname}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.standard"}} + +
+ {{$.resource_spec}} +
+
+ {{$.i18n.Tr "repo.cloudbrain_creator"}} + +
+ {{.User.Name}} +
+
+ {{$.i18n.Tr "cloudbrain.model_storage_path"}} + +
+ {{$.model_path}} +
+
+
+
+
+
+ {{$.i18n.Tr "repo.cloudbrain.exitinfo"}} + +
+
+
+ + {{$.result.JobStatus.AppExitDiagnostics}} + +
+
+ +
+
+ + +
+
+ {{end}} {{template "base/paginate" .}} +
+ +
+
-
+ +
{{template "base/footer" .}} + +