| @@ -167,6 +167,34 @@ td, th { | |||
| padding-top: 0.5rem ; | |||
| } | |||
| </style> | |||
| <script> | |||
| 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> | |||
| <div id="mask"> | |||
| <div id="loadingPage"> | |||
| <div class="rect1"></div> | |||
| @@ -226,7 +254,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}}" onclick="parseLog()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||
| <a class="item" data-tab="second{{$k}}" onclick="javascript:parseLog()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||
| </div> | |||
| <div class="ui tab active" data-tab="first{{$k}}"> | |||
| <div style="padding-top: 10px;"> | |||
| @@ -468,56 +496,3 @@ td, th { | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| $('.menu .item').tab() | |||
| $(document).ready(function(){ | |||
| $('.ui.accordion').accordion({selector:{trigger:'.icon'}}); | |||
| }); | |||
| $(document).ready(function(){ | |||
| $('.secondary.menu .item').tab(); | |||
| }); | |||
| let userName | |||
| let repoPath | |||
| let jobName | |||
| $(document).ready(function(){ | |||
| let url = window.location.href; | |||
| let urlArr = url.split('/') | |||
| userName = urlArr.slice(-5)[0] | |||
| repoPath = urlArr.slice(-4)[0] | |||
| jobName = urlArr.slice(-1)[0] | |||
| }) | |||
| 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> | |||