From 230fa8bdd27bc49a184e580c12e89373e9d8758e Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 25 Apr 2022 11:02:32 +0800 Subject: [PATCH] fix issu --- templates/repo/modelarts/trainjob/show.tmpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index c0a37e157..36d1529c2 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -838,13 +838,12 @@ td, th { } function logScroll(version_name) { - let container = document.querySelector(`#log${version_name}`) let scrollTop = container.scrollTop let scrollHeight = container.scrollHeight let clientHeight = container.clientHeight let scrollLeft = container.scrollLeft - if(((parseInt(scrollTop) + clientHeight == scrollHeight || parseInt(scrollTop) + clientHeight +1 == scrollHeight || parseInt(scrollTop) + clientHeight - 1 == scrollHeight)) && parseInt(scrollTop)!==0){ + if(((parseInt(scrollTop) + clientHeight == scrollHeight || parseInt(scrollTop) + clientHeight +1 == scrollHeight || parseInt(scrollTop) + clientHeight - 1 == scrollHeight)) && parseInt(scrollTop)!==0 && scrollLeft==0){ let end_line = $(`#log${version_name} input[name=end_line]`).val() $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${end_line}&lines=50&order=desc`, (data) => { if (data.Lines == 0){ @@ -867,8 +866,7 @@ td, th { console.log(err); }); } - - if([1,2,3,4,5].includes(scrollTop) && scrollLeft==0){ + if([0,1,2,3,4,5,6,7,8,9,10].includes(scrollTop) && scrollLeft==0){ let start_line = $(`#log${version_name} input[name=start_line]`).val() $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=${start_line}&lines=50&order=asc`, (data) => {