| @@ -282,7 +282,7 @@ | |||
| <div class="row"> | |||
| <!-- 任务名 --> | |||
| <div class="four wide column"> | |||
| <a class="title" href='{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}' title="{{.JobName}}" style="font-size: 14px;"> | |||
| <a class="title" href='{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}' title="{{.JobName}}" style="font-size: 14px;"> | |||
| <span class="fitted text_over" style="width: 90%;vertical-align: middle;">{{.JobName}}</span> | |||
| </a> | |||
| </div> | |||
| @@ -317,12 +317,12 @@ | |||
| <!-- 调试 --> | |||
| {{if .CanDebug}} | |||
| {{if eq .ComputeResource "CPU/GPU"}} | |||
| <a id="model-debug-{{.JobID}}" class='ui basic {{if ne .Status "RUNNING"}} disabled {{else}}blue {{end}}button' href="{{$.RepoLink}}/cloudbrain/{{.JobID}}/debug" target="_blank"> | |||
| {{$.i18n.Tr "repo.debug"}} | |||
| <a id="model-debug-{{.JobID}}" class='ui basic {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button' href="{{$.RepoLink}}/cloudbrain/{{.JobID}}/debug" onclick='debugAgain("{{.JobID}}","{{$.RepoLink}}/cloudbrain/{{.JobID}}/restart");return false' target="_blank"> | |||
| <!-- {{$.i18n.Tr "repo.debug"}} -->再次调试 | |||
| </a> | |||
| {{else}} | |||
| <a id="model-debug-{{.JobID}}" class='ui basic {{if ne .Status "RUNNING"}} disabled {{else}}blue {{end}}button' href="{{$.RepoLink}}/modelarts/notebook/{{.JobID}}/debug" target="_blank"> | |||
| {{$.i18n.Tr "repo.debug"}} | |||
| <a id="model-debug-{{.JobID}}" class='ui basic {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button' href="{{$.RepoLink}}/modelarts/notebook/{{.JobID}}/debug" onclick='debugAgain("{{.JobID}}","{{$.RepoLink}}/modelarts/notebook/{{.JobID}}/restart");return false' target="_blank"> | |||
| <!-- {{$.i18n.Tr "repo.debug"}} -->再次调试 | |||
| </a> | |||
| {{end}} | |||
| {{else}} | |||
| @@ -463,6 +463,7 @@ | |||
| <script> | |||
| // 调试和评分新开窗口 | |||
| const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | |||
| let url={{.RepoLink}} | |||
| let getParam=location.search.split('?debugListType=').pop() | |||
| let dropdownValue = getParam==='all'||getParam==='' ? '全部' : getParam | |||
| @@ -499,7 +500,27 @@ | |||
| .modal('show') | |||
| } | |||
| } | |||
| function debugAgain(jobID,url){ | |||
| console.log(url) | |||
| $.post(url,{_csrf:csrf},(data)=>{ | |||
| let getUrl = url.split('/restart')[0] | |||
| console.log(getUrl) | |||
| $.get(`/api/v1/repos${getUrl}`,(data)=>{ | |||
| const jobID = data.JobID | |||
| const status = data.JobStatus | |||
| console.log("status",status) | |||
| if(status==="RUNNING"){ | |||
| console.log("========status",status) | |||
| $('#model-debug-'+jobID).removeClass('disabled') | |||
| $('#model-debug-'+jobID).addClass('blue') | |||
| $('#model-debug-'+jobID).text('调试') | |||
| $('#model-image-'+jobID).removeClass('disabled') | |||
| $('#model-image-'+jobID).addClass('blue') | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| // 加载任务状态 | |||
| var timeid = window.setInterval(loadJobStatus, 15000); | |||
| $(document).ready(loadJobStatus); | |||
| @@ -508,8 +529,9 @@ | |||
| const jobID = job.dataset.jobid; | |||
| const repoPath = job.dataset.repopath; | |||
| const computeResource = job.dataset.resource | |||
| const initArray = ['STOPPED','FAILED','START_FAILED','CREATE_FAILED'] | |||
| const initArray = ['STOPPED','FAILED','START_FAILED','CREATE_FAILED','SUCCEEDED'] | |||
| if (initArray.includes(job.textContent.trim())) { | |||
| return | |||
| } | |||
| const diffResource = computeResource == "NPU" ? 'modelarts/notebook' : 'cloudbrain' | |||
| @@ -523,15 +545,26 @@ | |||
| if(status==="RUNNING"){ | |||
| $('#model-debug-'+jobID).removeClass('disabled') | |||
| $('#model-debug-'+jobID).addClass('blue') | |||
| $('#model-debug-'+jobID).text('调试') | |||
| $('#model-image-'+jobID).removeClass('disabled') | |||
| $('#model-image-'+jobID).addClass('blue') | |||
| } | |||
| if(status!=="RUNNING"){ | |||
| $('#model-debug-'+jobID).removeClass('blue') | |||
| $('#model-debug-'+jobID).addClass('disabled') | |||
| // $('#model-debug-'+jobID).removeClass('blue') | |||
| // $('#model-debug-'+jobID).addClass('disabled') | |||
| $('#model-image-'+jobID).removeClass('blue') | |||
| $('#model-image-'+jobID).addClass('disabled') | |||
| } | |||
| if(["CREATING","STOPPING","WAITING","STARTING"].includes(status)){ | |||
| $('#model-debug-'+jobID).removeClass('blue') | |||
| $('#model-debug-'+jobID).addClass('disabled') | |||
| } | |||
| if(['STOPPED','FAILED','START_FAILED','CREATE_FAILED','SUCCEEDED'].includes(status)){ | |||
| $('#model-debug-'+jobID).removeClass('disabled') | |||
| $('#model-debug-'+jobID).addClass('blue') | |||
| $('#model-debug-'+jobID).text('再次调试') | |||
| } | |||
| if(["RUNNING","WAITING"].includes(status)){ | |||
| $('#stop-model-debug-'+jobID).removeClass('disabled') | |||