Browse Source

修改评测任务出错时数据恢复问题

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.2.2^2
zouap 3 years ago
parent
commit
c6464007d8
3 changed files with 17 additions and 4 deletions
  1. +3
    -0
      routers/repo/cloudbrain.go
  2. +13
    -3
      templates/repo/cloudbrain/benchmark/new.tmpl
  3. +1
    -1
      templates/user/dashboard/feeds.tmpl

+ 3
- 0
routers/repo/cloudbrain.go View File

@@ -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)


+ 13
- 3
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -83,7 +83,7 @@
</div>
<div class="unite min_title inline field">
<label style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}&nbsp;&nbsp;</label>
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea>
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254" value="{{.description}}" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea>
</div>

<div class="required unite min_title inline field">
@@ -102,11 +102,16 @@
<span>&nbsp;</span>
<select class="ui fluid selection search dropdown" id="benchmark_types_id" name="benchmark_types_id" >
{{range .benchmark_types}}
<option value="{{.Id}}">{{.First}}</option>
{{if eq .Id .benchmarkTypeID}}
<option value="{{.Id}}" selected="true">{{.First}}</option>
{{else}}
<option value="{{.Id}}">{{.First}}</option>
{{end}}
{{end}}
</select>
</div>
<div class="eight wide field" id="engine_name">
<input type="hidden" id="benchmark_child_types_id_hidden" name="benchmark_child_types_id_hidden" value="{{.benchmark_child_types_id_hidden}}">
<label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}}</label>
<select class="ui fluid selection dropdown nowrap" id="benchmark_child_types_id" style='width: 100%;' name="benchmark_child_types_id">
</select>
@@ -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<n_length;i++){
html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`;
if(child_selected_id == data['child_types'][i].id){
html += `<option value="${data['child_types'][i].id}" selected="true">${data['child_types'][i].value}</option>`;
}else{
html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`;
}
}
document.getElementById("benchmark_child_types_id").innerHTML=html;
})


+ 1
- 1
templates/user/dashboard/feeds.tmpl View File

@@ -124,7 +124,7 @@
{{else if eq .GetOpType 27}}
<span class="text grey"><i class="ri-character-recognition-line icon big"></i></span>
{{else if eq .GetOpType 28}}
<span class="text grey"><i class="ri-haze-2-line icon big"></i></i></span>
<span class="text grey"><i class="ri-haze-2-line icon big"></i></span>
{{else if eq .GetOpType 29}}
<span class="text grey"><i class="ri-vip-crown-line icon big"></i></span>
{{else if eq .GetOpType 30}}


Loading…
Cancel
Save