From c6464007d8a3da73aa45160c807a280701de00ed Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 17 Feb 2022 16:20:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E6=B5=8B=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=87=BA=E9=94=99=E6=97=B6=E6=95=B0=E6=8D=AE=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 3 +++ templates/repo/cloudbrain/benchmark/new.tmpl | 16 +++++++++++++--- templates/user/dashboard/feeds.tmpl | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0599fb03f..88fea0d8f 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -1200,6 +1200,9 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF benchmarkTypeID := form.BenchmarkTypeID benchmarkChildTypeID := form.BenchmarkChildTypeID + ctx.Data["description"] = form.Description + ctx.Data["benchmarkTypeID"] = benchmarkTypeID + ctx.Data["benchmark_child_types_id_hidden"] = benchmarkChildTypeID if !jobNamePattern.MatchString(jobName) { cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplCloudBrainBenchmarkNew, &form) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 081e44e48..6f498e834 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -83,7 +83,7 @@
- +
@@ -102,11 +102,16 @@  
+ @@ -182,12 +187,17 @@ function setChildType(){ let type_id = $('#benchmark_types_id').val(); + let child_selected_id = $('#benchmark_child_types_id_hidden').val(); $.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => { console.log(JSON.stringify(data)) const n_length = data['child_types'].length let html='' for (let i=0;i${data['child_types'][i].value}`; + if(child_selected_id == data['child_types'][i].id){ + html += ``; + }else{ + html += ``; + } } document.getElementById("benchmark_child_types_id").innerHTML=html; }) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 8c2715613..9724de269 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -124,7 +124,7 @@ {{else if eq .GetOpType 27}} {{else if eq .GetOpType 28}} - + {{else if eq .GetOpType 29}} {{else if eq .GetOpType 30}}