From b775c5235e80bfad728d213137983bb40de7c45c Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Oct 2022 11:48:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=81=9C=E6=AD=A2=E5=8F=8A=E5=88=A0=E9=99=A4?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/aisafety.go | 8 ++++---- routers/routes/routes.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index 1ee6ae6cd..5102a6722 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -79,13 +79,13 @@ func GetAiSafetyTaskByJob(job *models.Cloudbrain) { } func GetAiSafetyTaskTmpl(ctx *context.Context) { - ctx.Data["id"] = ctx.Params(":jobid") + ctx.Data["id"] = ctx.Params(":id") ctx.Data["PageIsCloudBrain"] = true ctx.HTML(200, tplModelSafetyTestShow) } func GetAiSafetyTask(ctx *context.Context) { - var ID = ctx.Params(":jobid") + var ID = ctx.Params(":id") job, err := models.GetCloudbrainByIDWithDeleted(ID) if err != nil { log.Error("GetCloudbrainByJobID failed:" + err.Error()) @@ -117,7 +117,7 @@ func GetAiSafetyTask(ctx *context.Context) { func StopAiSafetyTask(ctx *context.Context) { log.Info("start to stop the task.") - var ID = ctx.Params(":jobid") + var ID = ctx.Params(":id") task, err := models.GetCloudbrainByIDWithDeleted(ID) result := make(map[string]interface{}) result["result_code"] = "-1" @@ -201,7 +201,7 @@ func StopAiSafetyTask(ctx *context.Context) { } func DelAiSafetyTask(ctx *context.Context) { - var ID = ctx.Params(":jobid") + var ID = ctx.Params(":id") task, err := models.GetCloudbrainByIDWithDeleted(ID) if err != nil { diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 5fbe8cd84..53566ad71 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -1227,7 +1227,7 @@ func RegisterRoutes(m *macaron.Macaron) { }, context.RepoRef()) m.Group("/modelsafety", func() { - m.Group("/:jobid", func() { + m.Group("/:id", func() { m.Get("/show", reqRepoCloudBrainWriter, repo.GetAiSafetyTaskTmpl) m.Get("", reqRepoCloudBrainWriter, repo.GetAiSafetyTask) m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.StopAiSafetyTask)