|
@@ -1,98 +1,6 @@ |
|
|
{{template "base/head" .}} |
|
|
{{template "base/head" .}} |
|
|
<style> |
|
|
|
|
|
/* 遮罩层css效果图 */ |
|
|
|
|
|
#mask { |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
top: 0px; |
|
|
|
|
|
left: 0px; |
|
|
|
|
|
right: 0px; |
|
|
|
|
|
bottom: 0px; |
|
|
|
|
|
filter: alpha(opacity=60); |
|
|
|
|
|
background-color: #777; |
|
|
|
|
|
z-index: 1000; |
|
|
|
|
|
display: none; |
|
|
|
|
|
opacity: 0.8; |
|
|
|
|
|
-moz-opacity: 0.5; |
|
|
|
|
|
padding-top: 100px; |
|
|
|
|
|
color: #000000 |
|
|
|
|
|
} |
|
|
|
|
|
/* 加载圈css效果图 */ |
|
|
|
|
|
|
|
|
|
|
|
#loadingPage { |
|
|
|
|
|
margin: 200px auto; |
|
|
|
|
|
width: 50px; |
|
|
|
|
|
height: 40px; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
font-size: 10px; |
|
|
|
|
|
display: block; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#loadingPage>div { |
|
|
|
|
|
background-color: green; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
width: 6px; |
|
|
|
|
|
display: inline-block; |
|
|
|
|
|
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out; |
|
|
|
|
|
animation: sk-stretchdelay 1.2s infinite ease-in-out; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#loadingPage .rect2 { |
|
|
|
|
|
-webkit-animation-delay: -1.1s; |
|
|
|
|
|
animation-delay: -1.1s; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#loadingPage .rect3 { |
|
|
|
|
|
-webkit-animation-delay: -1.0s; |
|
|
|
|
|
animation-delay: -1.0s; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#loadingPage .rect4 { |
|
|
|
|
|
-webkit-animation-delay: -0.9s; |
|
|
|
|
|
animation-delay: -0.9s; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#loadingPage .rect5 { |
|
|
|
|
|
-webkit-animation-delay: -0.8s; |
|
|
|
|
|
animation-delay: -0.8s; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@-webkit-keyframes sk-stretchdelay { |
|
|
|
|
|
0%, |
|
|
|
|
|
40%, |
|
|
|
|
|
100% { |
|
|
|
|
|
-webkit-transform: scaleY(0.4) |
|
|
|
|
|
} |
|
|
|
|
|
20% { |
|
|
|
|
|
-webkit-transform: scaleY(1.0) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@keyframes sk-stretchdelay { |
|
|
|
|
|
0%, |
|
|
|
|
|
40%, |
|
|
|
|
|
100% { |
|
|
|
|
|
transform: scaleY(0.4); |
|
|
|
|
|
-webkit-transform: scaleY(0.4); |
|
|
|
|
|
} |
|
|
|
|
|
20% { |
|
|
|
|
|
transform: scaleY(1.0); |
|
|
|
|
|
-webkit-transform: scaleY(1.0); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.inline.required.field.cloudbrain_benchmark { |
|
|
|
|
|
display: none; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
<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 class="ui page dimmer"> |
|
|
|
|
|
<div class="ui text loader">{{.i18n.Tr "loading"}}</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="repository"> |
|
|
<div class="repository"> |
|
@@ -103,7 +11,8 @@ |
|
|
{{.i18n.Tr "repo.modelarts.train_job.new"}} |
|
|
{{.i18n.Tr "repo.modelarts.train_job.new"}} |
|
|
</h4> |
|
|
</h4> |
|
|
<div class="ui attached segment"> |
|
|
<div class="ui attached segment"> |
|
|
<form class="ui equal width form" action="{{.Link}}" method="post"> |
|
|
|
|
|
|
|
|
<!-- equal width --> |
|
|
|
|
|
<form class="ui form" action="{{.Link}}" method="post"> |
|
|
{{.CsrfTokenHtml}} |
|
|
{{.CsrfTokenHtml}} |
|
|
<input type="hidden" name="action" value="update"> |
|
|
<input type="hidden" name="action" value="update"> |
|
|
<h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}</h4> |
|
|
<h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}</h4> |
|
@@ -154,7 +63,10 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="inline required field"> |
|
|
<div class="inline required field"> |
|
|
<label>{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> |
|
|
<label>{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> |
|
|
<input name="boot_file" id="trainjob_boot_file" value="{{.dataset_path}}" tabindex="3" autofocus required maxlength="255"> |
|
|
|
|
|
|
|
|
<input name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255"> |
|
|
|
|
|
<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> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@@ -170,9 +82,11 @@ |
|
|
<div class="inline field"> |
|
|
<div class="inline field"> |
|
|
<label>{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> |
|
|
<label>{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> |
|
|
<span id="add_run_para"><i class="plus circle icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> |
|
|
<span id="add_run_para"><i class="plus circle 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"> |
|
|
<div class="dynamic field"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<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"> |
|
|
<div class="required field"> |
|
|
<label>{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label> |
|
|
<label>{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label> |
|
@@ -235,11 +149,12 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="inline field"> |
|
|
<div class="inline field"> |
|
|
<button class="ui create_train_job green button" onclick="showmask()"> |
|
|
|
|
|
|
|
|
<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 class="ui parameter modal" style="height: 70%;"> |
|
|
<div class="ui parameter modal" style="height: 70%;"> |
|
@@ -281,7 +196,8 @@ |
|
|
</tr> |
|
|
</tr> |
|
|
<tr> |
|
|
<tr> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.dataset"}} </td> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.dataset"}} </td> |
|
|
<td>05-express-mongodb.zip</td> |
|
|
|
|
|
|
|
|
<td><input id="store_uuid" type="hidden" name="get_uuid"></td> |
|
|
|
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
<tr> |
|
|
<tr> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.start_file"}} </td> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.start_file"}} </td> |
|
@@ -293,7 +209,8 @@ |
|
|
</tr> |
|
|
</tr> |
|
|
<tr> |
|
|
<tr> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.resource_pool"}} </td> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.resource_pool"}} </td> |
|
|
<td></td> |
|
|
|
|
|
|
|
|
<td><input id="store_pool_id" type="hidden" name="get_pool_id"></td> |
|
|
|
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
<tr> |
|
|
<tr> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}} </td> |
|
|
<td> {{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}} </td> |
|
@@ -323,9 +240,11 @@ |
|
|
<script> |
|
|
<script> |
|
|
$('select.dropdown') |
|
|
$('select.dropdown') |
|
|
.dropdown(); |
|
|
.dropdown(); |
|
|
|
|
|
|
|
|
$('.menu .item') |
|
|
$('.menu .item') |
|
|
.tab(); |
|
|
.tab(); |
|
|
|
|
|
|
|
|
|
|
|
// 参数增加、删除、修改、保存 |
|
|
function Add_parameter(i){ |
|
|
function Add_parameter(i){ |
|
|
value = '<div class="two fields" id= "para'+ i +'">' + |
|
|
value = '<div class="two fields" id= "para'+ i +'">' + |
|
|
'<div class="field">' + |
|
|
'<div class="field">' + |
|
@@ -347,7 +266,6 @@ |
|
|
Add_parameter(len) |
|
|
Add_parameter(len) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".dynamic.field").on("click",".trash.icon", function() { |
|
|
$(".dynamic.field").on("click",".trash.icon", function() { |
|
|
var index = $(this).parent().parent().index() |
|
|
var index = $(this).parent().parent().index() |
|
|
$(this).parent().parent().remove() |
|
|
$(this).parent().parent().remove() |
|
@@ -358,45 +276,16 @@ |
|
|
}) |
|
|
}) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$('.ui.save.checkbox').click(function(){ |
|
|
|
|
|
$('.ui.save.checkbox').checkbox({ |
|
|
|
|
|
onChecked: function() { |
|
|
|
|
|
$('#save_para').removeClass("disabled") |
|
|
|
|
|
}, |
|
|
|
|
|
onUnchecked: function() { |
|
|
|
|
|
$('#save_para').addClass("disabled") |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 点击按钮后遮罩层显示 |
|
|
|
|
|
function showmask() { |
|
|
|
|
|
document.getElementById("mask").style.display = "block" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 页面加载完毕后遮罩层隐藏 |
|
|
|
|
|
document.onreadystatechange = function() { |
|
|
|
|
|
if (document.readyState === "complete") { |
|
|
|
|
|
document.getElementById("mask").style.display = "none" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('.question.circle.icon').hover(function(){ |
|
|
|
|
|
$('.question.circle.icon').popup('show') |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$(".item.active.parameter_config").click(function(){ |
|
|
|
|
|
$('.ui.parameter.modal') |
|
|
|
|
|
.modal('setting', 'closable', false) |
|
|
|
|
|
.modal('show'); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
$('.ui.parameter.green.button').click(function(){ |
|
|
$('.ui.parameter.green.button').click(function(){ |
|
|
var parameters = []; |
|
|
var parameters = []; |
|
|
$('table tr').each(function() { |
|
|
$('table tr').each(function() { |
|
|
$(this).find('td:eq(1)').each(function(){ |
|
|
$(this).find('td:eq(1)').each(function(){ |
|
|
parameters.push($(this).text()); |
|
|
parameters.push($(this).text()); |
|
|
}) |
|
|
}) |
|
|
|
|
|
$(this).find('input').each(function(){ |
|
|
|
|
|
parameters.push($(this).text()) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
console.log(parameters) |
|
|
console.log(parameters) |
|
|
$('.ui.parameter.modal') |
|
|
$('.ui.parameter.modal') |
|
@@ -418,13 +307,13 @@ |
|
|
var para_name = para[j].split('=')[0] |
|
|
var para_name = para[j].split('=')[0] |
|
|
var para_value = para[j].split('=')[1] |
|
|
var para_value = para[j].split('=')[1] |
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
var len = $(".dynamic.field .two.fields").length |
|
|
console.log(len) |
|
|
|
|
|
Add_parameter(len) |
|
|
Add_parameter(len) |
|
|
var pid = 'para' + len |
|
|
var pid = 'para' + len |
|
|
$(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_first-name]").val(para_name) |
|
|
$(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_first-name]").val(para_name) |
|
|
$(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_last-name]").val(para_value) |
|
|
$(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_last-name]").val(para_value) |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
// 数据集pool_id待完成 |
|
|
// case (5): |
|
|
// case (5): |
|
|
// $("select[name='pool_id']").val(parameters[i]); |
|
|
// $("select[name='pool_id']").val(parameters[i]); |
|
|
// break; |
|
|
// break; |
|
@@ -435,18 +324,92 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
$('.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.deny.button').click(function(){ |
|
|
$('.ui.parameter.modal') |
|
|
$('.ui.parameter.modal') |
|
|
.modal('hide'); |
|
|
.modal('hide'); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// $('.ui.create_train_job.green.button').click(function() { |
|
|
|
|
|
// var formData = $(".ui.form").serializeArray(); |
|
|
|
|
|
// var formObject = {}; |
|
|
|
|
|
// for (var item in formData) { |
|
|
|
|
|
// formObject[formData[item].name] = formData[item].value; |
|
|
|
|
|
// } |
|
|
|
|
|
// formData = JSON.stringify(formObject); |
|
|
|
|
|
// alert(formData) |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
function train_job_list_validation(){ |
|
|
|
|
|
$('.field.example form') |
|
|
|
|
|
.form({ |
|
|
|
|
|
on: 'blur', |
|
|
|
|
|
fields: { |
|
|
|
|
|
empty: { |
|
|
|
|
|
identifier : 'empty', |
|
|
|
|
|
rules: [ |
|
|
|
|
|
{ |
|
|
|
|
|
type : 'empty', |
|
|
|
|
|
prompt : 'Please enter a value' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
dropdown: { |
|
|
|
|
|
identifier : 'dropdown', |
|
|
|
|
|
rules: [ |
|
|
|
|
|
{ |
|
|
|
|
|
type : 'empty', |
|
|
|
|
|
prompt : 'Please select a dropdown value' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
checkbox: { |
|
|
|
|
|
identifier : 'checkbox', |
|
|
|
|
|
rules: [ |
|
|
|
|
|
{ |
|
|
|
|
|
type : 'checked', |
|
|
|
|
|
prompt : 'Please check the checkbox' |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('.ui.create_train_job.green.button').click(function(e) { |
|
|
|
|
|
e.preventDefault() |
|
|
|
|
|
var run_parameters = [] |
|
|
|
|
|
$(".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({'name': para_name, "value": para_value}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 后台接收的参数,这个后台根据需要更改相应name属性。 |
|
|
|
|
|
$('#store_run_para').val(run_parameters) |
|
|
|
|
|
|
|
|
|
|
|
// $('.ui.form').form("validate form", { |
|
|
|
|
|
// onSuccess: function(){ |
|
|
|
|
|
// alert(1) |
|
|
|
|
|
// }, |
|
|
|
|
|
// onFailure: function(){ |
|
|
|
|
|
// alert(2) |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// // 加载框加载 |
|
|
|
|
|
// $('.ui.page.dimmer').dimmer('show') |
|
|
|
|
|
}) |
|
|
</script> |
|
|
</script> |