Browse Source

fix issue

pull/2062/head
zhoupzh 3 years ago
parent
commit
1d0111c158
5 changed files with 251 additions and 186 deletions
  1. +4
    -0
      .prettierignore
  2. +1
    -0
      .prettierrc.json
  3. +10
    -4
      package-lock.json
  4. +2
    -1
      package.json
  5. +234
    -181
      templates/repo/cloudbrain/benchmark/new.tmpl

+ 4
- 0
.prettierignore View File

@@ -0,0 +1,4 @@
# Ignore artifacts:
dist
build
coverage

+ 1
- 0
.prettierrc.json View File

@@ -0,0 +1 @@
{}

+ 10
- 4
package-lock.json View File

@@ -1123,6 +1123,12 @@
"vue-template-es2015-compiler": "^1.9.0" "vue-template-es2015-compiler": "^1.9.0"
}, },
"dependencies": { "dependencies": {
"prettier": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"optional": true
},
"source-map": { "source-map": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -11003,10 +11009,10 @@
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
}, },
"prettier": { "prettier": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"optional": true
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz",
"integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==",
"dev": true
}, },
"pretty-error": { "pretty-error": {
"version": "2.1.1", "version": "2.1.1",


+ 2
- 1
package.json View File

@@ -68,6 +68,7 @@
"eslint-config-airbnb-base": "14.1.0", "eslint-config-airbnb-base": "14.1.0",
"eslint-plugin-import": "2.20.2", "eslint-plugin-import": "2.20.2",
"eslint-plugin-vue": "6.2.2", "eslint-plugin-vue": "6.2.2",
"prettier": "2.6.2",
"script-loader": "0.7.2", "script-loader": "0.7.2",
"stylelint": "13.3.3", "stylelint": "13.3.3",
"stylelint-config-standard": "20.0.0", "stylelint-config-standard": "20.0.0",
@@ -78,4 +79,4 @@
"browserslist": [ "browserslist": [
"defaults" "defaults"
] ]
}
}

+ 234
- 181
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -1,72 +1,80 @@
{{template "base/head" .}} {{template "base/head" .}}
<style> <style>
.unite {
font-family: SourceHanSansSC-medium !important;
color: rgba(16, 16, 16, 100) !important;
}

.title {
font-size: 16px !important;
padding-left: 3rem !important;
}

.min_title {
font-size: 14px !important;
padding-left: 6rem !important;
margin-bottom: 2rem !important;

}

.width {
width: 100% !important;
}


.unite{
font-family: SourceHanSansSC-medium !important;
color: rgba(16, 16, 16, 100) !important;
}

.title{
font-size: 16px !important;
padding-left: 3rem !important;
}
.min_title{
font-size: 14px !important;
padding-left: 6rem !important;
margin-bottom: 2rem !important;

}
.width{
width:100% !important;
}
.width80{
width: 80.7% !important;
margin-left: 10px;
}
.width85{
width: 85% !important;
margin-left: 4.5rem !important;
}
.width81{
margin-left: 1.5rem;
width: 81% !important;
}
.width48{
width: 48.5% !important;
}
.add{font-size: 18px;
padding: 0.5rem;
border: 1px solid rgba(187, 187, 187, 100);
border-radius: 0px 5px 5px 0px;
line-height: 21px;
text-align: center;
color: #C2C7CC;
}
.min{
font-size: 18px;
padding: 0.5rem;
border: 1px solid rgba(187, 187, 187, 100);
border-radius: 5px 0px 0px 5px;
line-height: 21px;
text-align: center;
color: #C2C7CC;
}
.nowrapx {
white-space: nowrap !important;
}
.width80 {
width: 80.7% !important;
margin-left: 10px;
}

.width85 {
width: 85% !important;
margin-left: 4.5rem !important;
}

.width81 {
margin-left: 1.5rem;
width: 81% !important;
}

.width48 {
width: 48.5% !important;
}


.add {
font-size: 18px;
padding: 0.5rem;
border: 1px solid rgba(187, 187, 187, 100);
border-radius: 0px 5px 5px 0px;
line-height: 21px;
text-align: center;
color: #C2C7CC;
}

.min {
font-size: 18px;
padding: 0.5rem;
border: 1px solid rgba(187, 187, 187, 100);
border-radius: 5px 0px 0px 5px;
line-height: 21px;
text-align: center;
color: #C2C7CC;
}

.nowrapx {
white-space: nowrap !important;
}
</style> </style>
<!-- <div class="ui page dimmer"> <!-- <div class="ui page dimmer">
<div class="ui text loader">{{.i18n.Tr "loading"}}</div> <div class="ui text loader">{{.i18n.Tr "loading"}}</div>
</div> --> </div> -->
<div id="mask"> <div id="mask">
<div id="loadingPage">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<div id="loadingPage">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div> </div>
<div class="repository"> <div class="repository">
{{template "repo/header" .}} {{template "repo/header" .}}
@@ -85,25 +93,35 @@
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
<div class="ui blue small menu compact selectcloudbrain"> <div class="ui blue small menu compact selectcloudbrain">
<a class="item alogrithm_benchmark" href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
<a class="active item model_benchmark" href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
<a class="item alogrithm_benchmark"
href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
<a class="active item model_benchmark"
href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
</div> </div>
</div> </div>
<div> <div>
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
<input style="width: 80%;" name="display_job_name" id="trainjob_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="254">
<input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
tabindex="3" autofocus required maxlength="254">
</div> </div>
<div class="unite min_title inline field"> <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)">{{.description}}</textarea>
<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)">{{.description}}</textarea>
</div> </div>
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
<select id="cloudbrain_gpu_type" class="ui search dropdown width48" placeholder="选择GPU类型" name="gpu_type">
<select id="cloudbrain_gpu_type" class="ui search dropdown width48" placeholder="选择GPU类型"
name="gpu_type">
{{range .benchmark_gpu_types}} {{range .benchmark_gpu_types}}
<option value="{{.Queue}}">{{.Value}}</option>
<option value="{{.Queue}}">{{.Value}}</option>
{{end}} {{end}}
</select> </select>
</div> </div>
@@ -123,14 +141,17 @@
<div class="required unite min_title two inline fields "> <div class="required unite min_title two inline fields ">
<div class="required ten wide field" style="width: 26.5% !important;"> <div class="required ten wide field" style="width: 26.5% !important;">
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_type"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_type"}}</label>
<select id="cloudbrain_job_type" class="ui search dropdown job_type" placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="job_type">
<select id="cloudbrain_job_type" class="ui search dropdown job_type"
placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="job_type">
<option value="SNN4IMAGENET">SNN4IMAGENET</option> <option value="SNN4IMAGENET">SNN4IMAGENET</option>
<option value="BRAINSCORE">BRAINSCORE</option> <option value="BRAINSCORE">BRAINSCORE</option>
</select> </select>
</div> </div>
<div class="required six widde field" id="brainscore_child_type" style="width: 15% !important;display: none;">
<div class="required six widde field" id="brainscore_child_type"
style="width: 15% !important;display: none;">
<label style="font-weight: normal;">版本</label> <label style="font-weight: normal;">版本</label>
<select class="ui search dropdown" placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}" name="benchmark_child_types_id">
<select class="ui search dropdown" placeholder="select {{.i18n.Tr "cloudbrain.task_type"}}"
name="benchmark_child_types_id">
<option value="0">V1</option> <option value="0">V1</option>
<option value="1">V2</option> <option value="1">V2</option>
<option value="2">V4</option> <option value="2">V4</option>
@@ -138,25 +159,32 @@
</select> </select>
</div> </div>
<span> <span>
<i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i>
<i class="question circle icon link"
data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}}
data-position="right center" data-variation="mini"></i>
</span> </span>
<a id="benchmark_model_example" href="https://git.openi.org.cn/yult/snn4imagenet">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
<a id="benchmark_model_example"
href="https://git.openi.org.cn/yult/snn4imagenet">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div> </div>
<div id="images-new-cb"> <div id="images-new-cb">
</div> </div>
{{template "custom/select_dataset_train" .}} {{template "custom/select_dataset_train" .}}
<div class="required unite min_title inline field" style="margin-top:2rem;"> <div class="required unite min_title inline field" style="margin-top:2rem;">
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
<select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="resource_spec_id">
{{range .benchmark_resource_specs}}
<option name="resource_spec_id" value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}}
</select>
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
<select id="cloudbrain_resource_spec" class="ui search dropdown"
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px'
name="resource_spec_id">
{{range .benchmark_resource_specs}}
<option name="resource_spec_id" value="{{.Id}}">
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}
</option>
{{end}}
</select>
</div> </div>
<div class="inline unite min_title field"> <div class="inline unite min_title field">
<button class="ui create_train_job green button"> <button class="ui create_train_job green button">
{{.i18n.Tr "repo.cloudbrain.new"}}
{{.i18n.Tr "repo.cloudbrain.new"}}
</button> </button>
<a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
</div> </div>
@@ -170,181 +198,206 @@
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}</label>
<div class="ui blue small menu compact selectcloudbrain"> <div class="ui blue small menu compact selectcloudbrain">
<a class="active item alogrithm_benchmark" href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
<a class="item model_benchmark" href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
<a class="active item alogrithm_benchmark"
href="{{.Link}}?benchmarkMode=alogrithm">{{.i18n.Tr "repo.cloudbrain.benchmark.algorithm"}}</a>
<a class="item model_benchmark"
href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
</div> </div>
</div> </div>
<div> <div>
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
<input style="width: 80%;" name="display_job_name" id="trainjob_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="254">
<input style="width: 80%;" name="display_job_name" id="trainjob_job_name"
placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
tabindex="3" autofocus required maxlength="254">
</div> </div>
<div class="unite min_title inline field"> <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)">{{.description}}</textarea>
<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)">{{.description}}</textarea>
</div> </div>
<div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
<select id="cloudbrain_gpu_type" class="ui search dropdown" placeholder="选择GPU类型" style='width:385px' name="gpu_type">
{{range .benchmark_gpu_types}}
<option value="{{.Queue}}">{{.Value}}</option>
{{end}}
</select>

<div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
<select id="cloudbrain_gpu_type" class="ui search dropdown" placeholder="选择GPU类型"
style='width:385px' name="gpu_type">
{{range .benchmark_gpu_types}}
<option value="{{.Queue}}">{{.Value}}</option>
{{end}}
</select>
</div> </div>
<div class="required unite inline min_title fields" style="width: 90%;"> <div class="required unite inline min_title fields" style="width: 90%;">
<div class="required eight wide field"> <div class="required eight wide field">
<label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}</label>
<span>&nbsp;</span>
<select class="ui fluid selection search dropdown" id="benchmark_types_id" name="benchmark_types_id" >
<label
style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}</label>
<span>&nbsp;</span>
<select class="ui fluid selection search dropdown" id="benchmark_types_id"
name="benchmark_types_id">
{{range .benchmark_types}} {{range .benchmark_types}}
{{if eq .Id $.benchmarkTypeID}}
<option value="{{.Id}}" selected="true">{{.First}}</option>
{{else}}
<option value="{{.Id}}">{{.First}}</option>
{{end}}
{{if eq .Id $.benchmarkTypeID}}
<option value="{{.Id}}" selected="true">{{.First}}</option>
{{else}}
<option value="{{.Id}}">{{.First}}</option>
{{end}}
{{end}} {{end}}
</select> </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 nowrapx" id="benchmark_child_types_id" style='width: 100%;' name="benchmark_child_types_id">
</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 nowrapx" id="benchmark_child_types_id"
style='width: 100%;' name="benchmark_child_types_id">
</select> </select>
</div>
</div>
</div> </div>
<div id="images-new-cb"> <div id="images-new-cb">
</div> </div>
<div class="required unite min_title inline field"> <div class="required unite min_title inline field">
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
<select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="resource_spec_id">
{{range .benchmark_resource_specs}}
<option name="resource_spec_id" value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}}
</select>
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
<select id="cloudbrain_resource_spec" class="ui search dropdown"
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px'
name="resource_spec_id">
{{range .benchmark_resource_specs}}
<option name="resource_spec_id" value="{{.Id}}">
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}
</option>
{{end}}
</select>
</div> </div>
<div class="inline unite min_title field required"> <div class="inline unite min_title field required">
<label style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</label>
<input disabled="disabled" style="width: 33.5%;" name="train_file" id="train_file" value="train.py" tabindex="3" autofocus required maxlength="254" >
<a id="train_href_id" href="https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark" target="_blank">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</a>
<label
style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</label>
<input disabled="disabled" style="width: 33.5%;" name="train_file" id="train_file"
value="train.py" tabindex="3" autofocus required maxlength="254">
<a id="train_href_id" href="https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark"
target="_blank">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_train"}}</a>
</div> </div>
<div class="inline unite min_title field required"> <div class="inline unite min_title field required">
<label style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_test"}}</label>
<input disabled="disabled" style="width: 33.5%;" name="test_file" id="test_file" value="test.py" tabindex="3" autofocus required maxlength="254" >
<a id="test_href_id" href="https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
<label
style="font-weight: normal;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_test"}}</label>
<input disabled="disabled" style="width: 33.5%;" name="test_file" id="test_file" value="test.py"
tabindex="3" autofocus required maxlength="254">
<a id="test_href_id" href="https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark"
target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div> </div>
<div class="inline unite min_title field"> <div class="inline unite min_title field">
<button class="ui create_train_job green button"> <button class="ui create_train_job green button">
{{.i18n.Tr "repo.cloudbrain.new"}}
{{.i18n.Tr "repo.cloudbrain.new"}}
</button> </button>
<a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
</div> </div>
</div> </div>




<!-- 模态框 --> <!-- 模态框 -->


</form> </form>
{{end}}
{{end}}
</div> </div>
</div> </div>
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let repolink = {{.RepoLink}}
let repolink = {{.RepoLink }}
let url_href = window.location.pathname.split('create')[0] let url_href = window.location.pathname.split('create')[0]
$(".ui.button").attr('href',url_href)
$(".ui.button").attr('href', url_href)


$('.menu .item') $('.menu .item')
.tab(); .tab();


$('#benchmark_types_id').change(function(){
$('#benchmark_types_id').change(function () {
setChildType(); setChildType();
}) })


$(document).ready(()=>{
$(document).ready(() => {
$('.ui.search.dropdown.job_type').dropdown({ $('.ui.search.dropdown.job_type').dropdown({
onChange: function(value, text, $selectedItem) {
console.log(value,text)
if(value==="BRAINSCORE"){
$('#brainscore_child_type').css('display','block')
$('#benchmark_model_example').attr('href','https://git.openi.org.cn/yult/similarity2brain_ann')
}else{
$('#brainscore_child_type').css('display','none')
$('#benchmark_model_example').attr('href','https://git.openi.org.cn/yult/snn4imagenet')
onChange: function (value, text, $selectedItem) {
console.log(value, text)
if (value === "BRAINSCORE") {
$('#brainscore_child_type').css('display', 'block')
$('#benchmark_model_example').attr('href', 'https://git.openi.org.cn/yult/similarity2brain_ann')
} else {
$('#brainscore_child_type').css('display', 'none')
$('#benchmark_model_example').attr('href', 'https://git.openi.org.cn/yult/snn4imagenet')
} }
} }
}) })
}) })
function setChildType(){
function setChildType() {
let type_id = $('#benchmark_types_id').val(); let type_id = $('#benchmark_types_id').val();
if(type_id == 3){
$('#train_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark');
$('#test_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark');
}else{
$('#train_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark');
$('#test_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark');
if (type_id == 3) {
$('#train_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark');
$('#test_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark');
} else {
$('#train_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark');
$('#test_href_id').attr('href', 'https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark');
} }
let child_selected_id = $('#benchmark_child_types_id_hidden').val();
let child_selected_id = $('#benchmark_child_types_id_hidden').val();
$.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => { $.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => {
const n_length = data['child_types'].length const n_length = data['child_types'].length
let html=''
for (let i=0;i<n_length;i++){
if(child_selected_id == data['child_types'][i].id){
let html = ''
for (let i = 0; i < n_length; i++) {
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>`; html += `<option value="${data['child_types'][i].id}" selected="true">${data['child_types'][i].value}</option>`;
}else{
} else {
html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`; html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`;
} }
} }
document.getElementById("benchmark_child_types_id").innerHTML=html;
document.getElementById("benchmark_child_types_id").innerHTML = html;
}) })
} }
document.onreadystatechange = function() {
document.onreadystatechange = function () {
if (document.readyState === "complete") { if (document.readyState === "complete") {
if($('input[name=benchmarkMode]').val()==='alogrithm'){
if ($('input[name=benchmarkMode]').val() === 'alogrithm') {
setChildType(); setChildType();
} }
} }
} }


function validate(){
function validate() {
$('.ui.form') $('.ui.form')
.form({
on: 'blur',
inline:true,
fields: {
image:{
identifier : 'image',
rules: [
{
type: 'empty',
prompt : '选择一个镜像'
}
]
.form({
on: 'blur',
inline: true,
fields: {
image: {
identifier: 'image',
rules: [
{
type: 'empty',
prompt: '选择一个镜像'
}
]


}
},
onSuccess: function () {
// $('.ui.page.dimmer').dimmer('show')
document.getElementById("mask").style.display = "block"
},
onFailure: function (e) {
return false;
} }
},
onSuccess: function(){
// $('.ui.page.dimmer').dimmer('show')
document.getElementById("mask").style.display = "block"
},
onFailure: function(e){
return false;
}
})
})
} }




$('.ui.create_train_job.green.button').click(function(e) {
$('.ui.create_train_job.green.button').click(function (e) {
validate() validate()
}) })
</script>
</script>

Loading…
Cancel
Save