|
|
@@ -1,71 +1,77 @@ |
|
|
|
{{template "base/head" .}} |
|
|
|
<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; |
|
|
|
} |
|
|
|
|
|
|
|
.width80 { |
|
|
|
width: 80.7% !important; |
|
|
|
margin-left: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.width806 { |
|
|
|
width: 80.6% !important; |
|
|
|
margin-left: -2px; |
|
|
|
} |
|
|
|
|
|
|
|
.width85 { |
|
|
|
width: 85% !important; |
|
|
|
margin-left: 4.5rem !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; |
|
|
|
} |
|
|
|
.width806{ |
|
|
|
width: 80.6% !important; |
|
|
|
margin-left: -2px; |
|
|
|
} |
|
|
|
.width85{ |
|
|
|
width: 85% !important; |
|
|
|
margin-left: 4.5rem !important; |
|
|
|
} |
|
|
|
.width81{ |
|
|
|
margin-left: 1.5rem !important; |
|
|
|
width: 81% !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; |
|
|
|
} |
|
|
|
.width81 { |
|
|
|
margin-left: 1.5rem !important; |
|
|
|
width: 81% !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; |
|
|
|
} |
|
|
|
</style> |
|
|
|
<!-- <div class="ui page dimmer"> |
|
|
|
<div class="ui text loader">{{.i18n.Tr "loading"}}</div> |
|
|
|
</div> --> |
|
|
|
<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 class="repository"> |
|
|
|
{{template "repo/header" .}} |
|
|
@@ -99,68 +105,82 @@ |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label> |
|
|
|
<div class="ui blue mini menu compact selectcloudbrain"> |
|
|
|
<a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create"> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z"/> |
|
|
|
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" |
|
|
|
height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z" /> |
|
|
|
<path |
|
|
|
d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" /> |
|
|
|
</svg> |
|
|
|
CPU/GPU |
|
|
|
</a> |
|
|
|
<a class="item" href="{{.RepoLink}}/modelarts/train-job/create"> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z"/> |
|
|
|
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" |
|
|
|
height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z" /> |
|
|
|
<path |
|
|
|
d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" /> |
|
|
|
</svg> |
|
|
|
Ascend NPU</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="required unite min_title inline field"> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> |
|
|
|
<input style="width: 60%;" name="display_job_name" id="display_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required maxlength="64"> |
|
|
|
<input style="width: 60%;" name="display_job_name" id="display_job_name" |
|
|
|
placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" |
|
|
|
tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required |
|
|
|
maxlength="64"> |
|
|
|
<span class="tooltips" style="display: block;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="unite min_title inline field"> |
|
|
|
<label style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> |
|
|
|
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" 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> |
|
|
|
<label style="font-weight: normal;" |
|
|
|
for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> |
|
|
|
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" |
|
|
|
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="ui divider"></div> |
|
|
|
|
|
|
|
<h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="required unite min_title inline field"> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> |
|
|
|
<select class="ui dropdown width80 left2" id="code_version" name="branch_name"> |
|
|
|
{{if .branch_name}} |
|
|
|
<option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> |
|
|
|
{{range $k, $v :=.Branches}} |
|
|
|
{{ if ne $v $.branch_name }} |
|
|
|
<option name="branch_name" value="{{$v}}">{{$v}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{else}} |
|
|
|
<option name="branch_name" value="{{.branchName}}">{{.branchName}}</option> |
|
|
|
{{range $k, $v :=.Branches}} |
|
|
|
{{ if ne $v $.branchName }} |
|
|
|
<option name="branch_name" value="{{$v}}">{{$v}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> |
|
|
|
<select class="ui dropdown width80 left2" id="code_version" name="branch_name"> |
|
|
|
{{if .branch_name}} |
|
|
|
<option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> |
|
|
|
{{range $k, $v :=.Branches}} |
|
|
|
{{ if ne $v $.branch_name }} |
|
|
|
<option name="branch_name" value="{{$v}}">{{$v}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{else}} |
|
|
|
<option name="branch_name" value="{{.branchName}}">{{.branchName}}</option> |
|
|
|
{{range $k, $v :=.Branches}} |
|
|
|
{{ if ne $v $.branchName }} |
|
|
|
<option name="branch_name" value="{{$v}}">{{$v}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="inline required field" style="display: none;"> |
|
|
|
<label>{{.i18n.Tr "cloudbrain.task_type"}}</label> |
|
|
|
<select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' name="job_type"> |
|
|
|
<select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' |
|
|
|
name="job_type"> |
|
|
|
<option name="job_type" value="TRAIN">TRAIN</option> |
|
|
|
</select> |
|
|
|
</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 width806 dropdown" placeholder="选择GPU类型" style='width:385px' name="gpu_type"> |
|
|
|
<select id="cloudbrain_gpu_type" class="ui search width806 dropdown" placeholder="选择GPU类型" |
|
|
|
style='width:385px' name="gpu_type"> |
|
|
|
{{range .train_gpu_types}} |
|
|
|
<option value="{{.Queue}}">{{.Value}}</option> |
|
|
|
<option value="{{.Queue}}">{{.Value}}</option> |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
</div> |
|
|
@@ -184,65 +204,75 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="inline unite min_title field required"> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> |
|
|
|
{{if .bootFile}} |
|
|
|
<input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > |
|
|
|
{{else}} |
|
|
|
<input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" > |
|
|
|
{{end}} |
|
|
|
<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> |
|
|
|
</span> |
|
|
|
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> |
|
|
|
{{if .bootFile}} |
|
|
|
<input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" |
|
|
|
tabindex="3" autofocus required maxlength="255"> |
|
|
|
{{else}} |
|
|
|
<input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" |
|
|
|
autofocus required maxlength="255"> |
|
|
|
{{end}} |
|
|
|
<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> |
|
|
|
</span> |
|
|
|
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{template "custom/select_dataset_train" .}} |
|
|
|
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> |
|
|
|
<span class="tooltips" |
|
|
|
style="margin-left: 11.5rem;margin-bottom: 2rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> |
|
|
|
<div class="inline unite min_title field"> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> |
|
|
|
<span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> |
|
|
|
<input id="store_run_para" type="hidden" name="run_para_list"> |
|
|
|
<span id="add_run_para" |
|
|
|
style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i |
|
|
|
class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> |
|
|
|
<input id="store_run_para" type="hidden" name="run_para_list"> |
|
|
|
<div class="dynamic field" style="margin-top: 1rem;"> |
|
|
|
{{if .params}} |
|
|
|
{{if .params}} |
|
|
|
{{if ne 0 (len .params)}} |
|
|
|
{{range $k ,$v := .params}} |
|
|
|
<div class="two fields width85" id="para{{$k}}"> |
|
|
|
<div class="field"> |
|
|
|
<input type="text" name="shipping_first-name" value={{$v.Label}} required> |
|
|
|
</div> |
|
|
|
<div class="field"> |
|
|
|
<input type="text" name="shipping_last-name" value={{$v.Value}} required> |
|
|
|
</div> |
|
|
|
<span> |
|
|
|
<i class="trash icon"></i> |
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
{{range $k ,$v := .params}} |
|
|
|
<div class="two fields width85" id="para{{$k}}"> |
|
|
|
<div class="field"> |
|
|
|
<input type="text" name="shipping_first-name" value={{$v.Label}} required> |
|
|
|
</div> |
|
|
|
<div class="field"> |
|
|
|
<input type="text" name="shipping_last-name" value={{$v.Value}} required> |
|
|
|
</div> |
|
|
|
<span> |
|
|
|
<i class="trash icon"></i> |
|
|
|
</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="required inline unite min_title field"> |
|
|
|
<div class="required inline unite min_title field"> |
|
|
|
<label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> |
|
|
|
<select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格" style='width:385px' name="resource_spec_id"> |
|
|
|
<select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格" |
|
|
|
style='width:385px' name="resource_spec_id"> |
|
|
|
{{range .train_resource_specs}} |
|
|
|
<option name="resource_spec_id" value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option> |
|
|
|
<option name="resource_spec_id" value="{{.Id}}"> |
|
|
|
GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option> |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="inline unite min_title field"> |
|
|
|
<button class="ui create_train_job green button"> |
|
|
|
{{.i18n.Tr "repo.cloudbrain.new"}} |
|
|
|
{{.i18n.Tr "repo.cloudbrain.new"}} |
|
|
|
</button> |
|
|
|
<a class="ui button" href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> |
|
|
|
<a class="ui button" |
|
|
|
href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 模态框 --> |
|
|
|
|
|
|
|
|
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -259,202 +289,210 @@ |
|
|
|
.tab(); |
|
|
|
|
|
|
|
let sever_num = $('#trainjob_work_server_num') |
|
|
|
$('.add').click(function(){ |
|
|
|
sever_num.val(parseInt(sever_num.val())+1) |
|
|
|
if(sever_num.val()>=26){ |
|
|
|
sever_num.val(parseInt(sever_num.val())-1) |
|
|
|
$('.add').click(function () { |
|
|
|
sever_num.val(parseInt(sever_num.val()) + 1) |
|
|
|
if (sever_num.val() >= 26) { |
|
|
|
sever_num.val(parseInt(sever_num.val()) - 1) |
|
|
|
} |
|
|
|
}) |
|
|
|
$('.min').click(function(){ |
|
|
|
sever_num.val(parseInt(sever_num.val())-1) |
|
|
|
if(sever_num.val()<=0){ |
|
|
|
sever_num.val(parseInt(sever_num.val())+1) |
|
|
|
$('.min').click(function () { |
|
|
|
sever_num.val(parseInt(sever_num.val()) - 1) |
|
|
|
if (sever_num.val() <= 0) { |
|
|
|
sever_num.val(parseInt(sever_num.val()) + 1) |
|
|
|
} |
|
|
|
}) |
|
|
|
// 参数增加、删除、修改、保存 |
|
|
|
function Add_parameter(i){ |
|
|
|
value = '<div class="two fields width85" id= "para'+ i +'">' + |
|
|
|
'<div class="field">' + |
|
|
|
'<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' + |
|
|
|
'</div> ' + |
|
|
|
'<div class="field"> ' + |
|
|
|
'<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' + |
|
|
|
'</div>'+ |
|
|
|
'<span>' + |
|
|
|
'<i class="trash icon">' + |
|
|
|
'</i>' + |
|
|
|
'</span>' + |
|
|
|
'</div>' |
|
|
|
function Add_parameter(i) { |
|
|
|
value = '<div class="two fields width85" id= "para' + i + '">' + |
|
|
|
'<div class="field">' + |
|
|
|
'<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' + |
|
|
|
'</div> ' + |
|
|
|
'<div class="field"> ' + |
|
|
|
'<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' + |
|
|
|
'</div>' + |
|
|
|
'<span>' + |
|
|
|
'<i class="trash icon">' + |
|
|
|
'</i>' + |
|
|
|
'</span>' + |
|
|
|
'</div>' |
|
|
|
$(".dynamic.field").append(value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$('#add_run_para').click(function(){ |
|
|
|
$('#add_run_para').click(function () { |
|
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
|
Add_parameter(len) |
|
|
|
}); |
|
|
|
|
|
|
|
$(".dynamic.field").on("click",".trash.icon", function() { |
|
|
|
$(".dynamic.field").on("click", ".trash.icon", function () { |
|
|
|
var index = $(this).parent().parent().index() |
|
|
|
$(this).parent().parent().remove() |
|
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
|
$(".dynamic.field .two.fields").each(function(){ |
|
|
|
$(".dynamic.field .two.fields").each(function () { |
|
|
|
var cur_index = $(this).index() |
|
|
|
$(this).attr('id', 'para' + cur_index) |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
$('.ui.parameter.green.button').click(function(){ |
|
|
|
$('.ui.parameter.green.button').click(function () { |
|
|
|
var parameters = []; |
|
|
|
$('table tr').each(function() { |
|
|
|
$(this).find('td:eq(1)').each(function(){ |
|
|
|
$('table tr').each(function () { |
|
|
|
$(this).find('td:eq(1)').each(function () { |
|
|
|
parameters.push($(this).text()); |
|
|
|
}) |
|
|
|
$(this).find('input').each(function(){ |
|
|
|
$(this).find('input').each(function () { |
|
|
|
parameters.push($(this).text()) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
$('.ui.parameter.modal') |
|
|
|
.modal('hide'); |
|
|
|
for(var i = 2; i < parameters.length; i++){ |
|
|
|
switch(i) { |
|
|
|
// 数据集uuid待完成 |
|
|
|
// case (2): |
|
|
|
// console.log(1) |
|
|
|
// break; |
|
|
|
// $("#trainjob_datasets").val(parameters[i]); |
|
|
|
// console.log($("#trainjob_datasets").val()) |
|
|
|
case (3): |
|
|
|
$("input[name='boot_file']").val(parameters[i]); |
|
|
|
break; |
|
|
|
case (4): |
|
|
|
var para = parameters[i].split(" ") |
|
|
|
for(var j = 0; j < para.length; j++){ |
|
|
|
var para_name = para[j].split('=')[0] |
|
|
|
var para_value = para[j].split('=')[1] |
|
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
|
Add_parameter(len) |
|
|
|
var pid = 'para' + len |
|
|
|
$(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_first-name]").val(para_name) |
|
|
|
$(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_last-name]").val(para_value) |
|
|
|
} |
|
|
|
break; |
|
|
|
// 数据集pool_id待完成 |
|
|
|
// case (5): |
|
|
|
// $("select[name='pool_id']").val(parameters[i]); |
|
|
|
// break; |
|
|
|
case (6): |
|
|
|
$("input[name='work_server_number']").val(parameters[i]); |
|
|
|
break; |
|
|
|
} |
|
|
|
for (var i = 2; i < parameters.length; i++) { |
|
|
|
switch (i) { |
|
|
|
// 数据集uuid待完成 |
|
|
|
// case (2): |
|
|
|
// console.log(1) |
|
|
|
// break; |
|
|
|
// $("#trainjob_datasets").val(parameters[i]); |
|
|
|
// console.log($("#trainjob_datasets").val()) |
|
|
|
case (3): |
|
|
|
$("input[name='boot_file']").val(parameters[i]); |
|
|
|
break; |
|
|
|
case (4): |
|
|
|
var para = parameters[i].split(" ") |
|
|
|
for (var j = 0; j < para.length; j++) { |
|
|
|
var para_name = para[j].split('=')[0] |
|
|
|
var para_value = para[j].split('=')[1] |
|
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
|
Add_parameter(len) |
|
|
|
var pid = 'para' + len |
|
|
|
$(".dynamic.field" + " #" + pid + "").find("input[name=shipping_first-name]").val(para_name) |
|
|
|
$(".dynamic.field" + " #" + pid + "").find("input[name=shipping_last-name]").val(para_value) |
|
|
|
} |
|
|
|
break; |
|
|
|
// 数据集pool_id待完成 |
|
|
|
// case (5): |
|
|
|
// $("select[name='pool_id']").val(parameters[i]); |
|
|
|
// break; |
|
|
|
case (6): |
|
|
|
$("input[name='work_server_number']").val(parameters[i]); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
$('.ui.save.checkbox').click(function(){ |
|
|
|
$('.ui.save.checkbox').click(function () { |
|
|
|
$(this).checkbox({ |
|
|
|
onChange: function(){ |
|
|
|
if ($('.ui.save.checkbox').checkbox('is checked')){ |
|
|
|
onChange: function () { |
|
|
|
if ($('.ui.save.checkbox').checkbox('is checked')) { |
|
|
|
$('#save_para').removeClass("disabled") |
|
|
|
|
|
|
|
}else{ |
|
|
|
$('#save_para').addClass("disabled") |
|
|
|
|
|
|
|
} else { |
|
|
|
$('#save_para').addClass("disabled") |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
$('.question.circle.icon').hover(function(){ |
|
|
|
$('.question.circle.icon').hover(function () { |
|
|
|
$(this).popup('show') |
|
|
|
}); |
|
|
|
|
|
|
|
$(".item.active.parameter_config").click(function(){ |
|
|
|
$(".item.active.parameter_config").click(function () { |
|
|
|
$('.ui.parameter.modal') |
|
|
|
.modal('setting', 'closable', false) |
|
|
|
.modal('show'); |
|
|
|
}) |
|
|
|
|
|
|
|
$('.ui.deny.button').click(function(){ |
|
|
|
$('.ui.deny.button').click(function () { |
|
|
|
$('.ui.parameter.modal') |
|
|
|
.modal('hide'); |
|
|
|
}) |
|
|
|
$('select.dropdown') |
|
|
|
.dropdown(); |
|
|
|
|
|
|
|
function validate(){ |
|
|
|
function validate() { |
|
|
|
$('.ui.form') |
|
|
|
.form({ |
|
|
|
on: 'blur', |
|
|
|
fields: { |
|
|
|
boot_file: { |
|
|
|
identifier : 'boot_file', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'regExp[/.+\.py$/g]', |
|
|
|
.form({ |
|
|
|
on: 'blur', |
|
|
|
fields: { |
|
|
|
boot_file: { |
|
|
|
identifier: 'boot_file', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'regExp[/.+\.py$/g]', |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
display_job_name: { |
|
|
|
identifier: 'display_job_name', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]', |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
attachment: { |
|
|
|
identifier: 'attachment', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'empty', |
|
|
|
} |
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
work_server_number: { |
|
|
|
identifier: 'work_server_number', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'integer[1..25]', |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
branch_name: { |
|
|
|
identifier: 'branch_name', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'empty', |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
display_job_name:{ |
|
|
|
identifier : 'display_job_name', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]', |
|
|
|
} |
|
|
|
] |
|
|
|
onSuccess: function () { |
|
|
|
// $('.ui.page.dimmer').dimmer('show') |
|
|
|
document.getElementById("mask").style.display = "block" |
|
|
|
}, |
|
|
|
attachment:{ |
|
|
|
identifier : 'attachment', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'empty', |
|
|
|
} |
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
work_server_number: { |
|
|
|
identifier : 'work_server_number', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type : 'integer[1..25]', |
|
|
|
} |
|
|
|
] |
|
|
|
onFailure: function (e) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
onSuccess: function(){ |
|
|
|
// $('.ui.page.dimmer').dimmer('show') |
|
|
|
document.getElementById("mask").style.display = "block" |
|
|
|
}, |
|
|
|
onFailure: function(e){ |
|
|
|
return false; |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
document.onreadystatechange = function() { |
|
|
|
document.onreadystatechange = function () { |
|
|
|
if (document.readyState === "complete") { |
|
|
|
document.getElementById("mask").style.display = "none" |
|
|
|
} |
|
|
|
} |
|
|
|
function send_run_para(){ |
|
|
|
function send_run_para() { |
|
|
|
var run_parameters = [] |
|
|
|
var msg = {} |
|
|
|
$(".dynamic.field .two.fields").each(function(){ |
|
|
|
$(".dynamic.field .two.fields").each(function () { |
|
|
|
var para_name = $(this).find('input[name=shipping_first-name]').val() |
|
|
|
var para_value = $(this).find('input[name=shipping_last-name]').val() |
|
|
|
run_parameters.push({"label": para_name, "value": para_value}) |
|
|
|
run_parameters.push({ "label": para_name, "value": para_value }) |
|
|
|
}) |
|
|
|
msg["parameter"] = run_parameters |
|
|
|
msg = JSON.stringify(msg) |
|
|
|
$('#store_run_para').val(msg) |
|
|
|
} |
|
|
|
function get_name(){ |
|
|
|
let name1=$("#engine_name .text").text() |
|
|
|
let name2=$("#flaver_name .text").text() |
|
|
|
function get_name() { |
|
|
|
let name1 = $("#engine_name .text").text() |
|
|
|
let name2 = $("#flaver_name .text").text() |
|
|
|
$("input#ai_engine_name").val(name1) |
|
|
|
$("input#ai_flaver_name").val(name2) |
|
|
|
|
|
|
|
} |
|
|
|
$('.ui.create_train_job.green.button').click(function(e) { |
|
|
|
$('.ui.create_train_job.green.button').click(function (e) { |
|
|
|
get_name() |
|
|
|
send_run_para() |
|
|
|
validate() |
|
|
|
validate() |
|
|
|
}) |
|
|
|
</script> |