| @@ -284,10 +284,7 @@ | |||||
| <div class="content-pad"> | <div class="content-pad"> | ||||
| <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | ||||
| <a class="active item" | <a class="active item" | ||||
| data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||||
| <a class="item" data-tab="second{{$k}}" | |||||
| onclick="javascript:parseInfo()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||||
| data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||||
| <a class="item log_bottom" data-tab="third{{$k}}" | <a class="item log_bottom" data-tab="third{{$k}}" | ||||
| data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a> | data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a> | ||||
| @@ -504,25 +501,6 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="ui tab" data-tab="second{{$k}}"> | |||||
| <div> | |||||
| <div class="ui message message{{.VersionName}}" style="display: none;"> | |||||
| <div id="header"></div> | |||||
| </div> | |||||
| <div class="ui attached log" id="log_state{{.VersionName}}" | |||||
| style="height: 390px !important; overflow: auto;"> | |||||
| <input type="hidden" id="json_value" value="{{$.result.JobStatus.AppExitDiagnostics}}"> | |||||
| <input type="hidden" id="ExitDiagnostics" value="{{$.ExitDiagnostics}}"> | |||||
| <span id="info_display" class="info_text"> | |||||
| </span> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="ui tab" data-tab="third{{$k}}"> | <div class="ui tab" data-tab="third{{$k}}"> | ||||
| <div class="file-info"> | <div class="file-info"> | ||||
| <a id="{{.VersionName}}-log-down" | <a id="{{.VersionName}}-log-down" | ||||
| @@ -922,66 +900,7 @@ | |||||
| $('.secondary.menu .item').tab(); | $('.secondary.menu .item').tab(); | ||||
| }); | }); | ||||
| let userName | |||||
| let repoPath | |||||
| let jobID | |||||
| let downlaodFlag = {{ $.canDownload }} | |||||
| let taskID = {{ $.task.ID }} | |||||
| let realJobName = {{ $.task.JobName }} | |||||
| $(document).ready(function () { | |||||
| let url = window.location.href; | |||||
| let urlArr = url.split('/') | |||||
| userName = urlArr.slice(-5)[0] | |||||
| repoPath = urlArr.slice(-4)[0] | |||||
| jobID = urlArr.slice(-1)[0] | |||||
| }) | |||||
| function stopBubbling(e) { | |||||
| e = window.event || e; | |||||
| if (e.stopPropagation) { | |||||
| e.stopPropagation(); //阻止事件 冒泡传播 | |||||
| } else { | |||||
| e.cancelBubble = true; //ie兼容 | |||||
| } | |||||
| } | |||||
| function loadLog(version_name) { | |||||
| document.getElementById("mask").style.display = "block" | |||||
| let startLine = $('input[name=end_line]').val(); | |||||
| if(startLine==""){ | |||||
| startLine=0; | |||||
| } | |||||
| let endLine = $('input[name=end_line]').val(); | |||||
| if(endLine==""){ | |||||
| endLine = 50; | |||||
| } | |||||
| $.get(`/${userName}/${repoPath}/cloudbrain/train-job/${jobID}/get_log?endLine=${endLine}&startLine=${startLine}`, (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 refreshStatus(version_name) { | |||||
| $.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${taskID}?version_name=${versionname}`, (data) => { | |||||
| // header status and duration | |||||
| //$(`#${version_name}-duration-span`).text(data.JobDuration) | |||||
| $(`#${version_name}-status-span span`).text(data.JobStatus) | |||||
| $(`#${version_name}-status-span i`).attr("class", data.JobStatus) | |||||
| // detail status and duration | |||||
| //$('#'+version_name+'-duration').text(data.JobDuration) | |||||
| $('#' + version_name + '-status').text(data.JobStatus) | |||||
| loadLog(version_name) | |||||
| }).fail(function (err) { | |||||
| console.log(err); | |||||
| }); | |||||
| stopBubbling(arguments.callee.caller.arguments[0]) | |||||
| } | |||||
| function parseInfo() { | function parseInfo() { | ||||
| let jsonValue = document.getElementById("json_value").value; | let jsonValue = document.getElementById("json_value").value; | ||||