| @@ -803,6 +803,8 @@ modelarts.train_job.parameter_description=作业参数描述 | |||
| modelarts.log=日志 | |||
| modelarts.version_manage=版本管理 | |||
| modelarts.back=返回 | |||
| modelarts.train_job_para_admin=作业参数管理 | |||
| modelarts.train_job_para.edit=编辑 | |||
| template.items=模板选项 | |||
| @@ -0,0 +1,41 @@ | |||
| <style> | |||
| .dis { | |||
| margin-bottom: 20px; | |||
| } | |||
| .disabled { | |||
| cursor: pointer; | |||
| pointer-events: none; | |||
| } | |||
| .ui.segment.bottom.attached { | |||
| border: none; | |||
| } | |||
| .ui.secondary.vertical.pointing.menu{ | |||
| border-right-width: 0px !important; | |||
| } | |||
| .vertical.menu .item { | |||
| border-right-color: white !important; | |||
| } | |||
| .vertical.menu .activate.item { | |||
| font-weight: 700; | |||
| } | |||
| </style> | |||
| <div class="three wide column"> | |||
| <div class="ui grid"> | |||
| <div class="sixteen wide column ui secondary sticky pointing tabular vertical menu"> | |||
| <a class="{{if .PageIsNotebook}}active{{end}} item" href="{{.RepoLink}}/modelarts/notebook"> | |||
| {{svg "octicon-repo" 16}} {{.i18n.Tr "repo.modelarts.nodebook"}} | |||
| </a> | |||
| <a class="{{if .PageIsTrainJob}}active{{end}} item" href="{{.RepoLink}}/modelarts/train-job"> | |||
| {{svg "octicon-inbox" 16}} {{.i18n.Tr "repo.modelarts.train_job"}} | |||
| </a> | |||
| <a class="{{if .PageIsParaManage}}active{{end}} item" href="{{.RepoLink}}/modelarts/train-job/para-manage"> | |||
| {{svg "octicon-inbox" 16}} {{.i18n.Tr "repo.modelarts.train_job_para_admin"}} | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -27,52 +27,14 @@ | |||
| background-color: #f2dede; | |||
| border-color: #ebccd1; | |||
| } | |||
| .dis { | |||
| margin-bottom: 20px; | |||
| } | |||
| .disabled { | |||
| cursor: pointer; | |||
| pointer-events: none; | |||
| } | |||
| .ui.segment.bottom.attached { | |||
| border: none; | |||
| } | |||
| .ui.secondary.vertical.pointing.menu{ | |||
| border-right-width: 0px !important; | |||
| } | |||
| .vertical.menu .item { | |||
| border-right-color: white !important; | |||
| } | |||
| .vertical.menu .activate.item { | |||
| font-weight: 700; | |||
| } | |||
| </style> | |||
| <div class="modelarts"> | |||
| <div class="repository release dataset-list view container"> | |||
| <div class="alert"></div> | |||
| {{template "repo/header" .}} | |||
| <div class="ui container"> | |||
| <div class="ui container"> | |||
| <div class="ui grid"> | |||
| <div class="three wide column"> | |||
| <div class="ui grid"> | |||
| <div class="sixteen wide column ui secondary sticky pointing tabular vertical menu"> | |||
| <a class="activate item" href="{{.RepoLink}}/modelarts/notebook"> | |||
| {{svg "octicon-repo" 16}} {{.i18n.Tr "repo.modelarts.nodebook"}} | |||
| </a> | |||
| <a class="item" href="{{.RepoLink}}/modelarts/train-job"> | |||
| {{svg "octicon-inbox" 16}} {{.i18n.Tr "repo.modelarts.train_job"}} | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "repo/modelarts/navbar" .}} | |||
| <!-- 右侧 --> | |||
| <div class="ui thirteen wide column"> | |||
| <div class="ui three column stackable grid"> | |||
| @@ -202,11 +164,7 @@ | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| $(".vertical.menu a").click(function(){ | |||
| $(this).siblings().removeClass("activate") | |||
| $(this).addClass("activate") | |||
| }) | |||
| // 调试和评分新开窗口 | |||
| // 调试新开窗口 | |||
| function stop(obj) { | |||
| if (obj.style.color != "rgb(204, 204, 204)") { | |||
| obj.target = '_blank' | |||
| @@ -28,9 +28,7 @@ | |||
| border-color: #ebccd1; | |||
| } | |||
| .dis { | |||
| margin-bottom: 20px; | |||
| } | |||
| /* | |||
| .disabled { | |||
| cursor: pointer; | |||
| @@ -51,7 +49,7 @@ | |||
| .vertical.menu .activate.item { | |||
| font-weight: 700; | |||
| } | |||
| } */ | |||
| </style> | |||
| <div class="modelarts"> | |||
| <div class="repository release modelarts train_job view container"> | |||
| @@ -61,18 +59,7 @@ | |||
| <div class="ui container"> | |||
| <div class="ui grid"> | |||
| <div class="three wide column"> | |||
| <div class="ui grid"> | |||
| <div class="sixteen wide column ui secondary sticky pointing tabular vertical menu"> | |||
| <a class="item" href="{{.RepoLink}}/modelarts/notebook"> | |||
| {{svg "octicon-repo" 16}} {{.i18n.Tr "repo.modelarts.nodebook"}} | |||
| </a> | |||
| <a class="activate item" href="{{.RepoLink}}/modelarts/train-job"> | |||
| {{svg "octicon-inbox" 16}} {{.i18n.Tr "repo.modelarts.train_job"}} | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "repo/modelarts/navbar" .}} | |||
| <!-- 右侧 --> | |||
| <div class="ui thirteen wide column"> | |||
| <div class="ui three column stackable grid"> | |||
| @@ -123,13 +110,8 @@ | |||
| <!-- 运行时长 --> | |||
| <div class="three wide center column"> | |||
| <span class="ui text center">{{svg "octicon-clock" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span> | |||
| </div> | |||
| <!-- 任务创建时间 --> | |||
| <!-- <div class="three wide column"> | |||
| <span class="ui text center">{{svg "octicon-flame" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span> | |||
| </div> --> | |||
| </div> | |||
| <!-- 删除 --> | |||
| <div class="two wide center column"> | |||
| @@ -1,127 +0,0 @@ | |||
| {{template "base/head" .}} | |||
| <div class="repository view"> | |||
| {{template "repo/header" .}} | |||
| <style> | |||
| .ui.segment.bottom.attached { | |||
| border: none; | |||
| } | |||
| .ui.secondary.vertical.pointing.menu{ | |||
| border-right-width: 0; | |||
| margin-right: 0; | |||
| border-right-color: white; | |||
| margin-top: 14px; | |||
| } | |||
| </style> | |||
| <div class="modelarts train_job container"> | |||
| <div class="ui container"> | |||
| <div class="ui grid"> | |||
| <div class="three wide column"> | |||
| <div class="ui grid"> | |||
| <div class="sixteen wide column ui secondary sticky pointing tabular vertical menu"> | |||
| <a class="{{if .PageIsExploreRepositories}}active{{end}} item" href="{{AppSubUrl}}/explore/repos"> | |||
| {{svg "octicon-repo" 16}} {{.i18n.Tr "explore.repos"}} | |||
| </a> | |||
| <a class="{{if .PageIsDatasets}}active{{end}} item" href="{{AppSubUrl}}/explore/datasets"> | |||
| {{svg "octicon-inbox" 16}} {{.i18n.Tr "datasets"}} | |||
| </a> | |||
| <a class="{{if .PageIsExploreUsers}}active{{end}} item" href="{{AppSubUrl}}/explore/users"> | |||
| {{svg "octicon-person" 16}} {{.i18n.Tr "explore.users"}} | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <!-- 右侧 --> | |||
| <div class="ui thirteen wide column"> | |||
| <div class="ui three column stackable grid"> | |||
| <div class="column"> | |||
| <h2>{{.i18n.Tr "repo.modelarts.train_job"}}</h2> | |||
| </div> | |||
| <div class="column"> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| <a class="ui green button" href="{{.RepoLink}}/modelarts/notebook/create">{{.i18n.Tr "repo.modelarts.train_job.new"}}</a> | |||
| </div> | |||
| </div> | |||
| <div class="ui divider"></div> | |||
| <div class="ui thirteen wide column"> | |||
| <div class="ui thirteen wide column"> | |||
| <div class="ui two column stackable grid"> | |||
| <div class="column"> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| <div class="ui right dropdown type jump item"> | |||
| <span class="text"> | |||
| {{.i18n.Tr "repo.issues.filter_sort"}}<i class="dropdown icon"></i> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <!-- 任务展示 --> | |||
| <div class="train_job list"> | |||
| {{range .Tasks}} | |||
| <div class="ui grid stackable item"> | |||
| <div class="row"> | |||
| <!-- 任务名 --> | |||
| <div class="four wide column"> | |||
| <a class="title" href="{{$.Link}}/{{.JobID}}"> | |||
| <span class="fitted">{{svg "octicon-tasklist" 16}}</span> | |||
| <span class="fitted">{{.JobName}}</span> | |||
| </a> | |||
| </div> | |||
| <!--引擎类型状态 --> | |||
| <div class="two wide column job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}"> | |||
| {{.Status}} | |||
| </div> | |||
| <!-- 任务创建时间 --> | |||
| <div class="three wide column"> | |||
| <span class="ui text center">{{svg "octicon-flame" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span> | |||
| </div> | |||
| <!-- 查看 --> | |||
| <div class="one wide column"> | |||
| <span class="ui text center clipboard"> | |||
| <a class="title" href="{{$.Link}}/{{.JobID}}"> | |||
| <span class="fitted">查看</span> | |||
| </a> | |||
| </span> | |||
| </div> | |||
| <!-- 删除 --> | |||
| <div class="two wide column"> | |||
| <div class="ui text center clipboard"> | |||
| <form id="delForm-{{.JobID}}" action="{{if ne .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/del{{end}}" method="post"> | |||
| {{$.CsrfTokenHtml}} | |||
| <a class="fitted" onclick="assertDelete(this)" style="{{if ne .Status "STOPPED"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">删除</a> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| <!-- 停止 --> | |||
| <div class="two wide column"> | |||
| <div class="ui text center clipboard"> | |||
| <form id="stopForm-{{.JobID}}" action="{{if ne .Status "RUNNING"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post"> | |||
| {{$.CsrfTokenHtml}} | |||
| <a class="fitted" onclick="document.getElementById('stopForm-{{.JobID}}').submit();" style="{{if ne .Status "RUNNING"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">停止</a> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{end}} {{template "base/paginate" .}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| @@ -0,0 +1,154 @@ | |||
| {{template "base/head" .}} | |||
| <div class="modelarts"> | |||
| <div class="repository release modelarts train_job view container"> | |||
| {{template "repo/header" .}} | |||
| <div class="ui container"> | |||
| <div class="ui grid"> | |||
| {{template "repo/modelarts/navbar" .}} | |||
| <!-- 右侧 --> | |||
| <div class="ui thirteen wide column"> | |||
| <div class="ui column stackable grid"> | |||
| <div class="column"> | |||
| <h2>{{.i18n.Tr "repo.modelarts.train_job_para_admin"}}</h2> | |||
| </div> | |||
| </div> | |||
| <div class="ui divider"></div> | |||
| <div class="ui grid"> | |||
| <div class="row"> | |||
| <div class="ui sixteen wide column"> | |||
| <div class="ui sixteen wide column"> | |||
| <div class="ui two column stackable grid"> | |||
| <div class="column"> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| <div class="ui right dropdown type jump item"> | |||
| <span class="text"> | |||
| {{.i18n.Tr "repo.issues.filter_sort"}}<i class="dropdown icon"></i> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <!-- 任务展示 --> | |||
| <div class="dataset list"> | |||
| {{range .Para_manage}} | |||
| <div class="ui grid stackable item"> | |||
| <div class="row"> | |||
| <!-- 任务名 --> | |||
| <div class="five wide column"> | |||
| <a class="title" href="{{$.Link}}/{{.JobID}}"> | |||
| <span class="fitted">{{svg "octicon-tasklist" 16}}</span> | |||
| <span class="fitted">{{.JobName}}</span> | |||
| </a> | |||
| </div> | |||
| <!-- 引擎类型--> | |||
| <div class="four wide column job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}"> | |||
| {{.Status}} | |||
| </div> | |||
| <!-- 创建时间 --> | |||
| <div class="three wide column"> | |||
| <span class="ui text center">{{svg "octicon-clock" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span> | |||
| </div> | |||
| <!-- 编辑 --> | |||
| <div class="two wide column"> | |||
| <a class="title" href="{{$.Link}}/{{.JobID}}/edit"> | |||
| <span class="fitted">编辑</span> | |||
| </a> | |||
| </div> | |||
| <!-- 删除 --> | |||
| <div class="two wide column"> | |||
| <div class="ui text center clipboard"> | |||
| <form id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> | |||
| {{$.CsrfTokenHtml}} | |||
| <a class="fitted" onclick="assertDelete(this)" style="font-size:16px; font-weight:bold">删除</a> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{end}} {{template "base/paginate" .}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <!-- 确认模态框 --> | |||
| <div id="deletemodel"> | |||
| <div class="ui basic modal"> | |||
| <div class="ui icon header"> | |||
| <i class="trash icon"></i> 删除任务 | |||
| </div> | |||
| <div class="content"> | |||
| <p>你确认删除该任务么?此任务一旦删除不可恢复。</p> | |||
| </div> | |||
| <div class="actions"> | |||
| <div class="ui red basic inverted cancel button"> | |||
| <i class="remove icon"></i> 取消操作 | |||
| </div> | |||
| <div class="ui green basic inverted ok button"> | |||
| <i class="checkmark icon"></i> 确定操作 | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| // 删除时用户确认 | |||
| function assertDelete(obj) { | |||
| if (obj.style.color == "rgb(204, 204, 204)") { | |||
| return | |||
| } else { | |||
| var delId = obj.parentNode.id | |||
| flag = 1; | |||
| $('.ui.basic.modal') | |||
| .modal({ | |||
| onDeny: function() { | |||
| flag = false | |||
| }, | |||
| onApprove: function() { | |||
| document.getElementById(delId).submit() | |||
| flag = true | |||
| }, | |||
| onHidden: function() { | |||
| if (flag == false) { | |||
| $('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut(); | |||
| } | |||
| } | |||
| }) | |||
| .modal('show') | |||
| } | |||
| } | |||
| // 加载任务状态 | |||
| $(document).ready(function() { | |||
| $(".job-status").each((index, job) => { | |||
| const jobID = job.dataset.jobid; | |||
| const repoPath = job.dataset.repopath; | |||
| if (job.textContent.trim() == 'STOPPED') { | |||
| return | |||
| } | |||
| $.get(`/api/v1/repos/${repoPath}/modelarts/train-job/${jobID}`, (data) => { | |||
| const jobID = data.JobID | |||
| const status = data.JobStatus | |||
| $('#' + jobID).text(status) | |||
| // console.log(data) | |||
| }).fail(function(err) { | |||
| console.log(err); | |||
| }); | |||
| }); | |||
| }); | |||
| </script> | |||