| @@ -775,6 +775,52 @@ cloudbrain_task = Task Name | |||
| cloudbrain_operate = Operate | |||
| cloudbrain_status_createtime = Status/Createtime | |||
| modelarts.notebook=Debug Job | |||
| modelarts.train_job=Create Job | |||
| modelarts.train_job.new=New Job | |||
| modelarts.train_job.basic_info=Basic Info | |||
| modelarts.train_job.job_status=Job Status | |||
| modelarts.train_job.job_name=Job Name | |||
| modelarts.train_job.version=Job Version | |||
| modelarts.train_job.start_time=Start Time | |||
| modelarts.train_job.dura_time=Duration Time | |||
| modelarts.train_job.description=Description | |||
| modelarts.train_job.parameter_setting=Parameter setting | |||
| modelarts.train_job.parameter_setting_info=Parameter Info | |||
| modelarts.train_job.fast_parameter_setting=fast_parameter_setting | |||
| modelarts.train_job.fast_parameter_setting_config=fast_parameter_setting_config | |||
| modelarts.train_job.fast_parameter_setting_config_link=fast_parameter_setting_config_link | |||
| modelarts.train_job.frames=frames | |||
| modelarts.train_job.algorithm_origin=算法来源 | |||
| modelarts.train_job.AI_driver=AI Engine | |||
| modelarts.train_job.start_file=启动文件 | |||
| modelarts.train_job.boot_file_helper=启动文件是您程序执行的入口文件,必须是以.py结尾的文件。 | |||
| modelarts.train_job.dataset=Dataset | |||
| modelarts.train_job.run_parameter=Run Parameter | |||
| modelarts.train_job.add_run_parameter=Add Run Parameter | |||
| modelarts.train_job.parameter_name=Parameter Name | |||
| modelarts.train_job.parameter_value=Parameter Value | |||
| modelarts.train_job.resource_setting=resource_setting | |||
| modelarts.train_job.resource_setting_info=resource_setting_info | |||
| modelarts.train_job.resource_pool=resource_pool | |||
| modelarts.train_job.resource_type=resource_type | |||
| modelarts.train_job.standard=Standard | |||
| modelarts.train_job.NAS_address=NAS地址 | |||
| modelarts.train_job.NAS_mount_path=NAS挂载路径 | |||
| modelarts.train_job.query_whether_save_parameter=query_whether_save_parameter | |||
| modelarts.train_job.save_helper=save_helper | |||
| modelarts.train_job.common_frame=common_frame | |||
| modelarts.train_job.amount_of_compute_node=Amount of Compute Node | |||
| modelarts.train_job.job_parameter_name=job_parameter_name | |||
| modelarts.train_job.parameter_description=parameter_description | |||
| modelarts.log=Log | |||
| modelarts.version_manage=Version Manage | |||
| modelarts.back=Back | |||
| modelarts.train_job_para_admin=train_job_para_admin | |||
| modelarts.train_job_para.edit=train_job_para.edit | |||
| modelarts.train_job_para.connfirm=train_job_para.connfirm | |||
| template.items = Template Items | |||
| template.git_content = Git Content (Default Branch) | |||
| template.git_hooks = Git Hooks | |||
| @@ -302,13 +302,13 @@ func NotebookIndex(ctx *context.Context) { | |||
| pager.SetDefaultParams(ctx) | |||
| ctx.Data["Page"] = pager | |||
| ctx.Data["PageIsNotebook"] = true | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| ctx.Data["Tasks"] = ciTasks | |||
| ctx.HTML(200, tplModelArtsNotebookIndex) | |||
| } | |||
| func NotebookNew(ctx *context.Context) { | |||
| ctx.Data["PageIsNotebook"] = true | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| t := time.Now() | |||
| var jobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] | |||
| @@ -347,7 +347,7 @@ func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm) | |||
| } | |||
| func NotebookShow(ctx *context.Context) { | |||
| ctx.Data["PageIsNotebook"] = true | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| var jobID = ctx.Params(":jobid") | |||
| task, err := models.GetCloudbrainByJobID(jobID) | |||
| @@ -518,13 +518,13 @@ func TrainJobIndex(ctx *context.Context) { | |||
| pager.SetDefaultParams(ctx) | |||
| ctx.Data["Page"] = pager | |||
| ctx.Data["PageIsTrainJob"] = true | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| ctx.Data["Tasks"] = tasks | |||
| ctx.HTML(200, tplModelArtsTrainJobIndex) | |||
| } | |||
| func TrainJobNew(ctx *context.Context) { | |||
| ctx.Data["PageIsTrainJob"] = true | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| can, err := canUserCreateTrainJob(ctx.User.ID) | |||
| if err != nil { | |||
| @@ -828,7 +828,7 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error { | |||
| } | |||
| func TrainJobShow(ctx *context.Context) { | |||
| ctx.Data["PageIsTrainJob"] = true | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| var jobID = ctx.Params(":jobid") | |||
| task, err := models.GetCloudbrainByJobID(jobID) | |||
| @@ -202,30 +202,6 @@ | |||
| <div class="ui container"> | |||
| <!-- 中间云脑和新建任务按钮 --> | |||
| <!-- <div class="ui three column stack able grid"> | |||
| <div class="column"> | |||
| <h2>{{.i18n.Tr "repo.cloudbrain2"}}</h2> | |||
| </div> | |||
| <div class="column"> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| {{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| <a class="ui green button" href="{{.RepoLink}}/modelarts/create">{{.i18n.Tr "repo.cloudbrain.new"}}</a> {{end}} | |||
| </div> | |||
| <div class="column right aligned"> | |||
| {{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| <a class="ui blue button" href="{{.RepoLink}}/modelarts/train-job/create">{{.i18n.Tr "repo.cloudbrain.new"}}</a> {{end}} | |||
| </div> | |||
| </div> | |||
| <p>使用鹏城云脑计算资源进行调试,云脑1提供CPU / GPU资源,云脑2提供Ascend NPU资源;调试使用的数据集也需要上传到对应的环境。</p> | |||
| <div class="ui blue mini menu selectcloudbrain"> | |||
| <a class="item" href="{{.RepoLink}}/cloudbrain">{{svg "octicon-server" 16}} CPU / GPU</a> | |||
| <a class="active item" href="{{.RepoLink}}/modelarts">{{svg "octicon-server" 16}} Ascend NPU</a> | |||
| </div> --> | |||
| <div class="ui two column stackable grid "> | |||
| @@ -202,30 +202,7 @@ | |||
| <div class="ui container"> | |||
| <!-- 中间云脑和新建任务按钮 --> | |||
| <!-- <div class="ui three column stack able grid"> | |||
| <div class="column"> | |||
| <h2>{{.i18n.Tr "repo.cloudbrain2"}}</h2> | |||
| </div> | |||
| <div class="column"> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| {{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| <a class="ui green button" href="{{.RepoLink}}/modelarts/create">{{.i18n.Tr "repo.cloudbrain.new"}}</a> {{end}} | |||
| </div> | |||
| <div class="column right aligned"> | |||
| {{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| <a class="ui blue button" href="{{.RepoLink}}/modelarts/train-job/create">{{.i18n.Tr "repo.cloudbrain.new"}}</a> {{end}} | |||
| </div> | |||
| </div> | |||
| <p>使用鹏城云脑计算资源进行调试,云脑1提供CPU / GPU资源,云脑2提供Ascend NPU资源;调试使用的数据集也需要上传到对应的环境。</p> | |||
| <div class="ui blue mini menu selectcloudbrain"> | |||
| <a class="item" href="{{.RepoLink}}/cloudbrain">{{svg "octicon-server" 16}} CPU / GPU</a> | |||
| <a class="active item" href="{{.RepoLink}}/modelarts">{{svg "octicon-server" 16}} Ascend NPU</a> | |||
| </div> --> | |||
| <div class="ui two column stackable grid "> | |||
| @@ -1,13 +1,109 @@ | |||
| {{template "base/head" .}} | |||
| <div class="ui page dimmer"> | |||
| <div class="ui text loader">{{.i18n.Tr "loading"}}</div> | |||
| <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> | |||
| <div class="repository"> | |||
| {{template "repo/header" .}} | |||
| <div class="repository new repo ui middle very relaxed page grid"> | |||
| <div class="column"> | |||
| {{template "base/alert" .}} | |||
| <form class="ui form" action="{{.Link}}" method="post"> | |||
| <div class="ui positive message" id="messageInfo"> | |||
| <p></p> | |||
| </div> | |||
| <form class="ui form" id="form_id" action="{{.Link}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| <h3 class="ui top attached header"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| @@ -19,31 +115,37 @@ | |||
| <input name="job_name" id="cloudbrain_job_name" placeholder="任务名称" value="{{.job_name}}" tabindex="3" autofocus required maxlength="255"> | |||
| </div> | |||
| <div class="inline required field"> | |||
| <div class="inline field"> | |||
| <label>数据集</label> | |||
| <select id="cloudbrain_dataset" class="ui search dropdown" placeholder="选择数据集" style='width:385px' name="attachment"> | |||
| <input type="text" list="cloudbrain_dataset" placeholder="选择数据集" name="" id="answerInput" autofocus maxlength="36"> | |||
| <datalist id="cloudbrain_dataset" class="ui search" style='width:385px' name="attachment"> | |||
| {{range .attachments}} | |||
| <option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option> | |||
| <option name="attachment" data-value="{{.UUID}}">{{.Attachment.Name}}</option> | |||
| {{end}} | |||
| </select> | |||
| </datalist> | |||
| <input type="hidden" name="attachment" id="answerInput-hidden"> | |||
| </div> | |||
| <div class="inline required field"> | |||
| <label>工作环境</label> | |||
| <input name="de" id="cloudbrain_de" value="{{.env}}" tabindex="3" autofocus required maxlength="255" readonly="readonly"> | |||
| <input name="de" id="cloudbrain_de" value="{{.env}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly"> | |||
| </div> | |||
| <div class="inline required field"> | |||
| <label>类型</label> | |||
| <input name="job_type" id="cloudbrain_job_type" value="{{.notebook_type}}" tabindex="3" autofocus required maxlength="255" readonly="readonly"> | |||
| <input name="job_type" id="cloudbrain_job_type" value="{{.notebook_type}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly"> | |||
| </div> | |||
| <div class="inline required field"> | |||
| <label>规格</label> | |||
| <input name="flavor" id="cloudbrain_flavor" value="{{.flavor}}" tabindex="3" autofocus required maxlength="255" readonly="readonly"> | |||
| <select id="cloudbrain_flavor" class="ui search dropdown" placeholder="选择规格" style='width:385px' name="flavor"> | |||
| {{range .flavors}} | |||
| <option name="flavor" value="{{.Value}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline required field"> | |||
| <label>数据集存放路径</label> | |||
| <input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" autofocus required maxlength="255" readonly="readonly"> | |||
| <input name="dataset_path" id="cloudbrain_dataset_path" value="{{.dataset_path}}" tabindex="3" disabled autofocus required maxlength="255" readonly="readonly"> | |||
| </div> | |||
| <div class="inline field"> | |||
| <label>描述</label> | |||
| @@ -51,7 +153,7 @@ | |||
| </div> | |||
| <div class="inline field"> | |||
| <label></label> | |||
| <button class="ui green button" onclick="showmask()"> | |||
| <button class="ui green button"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| </button> | |||
| <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||
| @@ -64,12 +166,49 @@ | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| // 取消创建跳转 | |||
| let url_href = window.location.pathname.split('create')[0] | |||
| $(".ui.button").attr('href',url_href) | |||
| // 判断必填选项是否填写正确 | |||
| let form = document.getElementById('form_id'); | |||
| $('#messageInfo').css('display','none') | |||
| form.onsubmit = function(e){ | |||
| let value_task = $("input[name='job_name']").val() | |||
| let re = /^[a-z0-9][a-z0-9-_]{1,36}$/ | |||
| let flag = re.test(value_task) | |||
| if(!flag){ | |||
| $('#messageInfo').css('display','block') | |||
| let str = '只能以小写字母或数字开头且只包含小写字母、数字、_和-、最长36个字符。' | |||
| $('#messageInfo p').text(str) | |||
| return false | |||
| } | |||
| let min_value_task = value_task.toLowerCase() | |||
| $("input[name='job_name']").attr("value",min_value_task) | |||
| document.getElementById("mask").style.display = "block" | |||
| } | |||
| // 点击按钮后遮罩层显示 | |||
| // function showmask() { | |||
| // document.getElementById("mask").style.display = "block" | |||
| // } | |||
| // 页面加载完毕后遮罩层隐藏 | |||
| document.onreadystatechange = function() { | |||
| if (document.readyState === "complete") { | |||
| document.getElementById("mask").style.display = "none" | |||
| } | |||
| } | |||
| $('select.dropdown') | |||
| .dropdown(); | |||
| $('.ui.green.button').click(function(){ | |||
| $('.ui.page.dimmer').dimmer('show') | |||
| }) | |||
| $(function() { | |||
| $("#cloudbrain_job_type").change(function() { | |||
| if ($(this).val() == 'BENCHMARK') { | |||
| @@ -79,4 +218,23 @@ | |||
| } | |||
| }) | |||
| }) | |||
| document.querySelector('input[list]').addEventListener('input',function(e){ | |||
| var input = e.target, | |||
| list = input.getAttribute('list'), | |||
| options = document.querySelectorAll('#'+list+' option'), | |||
| hiddenInput = document.getElementById(input.getAttribute('id')+'-hidden'), | |||
| inputValue = input.value; | |||
| hiddenInput.value = inputValue; | |||
| for (let i=0;i<options.length;i++){ | |||
| var option = options[i] | |||
| if(option.innerText===inputValue){ | |||
| hiddenInput.value = option.getAttribute('data-value'); | |||
| break | |||
| } | |||
| } | |||
| }) | |||
| </script> | |||
| @@ -1,4 +1,56 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .unite{ | |||
| font-family: SourceHanSansSC-medium !important; | |||
| color: rgba(16, 16, 16, 100) !important; | |||
| } | |||
| .title{ | |||
| font-size: 16px !important; | |||
| padding-left: 3rem !important; | |||
| } | |||
| .min_title{ | |||
| font-size: 14px !important; | |||
| padding-left: 6rem !important; | |||
| margin-bottom: 2rem !important; | |||
| } | |||
| .width{ | |||
| width:100% !important; | |||
| } | |||
| .width80{ | |||
| width: 80.7% !important; | |||
| margin-left: 10px; | |||
| } | |||
| .width85{ | |||
| width: 85% !important; | |||
| margin-left: 4.5rem !important; | |||
| } | |||
| .width81{ | |||
| margin-left: 1.5rem; | |||
| width: 81% !important; | |||
| } | |||
| .add{font-size: 18px; | |||
| padding: 0.5rem; | |||
| border: 1px solid rgba(187, 187, 187, 100); | |||
| border-radius: 0px 5px 5px 0px; | |||
| line-height: 21px; | |||
| text-align: center; | |||
| color: #C2C7CC; | |||
| } | |||
| .min{ | |||
| font-size: 18px; | |||
| padding: 0.5rem; | |||
| border: 1px solid rgba(187, 187, 187, 100); | |||
| border-radius: 5px 0px 0px 5px; | |||
| line-height: 21px; | |||
| text-align: center; | |||
| color: #C2C7CC;" | |||
| } | |||
| </style> | |||
| <div class="ui page dimmer"> | |||
| <div class="ui text loader">{{.i18n.Tr "loading"}}</div> | |||
| </div> | |||
| @@ -15,19 +67,19 @@ | |||
| <form class="ui form" action="{{.Link}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| <input type="hidden" name="action" value="update"> | |||
| <h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}</h4> | |||
| <div class="required field"> | |||
| <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4> | |||
| <div class="required unite min_title inline field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | |||
| <input 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: 80%;" 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 class="inline field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.version"}}</label> | |||
| <span>第一版本</span> | |||
| </div> | |||
| --> | |||
| <div class="field"> | |||
| <label for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label> | |||
| <textarea id="description" name="description" rows="2"></textarea> | |||
| <div class="unite min_title inline field"> | |||
| <label for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> | |||
| <textarea style="width: 80%;" id="description" name="description" rows="2"></textarea> | |||
| </div> | |||
| <!-- <h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}</h4> | |||
| <div class="inline field"> | |||
| @@ -37,7 +89,31 @@ | |||
| <a class="item active parameter_config">{{.i18n.Tr "repo.modelarts.train_job.fast_parameter_setting_config_link"}}</a> | |||
| </span> | |||
| </div> --> | |||
| <div class="required field"> | |||
| <div class="ui divider"></div> | |||
| <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4> | |||
| <div class="required unite min_title inline fields" style="width: 90%;"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} </label> | |||
| <div class="field" style="flex: 1.5;"> | |||
| <select class="ui search dropdown width" id="trainjob_engines" > | |||
| {{range .engines}} | |||
| <option value="{{.Value}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="field" style="flex: 2;"> | |||
| <select class="ui search dropdown width" id="trainjob_engine_versions" style='width: 100%;' name="engine_id"> | |||
| {{range .engine_versions}} | |||
| <option name="engine_id" value="{{.ID}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| </div> | |||
| <!-- <div class="required inline field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.algorithm_origin"}}</label> | |||
| <div class="ui top attached tabular menu"> | |||
| <a class="item active" data-tab="frame">{{svg "octicon-repo" 16}}{{.i18n.Tr "repo.modelarts.train_job.frames"}}</a> | |||
| @@ -70,26 +146,29 @@ | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="required field"> | |||
| </div> --> | |||
| <div class="required unite min_title inline field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.dataset"}}</label> | |||
| <select class="ui search dropdown" id="trainjob_datasets" style='width:385px' name="attachment"> | |||
| <select class="ui search dropdown width80" id="trainjob_datasets" name="attachment"> | |||
| {{range .attachments}} | |||
| <option name="attachment" value="{{.UUID}}">{{.Attachment.Name}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline field"> | |||
| <div class="inline unite min_title field"> | |||
| <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> | |||
| <!-- <i class="plus square outline icon"></i> --> | |||
| <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"> | |||
| </div> | |||
| <div class="dynamic field" style="margin-top: 1rem;"></div> | |||
| <!-- <div class="dynamic field"> | |||
| </div> --> | |||
| </div> | |||
| <h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.resource_setting"}}</h4> | |||
| <div class="required field"> | |||
| <!-- <h4 class="ui dividing header">{{.i18n.Tr "repo.modelarts.train_job.resource_setting"}}</h4> --> | |||
| <div class="required field " style="display: none;"> | |||
| <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"> | |||
| {{range .resource_pools}} | |||
| @@ -98,7 +177,7 @@ | |||
| </select> | |||
| </div> | |||
| <div class="required grouped fields"> | |||
| <div class="required grouped fields" style="display: none;"> | |||
| <label for="resource_type">{{.i18n.Tr "repo.modelarts.train_job.resource_type"}}</label> | |||
| <div class="field"> | |||
| <div class="ui grid"> | |||
| @@ -114,18 +193,26 @@ | |||
| </div> | |||
| </div> | |||
| <div class="required field"> | |||
| <div class="required unite min_title inline field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui search dropdown" id="trainjob-flavor" style='width:385px' name="flavor"> | |||
| <select class="ui search dropdown width81" id="trainjob-flavor" style='width:385px' name="flavor"> | |||
| {{range .flavor_infos}} | |||
| <option name="flavor" value="{{.Code}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline required field"> | |||
| <div class="inline required unite min_title field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label> | |||
| <input name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255"> | |||
| <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"> | |||
| <span class="add"><i class="plus icon"></i></span> | |||
| </div> | |||
| <!-- <input name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255"> --> | |||
| </div> | |||
| <!-- | |||
| <div class="inline field"> | |||
| <div class="ui save checkbox"> | |||
| @@ -149,7 +236,7 @@ | |||
| </div> | |||
| --> | |||
| <div class="inline field"> | |||
| <div class="inline unite min_title field"> | |||
| <button class="ui create_train_job green button"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| </button> | |||
| @@ -157,81 +244,7 @@ | |||
| </div> | |||
| <!-- 模态框 --> | |||
| <div class="ui parameter modal" style="height: 70%;"> | |||
| <div class="header"> | |||
| {{.i18n.Tr "repo.modelarts.train_job.fast_parameter_setting"}} | |||
| </div> | |||
| <div class="content" style="height:100%"> | |||
| <div class="ui grid" style="height: 100%; margin-top: auto; margin-bottom: auto"> | |||
| <!-- 左侧列表 --> | |||
| <div class="five wide column" style="height:100%"> | |||
| <div class="ui vertical menu" style="height:100%;"> | |||
| <div class="item"> | |||
| <div class="ui input"> | |||
| <input type="text" placeholder="搜索..."> | |||
| </div> | |||
| </div> | |||
| <div class="item" style="height:85%; overflow:auto;"> | |||
| <div class="menu"> | |||
| {{range .config_list}} | |||
| <a class="item">{{.ConfigName}}</a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <!-- 右侧详情 --> | |||
| <div class="eleven wide column content" style="height:100%"> | |||
| <div class="ui green segment" style="height:100%; overflow:auto;"> | |||
| <p>配置详情:</p> | |||
| <table class="ui celled striped table"> | |||
| <tbody> | |||
| <tr> | |||
| <td class="four wide"> {{$.i18n.Tr "repo.modelarts.train_job.job_name"}} </td> | |||
| <td>{{.Result.ConfigName}}</td> | |||
| </tr> | |||
| <tr> | |||
| <td> {{$.i18n.Tr "repo.modelarts.train_job.description"}} </td> | |||
| <td></td> | |||
| </tr> | |||
| <tr> | |||
| <td> {{$.i18n.Tr "repo.modelarts.train_job.dataset"}} </td> | |||
| <td><input id="store_uuid" type="hidden" name="get_uuid"></td> | |||
| </tr> | |||
| <tr> | |||
| <td> {{$.i18n.Tr "repo.modelarts.train_job.start_file"}} </td> | |||
| <td></td> | |||
| </tr> | |||
| <tr> | |||
| <td> {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}} </td> | |||
| <td></td> | |||
| </tr> | |||
| <tr> | |||
| <td> {{$.i18n.Tr "repo.modelarts.train_job.resource_pool"}} </td> | |||
| <td><input id="store_pool_id" type="hidden" name="get_pool_id"></td> | |||
| </tr> | |||
| <tr> | |||
| <td> {{$.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}} </td> | |||
| <td></td> | |||
| </tr> | |||
| </tbody> | |||
| {{end}} | |||
| </table> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="actions"> | |||
| <button class="ui parameter green button"> | |||
| {{.i18n.Tr "repo.confirm_choice"}} | |||
| </button> | |||
| <div class="ui deny button"> | |||
| {{.i18n.Tr "repo.cloudbrain.cancel"}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| @@ -239,15 +252,28 @@ | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| let url_href = window.location.pathname.split('create')[0] | |||
| $(".ui.button").attr('href',url_href) | |||
| $('select.dropdown') | |||
| .dropdown(); | |||
| $('.menu .item') | |||
| .tab(); | |||
| let sever_num = $('#trainjob_work_server_num') | |||
| $('.add').click(function(){ | |||
| sever_num.val(parseInt(sever_num.val())+1) | |||
| }) | |||
| $('.min').click(function(){ | |||
| sever_num.val(parseInt(sever_num.val())-1) | |||
| if(sever_num.val()<=0){ | |||
| sever_num.val(parseInt(sever_num.val())+1) | |||
| } | |||
| }) | |||
| // 参数增加、删除、修改、保存 | |||
| function Add_parameter(i){ | |||
| value = '<div class="two fields" id= "para'+ i +'">' + | |||
| value = '<div class="two fields width85" id= "para'+ i +'">' + | |||
| '<div class="field">' + | |||
| '<input type="text" name="shipping_first-name" placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' + | |||
| '</div> ' + | |||