| @@ -125,7 +125,7 @@ | |||||
| <input id="store_category" type="hidden" name="get_benchmark_category"> | <input id="store_category" type="hidden" name="get_benchmark_category"> | ||||
| <div class="inline min_title required field"> | <div class="inline min_title required field"> | ||||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | ||||
| <select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version" | |||||
| <select class="ui dropdown width80 left2" id="code_version" | |||||
| name="branch_name"> | name="branch_name"> | ||||
| {{if .branch_name}} | {{if .branch_name}} | ||||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | ||||
| @@ -216,7 +216,7 @@ | |||||
| <div class="inline field"> | <div class="inline field"> | ||||
| <label class="label-fix-width" style="font-weight: normal;"></label> | <label class="label-fix-width" style="font-weight: normal;"></label> | ||||
| <button class="ui green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | {{.i18n.Tr "repo.cloudbrain.new"}} | ||||
| </button> | </button> | ||||
| <a class="ui button cancel" | <a class="ui button cancel" | ||||
| @@ -231,6 +231,7 @@ | |||||
| </div> | </div> | ||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||
| <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | ||||
| <script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||||
| <script> | <script> | ||||
| let form = document.getElementById('form_id'); | let form = document.getElementById('form_id'); | ||||
| $('#messageInfo').css('display', 'none') | $('#messageInfo').css('display', 'none') | ||||
| @@ -239,67 +240,6 @@ | |||||
| context.value = '' | context.value = '' | ||||
| $(".icon.icons").css("visibility", "hidden") | $(".icon.icons").css("visibility", "hidden") | ||||
| } | } | ||||
| var isValidate = false; | |||||
| function validate(){ | |||||
| $('.ui.form').form({ | |||||
| on: 'blur', | |||||
| fields: { | |||||
| display_job_name:{ | |||||
| identifier : 'display_job_name', | |||||
| rules: [ | |||||
| { | |||||
| type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', | |||||
| } | |||||
| ] | |||||
| }, | |||||
| spec_id: { | |||||
| identifier: 'spec_id', | |||||
| rules: [{ type: 'empty' }] | |||||
| } | |||||
| }, | |||||
| onSuccess: function(){ | |||||
| isValidate = true; | |||||
| }, | |||||
| onFailure: function(e){ | |||||
| isValidate = false; | |||||
| return false; | |||||
| } | |||||
| }) | |||||
| } | |||||
| 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() | |||||
| let value_data = $("input[name='attachment']").val() | |||||
| let re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ | |||||
| let flag = re.test(value_task) | |||||
| if (!flag) { | |||||
| $('#messageInfo').css('display', 'block') | |||||
| let str = '只能以小写字母或数字开头且只包含小写字母、数字、_和-,不能以_结尾,最长36个字符。' | |||||
| $('#messageInfo p').text(str) | |||||
| return false | |||||
| } | |||||
| if($('input[name="model_name"]').val() && !$('input[name="ckpt_name"]').val()){ | |||||
| $('input[name="ckpt_name"]').parent().addClass("error") | |||||
| return false | |||||
| } | |||||
| let min_value_task = value_task.toLowerCase() | |||||
| $("input[name='display_job_name']").attr("value", min_value_task) | |||||
| createFlag = true | |||||
| document.getElementById("mask").style.display = "block" | |||||
| } | |||||
| // 页面加载完毕后遮罩层隐藏 | |||||
| document.onreadystatechange = function () { | |||||
| if (document.readyState === "complete") { | |||||
| document.getElementById("mask").style.display = "none" | |||||
| } | |||||
| } | |||||
| $('#cloudbrain_benchmark_category') | $('#cloudbrain_benchmark_category') | ||||
| .dropdown({ | .dropdown({ | ||||
| placeholder: "选择数据集类别", | placeholder: "选择数据集类别", | ||||
| @@ -334,16 +274,6 @@ | |||||
| } | } | ||||
| }) | }) | ||||
| }) | }) | ||||
| $('.ui.green.button').click(function () { | |||||
| if (!$('input[name="isBranches"]').val()) { | |||||
| return false | |||||
| } | |||||
| selected_value = $("#cloudbrain_benchmark_category").val() | |||||
| $('#store_category').attr("value", selected_value) | |||||
| validate(); | |||||
| }) | |||||
| ;(function() { | ;(function() { | ||||
| var SPECS = {{ .debug_specs }}; | var SPECS = {{ .debug_specs }}; | ||||
| var showPoint = {{ .CloudBrainPaySwitch }}; | var showPoint = {{ .CloudBrainPaySwitch }}; | ||||
| @@ -83,7 +83,7 @@ | |||||
| <div class="ui divider"></div> | <div class="ui divider"></div> | ||||
| <div class="inline min_title required field"> | <div class="inline min_title required field"> | ||||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | ||||
| <select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version" | |||||
| <select class="ui dropdown width80 left2" id="code_version" | |||||
| name="branch_name"> | name="branch_name"> | ||||
| {{if .branch_name}} | {{if .branch_name}} | ||||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | ||||
| @@ -132,7 +132,7 @@ | |||||
| <div class="inline field"> | <div class="inline field"> | ||||
| <label class="label-fix-width" style="font-weight: normal;"></label> | <label class="label-fix-width" style="font-weight: normal;"></label> | ||||
| <button class="ui green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | {{.i18n.Tr "repo.cloudbrain.new"}} | ||||
| </button> | </button> | ||||
| <a class="ui button cancel" | <a class="ui button cancel" | ||||
| @@ -147,65 +147,8 @@ | |||||
| </div> | </div> | ||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||
| <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | ||||
| <script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||||
| <script> | <script> | ||||
| let form = document.getElementById('form_id'); | |||||
| var isValidate = false; | |||||
| function validate(){ | |||||
| $('.ui.form').form({ | |||||
| on: 'blur', | |||||
| fields: { | |||||
| display_job_name:{ | |||||
| identifier : 'display_job_name', | |||||
| rules: [ | |||||
| { | |||||
| type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', | |||||
| } | |||||
| ] | |||||
| }, | |||||
| spec_id: { | |||||
| identifier: 'spec_id', | |||||
| rules: [{ type: 'empty' }] | |||||
| } | |||||
| }, | |||||
| onSuccess: function(){ | |||||
| isValidate = true; | |||||
| }, | |||||
| onFailure: function(e){ | |||||
| isValidate = false; | |||||
| return false; | |||||
| } | |||||
| }) | |||||
| } | |||||
| 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 re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ | |||||
| let flag = re.test(value_task) | |||||
| if (!flag) { | |||||
| $('#messageInfo').css('display', 'block') | |||||
| let str = '只能以小写字母或数字开头且只包含小写字母、数字、_和-,不能以_结尾,最长36个字符。' | |||||
| $('#messageInfo p').text(str) | |||||
| return false | |||||
| } | |||||
| if($('input[name="model_name"]').val() && !$('input[name="ckpt_name"]').val()){ | |||||
| $('input[name="ckpt_name"]').parent().addClass("error") | |||||
| return false | |||||
| } | |||||
| let min_value_task = value_task.toLowerCase() | |||||
| $("input[name='display_job_name']").attr("value", min_value_task) | |||||
| createFlag = true | |||||
| document.getElementById("mask").style.display = "block" | |||||
| } | |||||
| // 页面加载完毕后遮罩层隐藏 | |||||
| document.onreadystatechange = function () { | |||||
| if (document.readyState === "complete") { | |||||
| document.getElementById("mask").style.display = "none" | |||||
| } | |||||
| } | |||||
| ;(function() { | ;(function() { | ||||
| var SPECS = {{ .Specs }}; | var SPECS = {{ .Specs }}; | ||||
| var showPoint = {{ .CloudBrainPaySwitch }}; | var showPoint = {{ .CloudBrainPaySwitch }}; | ||||
| @@ -70,7 +70,7 @@ | |||||
| <div class="ui divider"></div> | <div class="ui divider"></div> | ||||
| <div class="inline min_title required field"> | <div class="inline min_title required field"> | ||||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | ||||
| <select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version" | |||||
| <select class="ui dropdown width80 left2" id="code_version" | |||||
| name="branch_name"> | name="branch_name"> | ||||
| {{if .branch_name}} | {{if .branch_name}} | ||||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | ||||
| @@ -122,7 +122,7 @@ | |||||
| </div> | </div> | ||||
| <div class="inline field"> | <div class="inline field"> | ||||
| <label class="label-fix-width" style="font-weight: normal;"></label> | <label class="label-fix-width" style="font-weight: normal;"></label> | ||||
| <button class="ui green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | {{.i18n.Tr "repo.cloudbrain.new"}} | ||||
| </button> | </button> | ||||
| <a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | <a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | ||||
| @@ -135,81 +135,8 @@ | |||||
| </div> | </div> | ||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||
| <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | ||||
| <script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||||
| <script> | <script> | ||||
| // 判断必填选项是否填写正确 | |||||
| let form = document.getElementById('form_id'); | |||||
| $('#messageInfo').css('display','none') | |||||
| var isValidate = false; | |||||
| function validate(){ | |||||
| $('.ui.form').form({ | |||||
| on: 'blur', | |||||
| fields: { | |||||
| display_job_name:{ | |||||
| identifier : 'display_job_name', | |||||
| rules: [ | |||||
| { | |||||
| type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', | |||||
| } | |||||
| ] | |||||
| }, | |||||
| spec_id: { | |||||
| identifier: 'spec_id', | |||||
| rules: [{ type: 'empty' }] | |||||
| } | |||||
| }, | |||||
| onSuccess: function(){ | |||||
| isValidate = true; | |||||
| }, | |||||
| onFailure: function(e){ | |||||
| isValidate = false; | |||||
| return false; | |||||
| } | |||||
| }) | |||||
| } | |||||
| 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 re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ | |||||
| let flag = re.test(value_task) | |||||
| if(!flag){ | |||||
| $('#messageInfo').css('display','block') | |||||
| let str = '只能以小写字母或数字开头且只包含小写字母、数字、_和-,不能以_结尾,最长36个字符。' | |||||
| $('#messageInfo p').text(str) | |||||
| return false | |||||
| } | |||||
| if($('input[name="model_name"]').val() && !$('input[name="ckpt_name"]').val()){ | |||||
| $('input[name="ckpt_name"]').parent().addClass("error") | |||||
| return false | |||||
| } | |||||
| let min_value_task = value_task.toLowerCase() | |||||
| $("input[name='display_job_name']").attr("value",min_value_task) | |||||
| document.getElementById("mask").style.display = "block" | |||||
| createFlag = true | |||||
| } | |||||
| // 页面加载完毕后遮罩层隐藏 | |||||
| document.onreadystatechange = function() { | |||||
| if (document.readyState === "complete") { | |||||
| document.getElementById("mask").style.display = "none" | |||||
| } | |||||
| } | |||||
| $(document).ready(function(){ | |||||
| $('input[name="image"]').val($('.cloudbrain_image').dropdown('get text')) | |||||
| $('.cloudbrain_image.ui.search.dropdown') | |||||
| .dropdown({ | |||||
| onChange: function(value, text, $selectedItem) { | |||||
| $('input[name="image"]').val(text) | |||||
| } | |||||
| }) | |||||
| $(document).keydown(function(event){ | |||||
| if(event.keyCode==13){ | |||||
| event.preventDefault(); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| ;(function() { | ;(function() { | ||||
| var SPECS = {{ .Specs }}; | var SPECS = {{ .Specs }}; | ||||
| var showPoint = {{ .CloudBrainPaySwitch }}; | var showPoint = {{ .CloudBrainPaySwitch }}; | ||||
| @@ -105,7 +105,7 @@ | |||||
| </div> | </div> | ||||
| <div class="inline field"> | <div class="inline field"> | ||||
| <label class="label-fix-width"></label> | <label class="label-fix-width"></label> | ||||
| <button class="ui green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| <button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> | |||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | {{.i18n.Tr "repo.cloudbrain.new"}} | ||||
| </button> | </button> | ||||
| <a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | <a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | ||||
| @@ -118,74 +118,8 @@ | |||||
| </div> | </div> | ||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||
| <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> | ||||
| <script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script> | |||||
| <script> | <script> | ||||
| // 判断必填选项是否填写正确 | |||||
| let form = document.getElementById('form_id'); | |||||
| $('#messageInfo').css('display','none') | |||||
| var isValidate = false; | |||||
| function validate(){ | |||||
| $('.ui.form').form({ | |||||
| on: 'blur', | |||||
| fields: { | |||||
| display_job_name:{ | |||||
| identifier : 'display_job_name', | |||||
| rules: [ | |||||
| { | |||||
| type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', | |||||
| } | |||||
| ] | |||||
| }, | |||||
| spec_id: { | |||||
| identifier: 'spec_id', | |||||
| rules: [{ type: 'empty' }] | |||||
| } | |||||
| }, | |||||
| onSuccess: function(){ | |||||
| isValidate = true; | |||||
| }, | |||||
| onFailure: function(e){ | |||||
| isValidate = false; | |||||
| return false; | |||||
| } | |||||
| }) | |||||
| } | |||||
| 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 re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ | |||||
| let flag = re.test(value_task) | |||||
| if(!flag){ | |||||
| $('#messageInfo').css('display','block') | |||||
| let str = '只能以小写字母或数字开头且只包含小写字母、数字、_和-,不能以_结尾,最长36个字符。' | |||||
| $('#messageInfo p').text(str) | |||||
| return false | |||||
| } | |||||
| if($('input[name="model_name"]').val() && !$('input[name="ckpt_name"]').val()){ | |||||
| $('input[name="ckpt_name"]').parent().addClass("error") | |||||
| return false | |||||
| } | |||||
| let min_value_task = value_task.toLowerCase() | |||||
| $("input[name='display_job_name']").attr("value",min_value_task) | |||||
| document.getElementById("mask").style.display = "block" | |||||
| createFlag = true | |||||
| } | |||||
| // 页面加载完毕后遮罩层隐藏 | |||||
| document.onreadystatechange = function() { | |||||
| if (document.readyState === "complete") { | |||||
| document.getElementById("mask").style.display = "none" | |||||
| } | |||||
| } | |||||
| $(document).ready(function(){ | |||||
| $(document).keydown(function(event){ | |||||
| if(event.keyCode==13){ | |||||
| event.preventDefault(); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| ;(function() { | ;(function() { | ||||
| var SPECS = {{ .Specs }}; | var SPECS = {{ .Specs }}; | ||||
| var showPoint = {{ .CloudBrainPaySwitch }}; | var showPoint = {{ .CloudBrainPaySwitch }}; | ||||
| @@ -4,6 +4,10 @@ | |||||
| let flag; | let flag; | ||||
| form.onsubmit = function (e) { | form.onsubmit = function (e) { | ||||
| if (createFlag) return false; | if (createFlag) return false; | ||||
| // if($('input[name="model_name"]').val() && !$('input[name="ckpt_name"]').val()){ | |||||
| // $('input[name="ckpt_name"]').parent().addClass("error") | |||||
| // return false | |||||
| // } | |||||
| createFlag = true; | createFlag = true; | ||||
| }; | }; | ||||
| $("select.dropdown").dropdown(); | $("select.dropdown").dropdown(); | ||||
| @@ -108,9 +112,18 @@ | |||||
| identifier: "spec_id", | identifier: "spec_id", | ||||
| rules: [{ type: "empty" }], | rules: [{ type: "empty" }], | ||||
| }, | }, | ||||
| branch_name: { | |||||
| identifier: "branch_name", | |||||
| rules: [{ type: "empty" }], | |||||
| }, | |||||
| }, | }, | ||||
| onSuccess: function () { | onSuccess: function () { | ||||
| // $('.ui.page.dimmer').dimmer('show') | // $('.ui.page.dimmer').dimmer('show') | ||||
| console.log("success") | |||||
| if($('input[name="model_name"]').val() && !$('input[name="ckpt_name"]').val()){ | |||||
| $('input[name="ckpt_name"]').parent().addClass("error") | |||||
| return false | |||||
| } | |||||
| document.getElementById("mask").style.display = "block"; | document.getElementById("mask").style.display = "block"; | ||||
| isValidate = true; | isValidate = true; | ||||
| }, | }, | ||||
| @@ -163,6 +176,7 @@ | |||||
| validate(); | validate(); | ||||
| $(".ui.create_train_job.green.button").click(function (e) { | $(".ui.create_train_job.green.button").click(function (e) { | ||||
| console.log("-=-=-=") | |||||
| get_name(); | get_name(); | ||||
| let paramNotValue = send_run_para(); | let paramNotValue = send_run_para(); | ||||
| if (!paramNotValue) { | if (!paramNotValue) { | ||||