From d316f8b01153986f4408ac1740199f1af2e487c4 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 8 Jun 2022 16:04:11 +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/ai_model_convert.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/routers/repo/ai_model_convert.go b/routers/repo/ai_model_convert.go index 60eff8c79..4d6a0344d 100644 --- a/routers/repo/ai_model_convert.go +++ b/routers/repo/ai_model_convert.go @@ -386,11 +386,19 @@ func ShowModelConvertInfo(ctx *context.Context) { ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) job, err := models.QueryModelConvertById(ctx.Query("ID")) - ctx.Data["canDownload"] = isOper(ctx, job.UserId) - if err == nil { ctx.Data["task"] = job + } else { + ctx.ServerError("Not found task.", err) + return } + ctx.Data["canDownload"] = isOper(ctx, job.UserId) + user, err := models.GetUserByID(job.UserId) + if err == nil { + job.UserName = user.Name + job.UserRelAvatarLink = user.RelAvatarLink() + } + if isCloudBrainTask(job) { ctx.Data["npu_display"] = "none" ctx.Data["gpu_display"] = "block"