|
|
@@ -312,9 +312,15 @@ |
|
|
<!-- 调试 --> |
|
|
<!-- 调试 --> |
|
|
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} |
|
|
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} |
|
|
{{if eq .ComputeResource "CPU/GPU"}} |
|
|
{{if eq .ComputeResource "CPU/GPU"}} |
|
|
<a id="model-debug-{{.JobID}}" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.RepoLink}}/cloudbrain/{{.JobID}}/debug" target="_blank"> |
|
|
|
|
|
{{$.i18n.Tr "repo.debug"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
{{if .CanDebug}} |
|
|
|
|
|
<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> |
|
|
|
|
|
{{else}} |
|
|
|
|
|
<a id="model-debug-{{.JobID}}" class="ui basic disabled button" > |
|
|
|
|
|
{{$.i18n.Tr "repo.debug"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
{{end}} |
|
|
{{else}} |
|
|
{{else}} |
|
|
<a id="model-debug-{{.JobID}}" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.RepoLink}}/modelarts/notebook/{{.JobID}}/debug" target="_blank"> |
|
|
<a id="model-debug-{{.JobID}}" class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.RepoLink}}/modelarts/notebook/{{.JobID}}/debug" target="_blank"> |
|
|
{{$.i18n.Tr "repo.debug"}} |
|
|
{{$.i18n.Tr "repo.debug"}} |
|
|
@@ -329,7 +335,7 @@ |
|
|
<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}} |
|
|
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} |
|
|
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} |
|
|
<a id="stop-model-debug-{{.JobID}}" class="ui basic {{if or (eq .Status "STOPPED") (eq .Status "FAILED")}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();"> |
|
|
|
|
|
|
|
|
<a id="stop-model-debug-{{.JobID}}" class='ui basic {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "STOPPING" "CREATING" "STARTING"}}disabled {{else}}blue {{end}}button' onclick="document.getElementById('stopForm-{{.JobID}}').submit();"> |
|
|
{{$.i18n.Tr "repo.stop"}} |
|
|
{{$.i18n.Tr "repo.stop"}} |
|
|
</a> |
|
|
</a> |
|
|
{{else}} |
|
|
{{else}} |
|
|
@@ -338,39 +344,64 @@ |
|
|
</a> |
|
|
</a> |
|
|
{{end}} |
|
|
{{end}} |
|
|
<input type="hidden" name="debugListType" value="all"> |
|
|
<input type="hidden" name="debugListType" value="all"> |
|
|
|
|
|
</form> |
|
|
|
|
|
<!-- 删除 --> |
|
|
|
|
|
<form id="delForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/del" method="post"> |
|
|
|
|
|
<input type="hidden" name="debugListType" value="all"> |
|
|
|
|
|
{{$.CsrfTokenHtml}} |
|
|
|
|
|
{{if .CanDel}} |
|
|
|
|
|
<a id="model-delete-{{.JobID}}" class='ui basic {{if eq .Status "STOPPED" "FAILED" "START_FAILED"}}blue {{else}}disabled {{end}}button' onclick="assertDelete(this)" style="border-radius: .28571429rem;"> |
|
|
|
|
|
{{$.i18n.Tr "repo.delete"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
{{else}} |
|
|
|
|
|
<a class="ui basic button disabled" onclick="assertDelete(this)" style="border-radius: .28571429rem;"> |
|
|
|
|
|
{{$.i18n.Tr "repo.delete"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
{{end}} |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
<div class="ui compact buttons"> |
|
|
|
|
|
<!-- 模型下载 --> |
|
|
|
|
|
<!-- <a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank"> |
|
|
|
|
|
|
|
|
<!-- <div class="ui compact buttons"> |
|
|
|
|
|
|
|
|
|
|
|
<a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank"> |
|
|
{{$.i18n.Tr "repo.download"}} |
|
|
{{$.i18n.Tr "repo.download"}} |
|
|
</a> --> |
|
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 接收结果 --> |
|
|
|
|
|
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe> |
|
|
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe> |
|
|
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} |
|
|
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}} |
|
|
<a id="model-image-{{.JobID}}" style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}" class="imageBtn ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" value="{{.CanDebug}}">{{$.i18n.Tr "repo.submit_image"}}</a> |
|
|
<a id="model-image-{{.JobID}}" style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}" class="imageBtn ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" value="{{.CanDebug}}">{{$.i18n.Tr "repo.submit_image"}}</a> |
|
|
{{else}} |
|
|
{{else}} |
|
|
<a class="imageBtn ui basic disabled button" style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}" value="{{.CanDebug}}">{{$.i18n.Tr "repo.submit_image"}}</a> |
|
|
<a class="imageBtn ui basic disabled button" style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}" value="{{.CanDebug}}">{{$.i18n.Tr "repo.submit_image"}}</a> |
|
|
{{end}} |
|
|
{{end}} |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> --> |
|
|
<!-- 删除任务 --> |
|
|
<!-- 删除任务 --> |
|
|
<form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.JobID}}/del" method="post"> |
|
|
|
|
|
<input type="hidden" name="debugListType" value="all"> |
|
|
|
|
|
{{$.CsrfTokenHtml}} |
|
|
|
|
|
{{if .CanDel}} |
|
|
|
|
|
<!-- {{if not .CanDel}}disabled {{else}} blue {{end}} --> |
|
|
|
|
|
<a id="model-delete-{{.JobID}}" class="ui basic blue button " onclick="assertDelete(this)" style="border-radius: .28571429rem;"> |
|
|
|
|
|
{{$.i18n.Tr "repo.delete"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
{{else}} |
|
|
|
|
|
<a class="ui basic button disabled" onclick="assertDelete(this)" style="border-radius: .28571429rem;"> |
|
|
|
|
|
{{$.i18n.Tr "repo.delete"}} |
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
{{end}} |
|
|
|
|
|
</form> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="ui compact buttons"> |
|
|
|
|
|
<div class="ui dropdown"> |
|
|
|
|
|
<div class="text">更多</div> |
|
|
|
|
|
<i class="dropdown icon"></i> |
|
|
|
|
|
<div class="menu"> |
|
|
|
|
|
<div class="item"> |
|
|
|
|
|
<!-- 模型下载 --> |
|
|
|
|
|
{{if .CanDel}} |
|
|
|
|
|
<a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank">{{$.i18n.Tr "repo.download"}}</a> |
|
|
|
|
|
{{else}} |
|
|
|
|
|
<a class="ui basic disabled button">{{$.i18n.Tr "repo.download"}}</a> |
|
|
|
|
|
{{end}} |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="item"> |
|
|
|
|
|
<!-- 接收结果 --> |
|
|
|
|
|
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe> |
|
|
|
|
|
{{if .CanDel}} |
|
|
|
|
|
<a id="model-image-{{.JobID}}" class='imageBtn ui basic {{if ne .Status "RUNNING"}}disabled {{else}}blue {{end}}button'>{{$.i18n.Tr "repo.submit_image"}}</a> |
|
|
|
|
|
{{else}} |
|
|
|
|
|
<a class="imageBtn ui basic disabled button">{{$.i18n.Tr "repo.submit_image"}}</a> |
|
|
|
|
|
{{end}} |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<!-- 镜像列表弹窗 --> |
|
|
<!-- 镜像列表弹窗 --> |
|
|
<div id="imageModal" class="modal" style="display: none;"> |
|
|
<div id="imageModal" class="modal" style="display: none;"> |
|
|
@@ -514,23 +545,33 @@ |
|
|
$('#model-image-'+jobID).addClass('disabled') |
|
|
$('#model-image-'+jobID).addClass('disabled') |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if(status!=="STOPPED" || status!=="FAILED"){ |
|
|
|
|
|
|
|
|
if(["RUNNING","WAITING"].includes(status)){ |
|
|
$('#stop-model-debug-'+jobID).removeClass('disabled') |
|
|
$('#stop-model-debug-'+jobID).removeClass('disabled') |
|
|
$('#stop-model-debug-'+jobID).addClass('blue') |
|
|
$('#stop-model-debug-'+jobID).addClass('blue') |
|
|
// $('#model-delete-'+jobID).removeClass('red') |
|
|
|
|
|
// $('#model-delete-'+jobID).addClass('disabled') |
|
|
|
|
|
} |
|
|
} |
|
|
if(status=="STOPPED" || status=="FAILED" || status=="STOPPING"){ |
|
|
|
|
|
|
|
|
if(["CREATING","STOPPING","STARTING","STOPPED","FAILED","START_FAILED"].includes(status)){ |
|
|
$('#stop-model-debug-'+jobID).removeClass('blue') |
|
|
$('#stop-model-debug-'+jobID).removeClass('blue') |
|
|
$('#stop-model-debug-'+jobID).addClass('disabled') |
|
|
$('#stop-model-debug-'+jobID).addClass('disabled') |
|
|
// $('#model-delete-'+jobID).removeClass('disabled') |
|
|
|
|
|
// $('#model-delete-'+jobID).addClass('red') |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if(status==="STOPPED" || status==="FAILED"|| status==="START_FAILED"){ |
|
|
|
|
|
$('#model-delete-'+jobID).removeClass('disabled') |
|
|
|
|
|
$('#model-delete-'+jobID).addClass('blue') |
|
|
|
|
|
}else{ |
|
|
|
|
|
$('#model-delete-'+jobID).removeClass('blue') |
|
|
|
|
|
$('#model-delete-'+jobID).addClass('disabled') |
|
|
} |
|
|
} |
|
|
}).fail(function(err) { |
|
|
}).fail(function(err) { |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
$(document).ready(function(){ |
|
|
|
|
|
$('.ui.dropdown') |
|
|
|
|
|
.dropdown({ |
|
|
|
|
|
action: 'hide', |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取弹窗 |
|
|
// 获取弹窗 |
|
|
var modal = document.getElementById('imageModal'); |
|
|
var modal = document.getElementById('imageModal'); |
|
|
|