diff --git a/templates/repo/cloudbrain/inference/new.tmpl b/templates/repo/cloudbrain/inference/new.tmpl index f1124d8f4..3fd614f59 100644 --- a/templates/repo/cloudbrain/inference/new.tmpl +++ b/templates/repo/cloudbrain/inference/new.tmpl @@ -182,6 +182,16 @@ {{end}} + +
' + data.Content)
+ $(`.message${version_name} #header`).text('您已翻阅至日志顶部')
+ $(`.message${version_name}`).css('display', 'block')
+ setTimeout(function () {
+ $(`.message${version_name}`).css('display', 'none')
+ }, 1000)
+ scrollAnimation(logContentDom, logContentDom.scrollTop, 0);
+ })
+
+ })
+ $('.log_bottom').click(function (e) {
+ let version_name = $(this).data('version')
+ let logContentDom = document.querySelector(`#log${version_name}`)
+ $(`#log_file${version_name}`).siblings('pre').remove()
+ $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=&lines=50&order=desc`, (data) => {
+
+ $(`#log${version_name} input[name=end_line]`).val(data.EndLine) //如果变动就改变所对应的值
+ $(`#log${version_name} input[name=start_line]`).val(data.StartLine)
+ $(`#log${version_name}`).append('' + data.Content)
+ $.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) {
+ $(`.message${version_name} #header`).text('您已翻阅至日志底部')
+ $(`.message${version_name}`).css('display', 'block')
+ setTimeout(function () {
+ $(`.message${version_name}`).css('display', 'none')
+ }, 1000)
+ } else {
+ if (end_line === data.EndLine) {
+ return
+ }
+ else {
+ $(`#log${version_name} input[name=end_line]`).val(data.EndLine)
+ $(`#log${version_name}`).append('' + data.Content)
+ }
+
+ }
+ }).fail(function (err) {
+ console.log(err);
+ });
+ scrollAnimation(logContentDom, logContentDom.scrollTop + 1, logContentDom.scrollHeight - logContentDom.clientHeight);
+ })
+ })