@@ -156,13 +156,9 @@
<h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
<h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
<div class="required unite min_title inline field">
<div class="required unite min_title inline field">
<label>{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
<input style="width: 8 0%;" name="job_name" id="trainjob_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.job_name}}" tabindex="3" autofocus required maxlength="255">
<input style="width: 6 0%;" name="job_name" id="trainjob_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.job_name}}" tabindex="3" autofocus required maxlength="255">
</div>
</div>
<!--<div class="inline field">
<label>{{.i18n.Tr "repo.modelarts.train_job.version"}}</label>
<span>第一版本</span>
</div>
-->
<div class="unite min_title inline field">
<div class="unite min_title inline field">
<label for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label>
<label 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, 256)"></textarea>
<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, 256)"></textarea>
@@ -182,7 +178,7 @@
<div class="required unite min_title inline fields" style="width: 90%;">
<div class="required unite min_title inline fields" style="width: 90%;">
<label>{{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} </label>
<label>{{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} </label>
<div class="field" style="flex: 1.5;">
<div class="field" style="flex: 1.5;">
<select class="ui search dropdown width" id="trainjob_engines" >
<select class="ui dropdown width" id="trainjob_engines" >
{{range .engines}}
{{range .engines}}
<option value="{{.Value}}">{{.Value}}</option>
<option value="{{.Value}}">{{.Value}}</option>
{{end}}
{{end}}
@@ -190,7 +186,7 @@
</div>
</div>
<div class="field" style="flex: 2;">
<div class="field" style="flex: 2;">
<select class="ui search dropdown width" id="trainjob_engine_versions" style='width: 100%;' name="engine_id">
<select class="ui dropdown width" id="trainjob_engine_versions" style='width: 100%;' name="engine_id">
{{range .engine_versions}}
{{range .engine_versions}}
<option name="engine_id" value="{{.ID}}">{{.Value}}</option>
<option name="engine_id" value="{{.ID}}">{{.Value}}</option>
{{end}}
{{end}}
@@ -246,16 +242,17 @@
</div>
</div>
<div class="required unite min_title inline field">
<div class="required unite min_title inline field">
<label>{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label>
<select class="ui search dropdown width80" id="trainjob_datasets" name="attachment">
<select class="ui dropdown width80" id="trainjob_datasets" name="attachment" placeholder="选择数据集 ">
{{if $.uuid}}
{{if $.uuid}}
<option name="attachment" value="{{$.uuid}}">{{$.datasetName}}</option>
<option name="attachment" value="{{$.uuid}}">{{$.datasetName}}</option>
{{end}}
{{end}}
{{range .attachments}}
{{range .attachments}}
<option value="">选择数据集</option>
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
<option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option>
{{end}}
{{end}}
</select>
</select>
</div>
</div>
<div class="inline unite min_title field">
<div class="inline unite min_title field">
<label>{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
<!-- <i class="plus square outline icon"></i> -->
<!-- <i class="plus square outline icon"></i> -->
@@ -270,7 +267,7 @@
<!-- <h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.resource_setting"}}</h4> -->
<!-- <h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.resource_setting"}}</h4> -->
<div class="required field " style="display: none;">
<div class="required field " style="display: none;">
<label>{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label>
<select class="ui search dropdown" id="trainjob_resource_pool" style='width:385px' name="pool_id">
<select class="ui dropdown" id="trainjob_resource_pool" style='width:385px' name="pool_id">
{{range .resource_pools}}
{{range .resource_pools}}
<option value="{{.ID}}">{{.Value}}</option>
<option value="{{.ID}}">{{.Value}}</option>
{{end}}
{{end}}
@@ -295,7 +292,7 @@
<div class="required unite min_title inline field">
<div class="required unite min_title inline field">
<label>{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label>
<select class="ui search dropdown width81" id="trainjob-flavor" style='width:385px' name="flavor">
<select class="ui dropdown width81" id="trainjob-flavor" style='width:385px' name="flavor">
{{range .flavor_infos}}
{{range .flavor_infos}}
<option name="flavor" value="{{.Code}}">{{.Value}}</option>
<option name="flavor" value="{{.Code}}">{{.Value}}</option>
{{end}}
{{end}}
@@ -304,11 +301,11 @@
<div class="inline required unite min_title field">
<div class="inline required unite min_title field">
<label>{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label>
<label>{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label>
<div class="ui labeled input">
<span class="min"><i class="minus icon"></i></span>
<input style="border-radius: 0;" name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1">
<div class="ui labeled input" style="width: 5%;" >
<!-- < span class="min"><i class="minus icon"></i></span> -->
<input style="border-radius: 0;text-align: center; " name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1" readonly >
<span class="add"><i class="plus icon"></i></span>
<!-- < span class="add"><i class="plus icon"></i></span> -->
</div>
</div>
<!-- <input name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255"> -->
<!-- <input name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255"> -->
</div>
</div>
@@ -363,6 +360,9 @@
let sever_num = $('#trainjob_work_server_num')
let sever_num = $('#trainjob_work_server_num')
$('.add').click(function(){
$('.add').click(function(){
sever_num.val(parseInt(sever_num.val())+1)
sever_num.val(parseInt(sever_num.val())+1)
if(sever_num.val()>=26){
sever_num.val(parseInt(sever_num.val())-1)
}
})
})
$('.min').click(function(){
$('.min').click(function(){
sever_num.val(parseInt(sever_num.val())-1)
sever_num.val(parseInt(sever_num.val())-1)
@@ -478,6 +478,55 @@
$('.ui.parameter.modal')
$('.ui.parameter.modal')
.modal('hide');
.modal('hide');
})
})
$('select.dropdown')
.dropdown();
$('.ui.form')
.form({
on: 'blur',
inline:true,
fields: {
boot_file: {
identifier : 'boot_file',
rules: [
{
type: 'regExp[/.+\.py$/g]',
prompt : '启动文件必须为.py结尾'
}
]
},
job_name:{
identifier : 'job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,36}$/]',
prompt : '只包含大小写字母、数字、_和-,最长36个字符。'
}
]
},
attachment:{
identifier : 'attachment',
rules: [
{
type: 'empty',
prompt : '选择一个数据集'
}
]
},
work_server_number: {
identifier : 'work_server_number',
rules: [
{
type : 'integer[1..25]',
prompt : '计算节点需要在1-25之间,请您键入正确的值'
}
]
}
},
})
function validate(){
function validate(){
$('.ui.form')
$('.ui.form')
@@ -494,6 +543,25 @@
}
}
]
]
},
},
job_name:{
identifier : 'job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,36}$/]',
prompt : '只包含大小写字母、数字、_和-,最长36个字符。'
}
]
},
attachment:{
identifier : 'attachment',
rules: [
{
type: 'empty',
prompt : '选择一个数据集'
}
]
},
work_server_number: {
work_server_number: {
identifier : 'work_server_number',
identifier : 'work_server_number',
rules: [
rules: [