From 591742cc5a9bb80edd5894623a4a04ec182cfda7 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 17 Jan 2022 17:29:50 +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 | 13 +++++++------ templates/repo/cloudbrain/benchmark/index.tmpl | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 21e0c62e8..3d23e3ee1 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -643,8 +643,13 @@ func CloudBrainDownloadModel(ctx *context.Context) { } func GetRate(ctx *context.Context) { - var jobID = ctx.Params(":jobid") isObjectDetcionAll := ctx.QueryBool("isObjectDetcionAll") + if isObjectDetcionAll { + ctx.Redirect(setting.BenchmarkServerHost + "?username=admin") + return + } + + var jobID = ctx.Params(":jobid") job, err := models.GetCloudbrainByJobID(jobID) if err != nil { ctx.ServerError("GetCloudbrainByJobID failed", err) @@ -653,11 +658,7 @@ func GetRate(ctx *context.Context) { if job.JobType == string(models.JobTypeBenchmark) { log.Info("url=" + setting.BenchmarkServerHost + "?username=" + ctx.User.Name) - if isObjectDetcionAll { - ctx.Redirect(setting.BenchmarkServerHost + "?username=admin") - } else { - ctx.Redirect(setting.BenchmarkServerHost + "?username=" + ctx.User.Name) - } + ctx.Redirect(setting.BenchmarkServerHost + "?username=" + ctx.User.Name) } else if job.JobType == string(models.JobTypeSnn4imagenet) { ctx.Redirect(setting.Snn4imagenetServerHost) } else if job.JobType == string(models.JobTypeBrainScore) { diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index af2f941d2..a2306b0e3 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -177,7 +177,7 @@ {{end}}