From 1ed8e113ce84494ea0aec329915f28dbdc3799ff Mon Sep 17 00:00:00 2001 From: liuzx Date: Wed, 16 Nov 2022 18:01:46 +0800 Subject: [PATCH] fix-3108 --- templates/repo/cloudbrain/trainjob/show.tmpl | 61 +------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index 3af318286..75cad03b4 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -893,66 +893,7 @@ $('.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() { var SPEC = {{ .Spec }}; var showPoint = false;