|
|
|
@@ -62,7 +62,7 @@ |
|
|
|
<div class="repository"> |
|
|
|
{{template "repo/header" .}} |
|
|
|
<div class="ui container"> |
|
|
|
<div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-flag-model="true" data-dataset-uuid="{{.uuid}}" data-dataset-name="{{.dataset_name}}"></div> |
|
|
|
<div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-flag-model="true" data-dataset-uuid="{{.attachment}}" data-dataset-name="{{.dataset_name}}"></div> |
|
|
|
{{template "base/alert" .}} |
|
|
|
<h4 class="ui top attached header"> |
|
|
|
{{.i18n.Tr "repo.modelarts.train_job.new"}} |
|
|
|
@@ -216,22 +216,6 @@ |
|
|
|
<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 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}} |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@@ -260,27 +244,6 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</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="trainjob-flavor" name="flavor"> |
|
|
|
{{if .flavor}} |
|
|
|
{{range .flavor_infos}} |
|
|
|
{{if eq $.flavor .Code}} |
|
|
|
<option value="{{.Code}}">{{.Value}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{range .flavor_infos}} |
|
|
|
{{if ne $.flavor .Code}} |
|
|
|
<option value="{{.Code}}">{{.Value}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{else}} |
|
|
|
{{range .flavor_infos}} |
|
|
|
<option name="flavor" value="{{.Code}}">{{.Value}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
</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" ovalue="{{.spec_id}}"></select> |
|
|
|
@@ -353,25 +316,38 @@ |
|
|
|
case 13:return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
$(document).ready(function(){ |
|
|
|
let params = $('.dynamic.field').data('params') |
|
|
|
params&¶ms.parameter.forEach((item,index)=>{ |
|
|
|
Add_parameter(index,flag=true,item) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// 参数增加、删除、修改、保存 |
|
|
|
function Add_parameter(i) { |
|
|
|
function Add_parameter(i,flag=false,paramsObject={}) { |
|
|
|
let value = '' |
|
|
|
value += `<div class="two fields width85" id= "para${i}">` |
|
|
|
value += '<div class="field">' |
|
|
|
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}' |
|
|
|
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}' |
|
|
|
value = '<div class="two fields width85" id= "para' + i + '">' + |
|
|
|
'<div class="field">' + |
|
|
|
'<input type="text" name="shipping_first-name" required placeholder="' + placeholder_name+ '">' + |
|
|
|
'</div> ' + |
|
|
|
'<div class="field"> ' + |
|
|
|
'<input type="text" name="shipping_last-name" required placeholder="' + placeholder_value+ '">' + |
|
|
|
'</div>' + |
|
|
|
'<span>' + |
|
|
|
'<i class="trash icon">' + |
|
|
|
'</i>' + |
|
|
|
'</span>' + |
|
|
|
'</div>' |
|
|
|
if(flag){ |
|
|
|
value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">` |
|
|
|
}else{ |
|
|
|
value +='<input type="text" class="shipping_first-name" required placeholder="' + placeholder_name+ '">' |
|
|
|
} |
|
|
|
value += '</div>' |
|
|
|
value += '<div class="field">' |
|
|
|
if(flag){ |
|
|
|
value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">` |
|
|
|
}else{ |
|
|
|
value +='<input type="text" class="shipping_last-name" required placeholder="' + placeholder_value+ '">' |
|
|
|
} |
|
|
|
value += '</div>' |
|
|
|
value += '<span><i class="trash icon"></i></span>' |
|
|
|
value += '</div>' |
|
|
|
$(".dynamic.field").append(value) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$('#add_run_para').click(function () { |
|
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
|
Add_parameter(len) |
|
|
|
@@ -387,80 +363,13 @@ |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
$('.ui.parameter.green.button').click(function () { |
|
|
|
var parameters = []; |
|
|
|
$('table tr').each(function () { |
|
|
|
$(this).find('td:eq(1)').each(function () { |
|
|
|
parameters.push($(this).text()); |
|
|
|
}) |
|
|
|
$(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; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
$('.ui.save.checkbox').click(function () { |
|
|
|
$(this).checkbox({ |
|
|
|
onChange: function () { |
|
|
|
if ($('.ui.save.checkbox').checkbox('is checked')) { |
|
|
|
$('#save_para').removeClass("disabled") |
|
|
|
|
|
|
|
} else { |
|
|
|
$('#save_para').addClass("disabled") |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
$('.question.circle.icon').hover(function () { |
|
|
|
$(this).popup('show') |
|
|
|
}); |
|
|
|
|
|
|
|
$(".item.active.parameter_config").click(function () { |
|
|
|
$('.ui.parameter.modal') |
|
|
|
.modal('setting', 'closable', false) |
|
|
|
.modal('show'); |
|
|
|
}) |
|
|
|
|
|
|
|
$('.ui.deny.button').click(function () { |
|
|
|
$('.ui.parameter.modal') |
|
|
|
.modal('hide'); |
|
|
|
}) |
|
|
|
$('select.dropdown') |
|
|
|
.dropdown(); |
|
|
|
|
|
|
|
@@ -528,8 +437,8 @@ |
|
|
|
var run_parameters = [] |
|
|
|
var msg = {} |
|
|
|
$(".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() |
|
|
|
var para_name = $(this).find('input.shipping_first-name').val() |
|
|
|
var para_value = $(this).find('input.shipping_last-name').val() |
|
|
|
run_parameters.push({ "label": para_name, "value": para_value }) |
|
|
|
}) |
|
|
|
msg["parameter"] = run_parameters |
|
|
|
|