| @@ -488,10 +488,10 @@ | |||||
| <div class="ui tab" data-tab="second{{$k}}"> | <div class="ui tab" data-tab="second{{$k}}"> | ||||
| <div> | <div> | ||||
| <a id="{{.VersionName}}-log-down" | <a id="{{.VersionName}}-log-down" | ||||
| class='{{if and ($.CanLogDownload) (eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED") }}ti-download-file{{else}}disabled{{end}}' | |||||
| class='{{if eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED" }}ti-download-file{{else}}disabled{{end}}' | |||||
| href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/download_log_file?version_name={{.VersionName}}"> | href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/download_log_file?version_name={{.VersionName}}"> | ||||
| <i class="ri-download-cloud-2-line"></i> | <i class="ri-download-cloud-2-line"></i> | ||||
| <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span> | |||||
| <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span> {{$.CanLogDownload}} | |||||
| </a> | </a> | ||||
| </div> | </div> | ||||
| @@ -752,7 +752,6 @@ | |||||
| $('#' + version_name + '-status').text(data.JobStatus) | $('#' + version_name + '-status').text(data.JobStatus) | ||||
| console.log(data) | console.log(data) | ||||
| if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) { | if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) { | ||||
| $(`#${version_name}-log-down`).removeClass('disabled').addClass('ti-download-file') | |||||
| $('#' + version_name + '-stop').addClass('disabled') | $('#' + version_name + '-stop').addClass('disabled') | ||||
| } | } | ||||
| @@ -809,6 +808,12 @@ | |||||
| $('input[name=end_line]').val(data.EndLine) | $('input[name=end_line]').val(data.EndLine) | ||||
| $('input[name=start_line]').val(data.StartLine) | $('input[name=start_line]').val(data.StartLine) | ||||
| $(`#log_file${version_name}`).text(data.Content) | $(`#log_file${version_name}`).text(data.Content) | ||||
| if(data.CanLogDownload){ | |||||
| $(`#${version_name}-log-down`).removeClass('disabled').addClass('ti-download-file') | |||||
| }else{ | |||||
| $(`#${version_name}-log-down`).removeClass('ti-download-file').addClass('disabled') | |||||
| } | |||||
| }).fail(function (err) { | }).fail(function (err) { | ||||
| console.log(err); | console.log(err); | ||||
| }); | }); | ||||
| @@ -1029,6 +1034,11 @@ | |||||
| $(`#log${version_name} input[name=end_line]`).val(data.EndLine) //如果变动就改变所对应的值 | $(`#log${version_name} input[name=end_line]`).val(data.EndLine) //如果变动就改变所对应的值 | ||||
| $(`#log${version_name} input[name=start_line]`).val(data.StartLine) | $(`#log${version_name} input[name=start_line]`).val(data.StartLine) | ||||
| $(`#log${version_name}`).append('<pre>' + data.Content) | $(`#log${version_name}`).append('<pre>' + data.Content) | ||||
| if(data.CanLogDownload){ | |||||
| $(`#${version_name}-log-down`).removeClass('disabled').addClass('ti-download-file') | |||||
| }else{ | |||||
| $(`#${version_name}-log-down`).removeClass('ti-download-file').addClass('disabled') | |||||
| } | |||||
| $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${data.EndLine}&lines=50&order=desc`, (data) => { | $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${data.EndLine}&lines=50&order=desc`, (data) => { | ||||
| if (data.Lines == 0) { | if (data.Lines == 0) { | ||||
| $(`.message${version_name} #header`).text('您已翻阅至日志底部') | $(`.message${version_name} #header`).text('您已翻阅至日志底部') | ||||