|
@@ -316,21 +316,26 @@ |
|
|
</a> |
|
|
</a> |
|
|
{{end}} --> |
|
|
{{end}} --> |
|
|
<!-- 调试 --> |
|
|
<!-- 调试 --> |
|
|
{{if .CanDebug}} |
|
|
|
|
|
{{if eq .ComputeResource "CPU/GPU"}} |
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
|
<form id="debugAgainForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/restart" method="POST"> |
|
|
|
|
|
{{$.CsrfTokenHtml}} |
|
|
|
|
|
{{if .CanDebug}} |
|
|
|
|
|
{{if eq .Status "RUNNING"}} |
|
|
|
|
|
<a style="margin: 0 1rem;" id="model-debug-{{.JobID}}" class='ui basic blue button' onclick='debugAgain("{{.JobID}}","{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/debug")'> |
|
|
|
|
|
{{$.i18n.Tr "repo.debug"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
{{else}} |
|
|
|
|
|
<a id="model-debug-{{.JobID}}" class='ui basic {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button' onclick='debugAgain("{{.JobID}}","{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/debug")'> |
|
|
|
|
|
{{$.i18n.Tr "repo.debug_again"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
{{end}} |
|
|
{{else}} |
|
|
{{else}} |
|
|
<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 class="ui basic disabled button"> |
|
|
|
|
|
{{$.i18n.Tr "repo.debug_again"}} |
|
|
</a> |
|
|
</a> |
|
|
{{end}} |
|
|
{{end}} |
|
|
{{else}} |
|
|
|
|
|
<a class="ui basic disabled button"> |
|
|
|
|
|
{{$.i18n.Tr "repo.debug"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
{{end}} |
|
|
|
|
|
|
|
|
</form> |
|
|
|
|
|
|
|
|
<!-- 停止 --> |
|
|
<!-- 停止 --> |
|
|
<form id="stopForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;"> |
|
|
<form id="stopForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/stop" method="post" style="margin-left:-1px;"> |
|
|
{{$.CsrfTokenHtml}} |
|
|
{{$.CsrfTokenHtml}} |
|
@@ -501,25 +506,13 @@ |
|
|
.modal('show') |
|
|
.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') |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
function debugAgain(JobID,debugUrl){ |
|
|
|
|
|
console.log() |
|
|
|
|
|
if($('#' + JobID+ '-text').text()==="RUNNING"){ |
|
|
|
|
|
window.open(debugUrl) |
|
|
|
|
|
}else{ |
|
|
|
|
|
document.getElementById(`debugAgainForm-${JobID}`).submit(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 加载任务状态 |
|
|
// 加载任务状态 |
|
@@ -549,6 +542,7 @@ |
|
|
$('#model-debug-'+jobID).text('调试') |
|
|
$('#model-debug-'+jobID).text('调试') |
|
|
$('#model-image-'+jobID).removeClass('disabled') |
|
|
$('#model-image-'+jobID).removeClass('disabled') |
|
|
$('#model-image-'+jobID).addClass('blue') |
|
|
$('#model-image-'+jobID).addClass('blue') |
|
|
|
|
|
$('#model-debug-'+jobID).css("margin","0 1rem") |
|
|
} |
|
|
} |
|
|
if(status!=="RUNNING"){ |
|
|
if(status!=="RUNNING"){ |
|
|
// $('#model-debug-'+jobID).removeClass('blue') |
|
|
// $('#model-debug-'+jobID).removeClass('blue') |
|
|