From 2de8fdca8b6e4f3a8333bcfb87da40e4614e6309 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 10:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 11 +- routers/routes/routes.go | 2 +- templates/repo/cloudbrain/benchmark/new.tmpl | 22 +- templates/repo/cloudbrain/benchmark/show.tmpl | 866 ++++++++++++++++++ 4 files changed, 886 insertions(+), 15 deletions(-) create mode 100644 templates/repo/cloudbrain/benchmark/show.tmpl diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0aaff7f11..75850bbce 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -34,6 +34,7 @@ const ( tplCloudBrainBenchmarkIndex base.TplName = "repo/cloudbrain/benchmark/index" tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" + tplCloudBrainBenchmarkShow base.TplName = "repo/cloudbrain/benchmark/show" ) var ( @@ -321,7 +322,15 @@ func CloudBrainRestart(ctx *context.Context) { }) } +func CloudBrainBenchMarkShow(ctx *context.Context) { + cloudBrainShow(ctx, tplCloudBrainBenchmarkShow) +} + func CloudBrainShow(ctx *context.Context) { + cloudBrainShow(ctx, tplCloudBrainShow) +} + +func cloudBrainShow(ctx *context.Context, tpName base.TplName) { ctx.Data["PageIsCloudBrain"] = true var jobID = ctx.Params(":jobid") @@ -366,7 +375,7 @@ func CloudBrainShow(ctx *context.Context) { ctx.Data["task"] = task ctx.Data["jobID"] = jobID - ctx.HTML(200, tplCloudBrainShow) + ctx.HTML(200, tpName) } func CloudBrainDebug(ctx *context.Context) { diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 8b4a75acd..25c54793e 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -983,7 +983,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/benchmark", func() { m.Get("", reqRepoCloudBrainReader, repo.CloudBrainBenchmarkIndex) m.Group("/:jobid", func() { - m.Get("", reqRepoCloudBrainReader, repo.CloudBrainShow) + m.Get("", reqRepoCloudBrainReader, repo.CloudBrainBenchMarkShow) m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainStop) m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainDel) m.Get("/rate", reqRepoCloudBrainReader, repo.GetRate) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 781a29c44..fad6496e0 100644 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -81,12 +81,15 @@ - -
- - + +
+ +
-
@@ -121,14 +124,7 @@
-
- - -
+
diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl new file mode 100644 index 000000000..1b8c13ef8 --- /dev/null +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -0,0 +1,866 @@ +{{template "base/head" .}} + +
+
+
+
+
+
+
+
+
+
+{{template "repo/header" .}} +
+

+ +

+ {{range $k ,$v := .version_list_task}} +
+
+
+
+ + + +
+ {{$.CsrfTokenHtml}} + {{if and (.CanModify) (eq .Status "COMPLETED")}} + {{$.i18n.Tr "repo.modelarts.create_model"}} + {{else}} + {{$.i18n.Tr "repo.modelarts.create_model"}} + {{end}} + {{$.CsrfTokenHtml}} + {{if .CanModify}} + {{$.i18n.Tr "repo.modelarts.modify"}} + {{else}} + {{$.i18n.Tr "repo.modelarts.modify"}} + {{end}} + {{$.CsrfTokenHtml}} + {{if .CanDel}} + {{$.i18n.Tr "repo.stop"}} + {{else}} + {{$.i18n.Tr "repo.stop"}} + {{end}} + + {{$.CsrfTokenHtml}} + {{if .CanDel}} + {{$.i18n.Tr "repo.delete"}} + {{else}} + {{$.i18n.Tr "repo.delete"}} + {{end}} +
+
+ + {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} + {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} + {{$.i18n.Tr "repo.modelarts.parent_version"}}:{{.PreVersionName}} + {{$.i18n.Tr "repo.modelarts.status"}}: + {{.Status}} + + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}: + {{.TrainJobDuration}} + + +
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{$.i18n.Tr "repo.cloudbrain_task"}} + +
+ {{.JobName}} +
+
+ {{$.i18n.Tr "repo.modelarts.status"}} + +
+ {{.Status}} +
+
+ {{$.i18n.Tr "repo.modelarts.run_version"}} + +
+ {{.VersionName}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.start_time"}} + +
+ {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} + +
+ {{.TrainJobDuration}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.standard"}} + +
+ {{.FlavorName}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}} + +
+ {{.WorkServerNumber}} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}} + +
+ {{.EngineName}} +
+
+ {{$.i18n.Tr "repo.modelarts.code_version"}} + +
+ {{.BranchName}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.start_file"}} + +
+ {{.BootFile}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.train_dataset"}} + +
+ {{.DatasetName}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}} + +
+ {{.Parameters}} +
+
+ {{$.i18n.Tr "repo.modelarts.train_job.description"}} + +
+ {{.Cloudbrain.Description}} +
+
+
+
+
+ +
+
+
+
+ +
+ + +

+                            
+ +
+ +
+
+ + + +
+ +
+
+ +
+
+
+ {{end}} {{template "base/paginate" .}} +
+ +
+ +
+ +
+ +
+{{template "base/footer" .}} + + \ No newline at end of file