@@ -130,7 +130,7 @@ | |||
<div class="required min_title inline field" style="margin-top:2rem;"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
<select id="__specs__" class="ui search dropdown width48" | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}" | |||
name="spec_id"> | |||
</select> | |||
</div> | |||
@@ -230,7 +230,7 @@ | |||
<div class="required min_title inline field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
<select id="__specs__" class="ui search dropdown width48" | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}" | |||
name="spec_id"> | |||
</select> | |||
</div> | |||
@@ -325,6 +325,7 @@ | |||
} | |||
} | |||
} | |||
var isValidate = false; | |||
function validate() { | |||
$('.ui.form') | |||
.form({ | |||
@@ -348,12 +349,18 @@ | |||
} | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function () { | |||
// $('.ui.page.dimmer').dimmer('show') | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function (e) { | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -254,7 +254,7 @@ | |||
</div>--> | |||
<div class="required min_title inline field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
<select id="__specs__" class="ui search dropdown width48" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" name="spec_id"> | |||
<select id="__specs__" class="ui search dropdown width48" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" ovalue="{{.spec_id}}" name="spec_id"> | |||
</select> | |||
</div> | |||
<!-- 表单操作 --> | |||
@@ -443,6 +443,8 @@ | |||
msg = JSON.stringify(msg) | |||
$('#store_run_para').val(msg) | |||
} | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form') | |||
.form({ | |||
@@ -496,12 +498,18 @@ | |||
type: 'empty', | |||
} | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -145,7 +145,7 @@ | |||
<div class="inline required field"> | |||
<label>{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
<select id="__specs__" class="ui search dropdown" | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' | |||
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}" | |||
name="spec_id"> | |||
</select> | |||
</div> | |||
@@ -208,6 +208,7 @@ | |||
context.value = '' | |||
$(".icon.icons").css("visibility", "hidden") | |||
} | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form').form({ | |||
on: 'blur', | |||
@@ -219,11 +220,17 @@ | |||
type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', | |||
} | |||
] | |||
}, | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
onSuccess: function(){ | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -231,6 +238,7 @@ | |||
validate(); | |||
let createFlag = false | |||
form.onsubmit = function (e) { | |||
if (!isValidate) return false; | |||
if(createFlag) return false | |||
let value_task = $("input[name='display_job_name']").val() | |||
let value_image = $("input[name='image']").val() | |||
@@ -298,7 +306,7 @@ | |||
} | |||
selected_value = $("#cloudbrain_benchmark_category").val() | |||
$('#store_category').attr("value", selected_value) | |||
validate(); | |||
}) | |||
;(function() { | |||
@@ -258,7 +258,7 @@ | |||
<div class="required min_title inline field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
<select id="__specs__" class="ui dropdown width48" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" | |||
<select id="__specs__" class="ui dropdown width48" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" ovalue="{{.spec_id}}" | |||
name="spec_id"> | |||
</select> | |||
</div> | |||
@@ -354,7 +354,8 @@ | |||
$('select.dropdown') | |||
.dropdown(); | |||
var isValidate = false; | |||
function validate() { | |||
$('.ui.form') | |||
.form({ | |||
@@ -400,13 +401,19 @@ | |||
type: 'empty', | |||
} | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function () { | |||
// $('.ui.page.dimmer').dimmer('show') | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function (e) { | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -206,7 +206,7 @@ | |||
</div>--> | |||
<div class="required min_title inline field" id="flavor_name"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
<select class="ui dropdown width48" id="__specs__" style='width:385px' name="spec_id"></select> | |||
<select class="ui dropdown width48" id="__specs__" style='width:385px' name="spec_id" ovalue="{{.spec_id}}"></select> | |||
</div> | |||
<div class="inline min_title field"> | |||
@@ -296,6 +296,7 @@ | |||
$('select.dropdown') | |||
.dropdown(); | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form') | |||
.form({ | |||
@@ -342,13 +343,19 @@ | |||
type : 'integer[1..25]', | |||
} | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
// $('.ui.page.dimmer').dimmer('show') | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -218,7 +218,7 @@ | |||
</div>--> | |||
<div class="required min_title inline field" id="flavor_name"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
<select class="ui dropdown width48" id="__specs__" style='width:385px' name="spec_id"></select> | |||
<select class="ui dropdown width48" id="__specs__" style='width:385px' name="spec_id" ovalue="{{.spec_id}}"></select> | |||
</div> | |||
<div class="inline required min_title field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label> | |||
@@ -322,6 +322,7 @@ | |||
$('select.dropdown') | |||
.dropdown(); | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form') | |||
.form({ | |||
@@ -359,13 +360,19 @@ | |||
type : 'integer[1..25]', | |||
} | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
// $('.ui.page.dimmer').dimmer('show') | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -275,7 +275,7 @@ | |||
</div>--> | |||
<div class="required min_title inline field" id="flaver_name"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
<select class="ui dropdown width48" id="__specs__" name="spec_id"></select> | |||
<select class="ui dropdown width48" id="__specs__" name="spec_id" ovalue="{{.spec_id}}"></select> | |||
</div> | |||
<!-- 计算节点 --> | |||
<div class="inline required min_title field"> | |||
@@ -465,6 +465,8 @@ | |||
$("input#ai_engine_name").val(name1) | |||
$("input#ai_flaver_name").val(name2) | |||
} | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form') | |||
.form({ | |||
@@ -518,12 +520,18 @@ | |||
type: 'empty', | |||
} | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -79,7 +79,7 @@ | |||
</div>--> | |||
<div class="inline required field"> | |||
<label>{{.i18n.Tr "cloudbrain.specification"}}</label> | |||
<select id="__specs__" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="spec_id"></select> | |||
<select id="__specs__" class="ui search dropdown" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="spec_id" ovalue="{{.spec_id}}"></select> | |||
</div> | |||
<!--<div class="inline required field"> | |||
<label>数据集存放路径</label> | |||
@@ -109,6 +109,7 @@ | |||
$('#messageInfo').css('display','none') | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form').form({ | |||
on: 'blur', | |||
@@ -120,11 +121,17 @@ | |||
type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', | |||
} | |||
] | |||
}, | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
onSuccess: function(){ | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -132,7 +139,8 @@ | |||
validate(); | |||
let createFlag = false | |||
form.onsubmit = function(e){ | |||
if(createFlag) return false | |||
if(!isValidate) return false; | |||
if(createFlag) return false; | |||
let value_task = $("input[name='display_job_name']").val() | |||
let re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ | |||
let flag = re.test(value_task) | |||
@@ -283,7 +283,7 @@ | |||
</div>--> | |||
<div class="required inline min_title field" id="flaver_name"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
<select class="ui dropdown width48" id="__specs__" name="spec_id"></select> | |||
<select class="ui dropdown width48" id="__specs__" name="spec_id" ovalue="{{.spec_id}}"></select> | |||
</div> | |||
<div class="inline required min_title field"> | |||
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label> | |||
@@ -464,6 +464,7 @@ | |||
$('select.dropdown') | |||
.dropdown(); | |||
var isValidate = false; | |||
function validate() { | |||
$('.ui.form') | |||
.form({ | |||
@@ -503,11 +504,17 @@ | |||
] | |||
} | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
onSuccess: function () { | |||
// $('.ui.page.dimmer').dimmer('show') | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function (e) { | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -263,7 +263,7 @@ | |||
</div>--> | |||
<div class="required unite min_title inline field" id="flaver_name"> | |||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
<select id="__specs__" class="ui dropdown width81" style='width:385px' name="spec_id"></select> | |||
<select id="__specs__" class="ui dropdown width81" style='width:385px' name="spec_id" ovalue="{{.spec_id}}"></select> | |||
</div> | |||
<div class="inline required unite min_title field"> | |||
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label> | |||
@@ -431,53 +431,7 @@ | |||
$('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个字符。' | |||
} | |||
] | |||
}, | |||
display_job_name:{ | |||
identifier : 'display_job_name', | |||
rules: [ | |||
{ | |||
type: 'regExp[/^[a-zA-Z0-9-_]{1,36}$/]', | |||
prompt : '只包含大小写字母、数字、_和-,最长36个字符。' | |||
} | |||
] | |||
}, | |||
attachment:{ | |||
identifier : 'attachment', | |||
rules: [ | |||
{ | |||
type: 'empty', | |||
prompt : '选择一个数据集' | |||
} | |||
] | |||
}, | |||
}, | |||
}) | |||
var isValidate = false; | |||
function validate(){ | |||
$('.ui.form') | |||
.form({ | |||
@@ -521,12 +475,18 @@ | |||
] | |||
}, | |||
spec_id: { | |||
identifier: 'spec_id', | |||
rules: [{ type: 'empty' }] | |||
} | |||
}, | |||
onSuccess: function(){ | |||
// $('.ui.page.dimmer').dimmer('show') | |||
document.getElementById("mask").style.display = "block" | |||
isValidate = true; | |||
}, | |||
onFailure: function(e){ | |||
isValidate = false; | |||
return false; | |||
} | |||
}) | |||
@@ -21,9 +21,11 @@ window.renderSpecStr = (spec, showPoint, langObj) => { | |||
window.renderSpecsSelect = (specsSel, data, showPoint, langObj) => { | |||
specsSel.empty(); | |||
data = data || []; | |||
var oValue = specsSel.attr('ovalue'); | |||
for (var i = 0, iLen = data.length; i < iLen; i++) { | |||
var spec = data[i]; | |||
var specStr = window.renderSpecStr(spec, showPoint, langObj); | |||
specsSel.append(`<option name="spec_id" value="${spec.ID}" queueCode="${spec.QueueCode}">${specStr}</option>`); | |||
} | |||
} | |||
oValue && specsSel.val(oValue); | |||
} |