Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.4.1^2
zouap 3 years ago
parent
commit
7c9764bd7c
1 changed files with 33 additions and 25 deletions
  1. +33
    -25
      templates/repo/cloudbrain/show.tmpl

+ 33
- 25
templates/repo/cloudbrain/show.tmpl View File

@@ -226,7 +226,7 @@ td, th {
<div class="content-pad">
<div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
<a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
<a class="item" data-tab="second{{$k}}">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a>
<a class="item" data-tab="second{{$k}}" onclick="parseLog()">>{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a>
</div>
<div class="ui tab active" data-tab="first{{$k}}">
<div style="padding-top: 10px;">
@@ -418,17 +418,6 @@ td, th {
</table>
</div>
</div>
<div class="ac-grid ac-grid-col2">
<div class="ac-grid-col">
<span class="ti-text-form-label">{{$.i18n.Tr "repo.cloudbrain.exitinfo"}}</span>
</div>
</div>
<div class="ac-grid-col">
<span class="info_text">
{{$.result.JobStatus.AppExitDiagnostics}}
</span>
</div>
</div>

</div>
@@ -439,8 +428,9 @@ td, th {
<div id="header"></div>
</div>
<div class="ui attached log" id="log{{.VersionName}}" style="height: 300px !important; overflow: auto;">
<span class="info_text">
{{$.result.JobStatus.AppExitDiagnostics}}
<input type="hidden" id="json_value" value="{{$.result.JobStatus.AppExitDiagnostics}}">
<span id="info_display" class="info_text">
</span>
</div>

@@ -499,17 +489,35 @@ td, th {
jobName = urlArr.slice(-1)[0]
})

function loadLog(version_name){
document.getElementById("mask").style.display = "block"
$.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobName}/log?version_name=${version_name}&lines=50&order=asc`, (data) => {
$('input[name=end_line]').val(data.EndLine)
$('input[name=start_line]').val(data.StartLine)
$(`#log_file${version_name}`).text(data.Content)
document.getElementById("mask").style.display = "none"
}).fail(function(err) {
console.log(err);
document.getElementById("mask").style.display = "none"
});
function parseLog(){
let jsonValue = document.getElementById("json_value").value;
let jsonObj = JSON.parse(jsonValue);
let podRoleName = jsonObj["podRoleName"];
let html = "";
if (podRoleName != null){
let task0 = podRoleName["task1-0"];
let podEvents = jsonObj["podEvents"];
let podEventArray = podEvents[task0];
if(podEventArray != null){
for(int i=0; i < podEventArray.length;i++){
html +="<p>" +podEventArray[i]["reason"] + "</p>";
html +="<p>" +podEventArray[i]["message"] + "</p>";
html +="<p>" +podEventArray[i]["action"] + "</p>";
}
}
let extras= jsonObj["extras"];
if(extras != null){
html +="<p>" +extras["reason"] + "</p>";
html +="<p>" +extras["message"] + "</p>";
html +="<p>" +extras["action"] + "</p>";
}

document.getElementById("info_display").innerHTML=html;
}


}


</script>

Loading…
Cancel
Save