Browse Source

fix issue

pull/1965/head
zhoupzh 3 years ago
parent
commit
df326ba9b7
2 changed files with 1 additions and 49 deletions
  1. +1
    -33
      templates/repo/modelarts/trainjob/show.tmpl
  2. +0
    -16
      web_src/less/openi.less

+ 1
- 33
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -420,13 +420,7 @@ td, th {
</div>
</div>
<div class="ui tab" data-tab="second{{$k}}">
<div style="position: relative;">
<span>
<a title="滚动到顶部" style="position: absolute; right: -32px;cursor: pointer;"><i class="icon-to-top"></i></a>
</span>
<span>
<a title="滚动到底部" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"><i class="icon-to-bottom"></i></a>
</span>
<div>
<div class="ui message message{{.VersionName}}" style="display: none;">
<div id="header"></div>
</div>
@@ -885,30 +879,4 @@ td, th {
});
}
}
function scrollAnimation(dom, currentY, targetY, currentX) {
let needScrollTop = targetY - currentY;
let _currentY = currentY;
let context = this;
setTimeout(() => {
// 一次调用滑动帧数,每次调用会不一样
//取总距离的十分之一
const dist = Math.ceil(needScrollTop / 10);
_currentY += dist;
//移动一个十分之一

dom.scrollTo(currentX || 0, _currentY);
// 如果移动幅度小于十个像素,直接移动,否则递归调用,实现动画效果
if (needScrollTop > 10 || needScrollTop < -10) {
context.scrollAnimation(dom, _currentY, targetY)
} else {
dom.scrollTo(_currentY, targetY)
}
}, 1)
}
function scrollTop(){
let logContentDom = document.querySelector('.log'), context = this;
if(!logContentDom)
return
scrollAnimation(logContentDom, logContentDom.scrollTop, 0);
}
</script>

+ 0
- 16
web_src/less/openi.less View File

@@ -250,22 +250,6 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;}
.CREATING, .STOPPING, .DELETING, .STARTING, i.WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;}

i.COMPLETED,i.SUCCEEDED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -441px -52px;}
.icon-to-bottom{
background:url("/img/icons.svg");
background-position: -574px -208px;
width: 30px;
height: 30px;
display: inline-block;
}
.icon-to-top{
background:url("/img/icons.svg");
background-position: -540px -208px;
width: 30px;
height: 30px;
display: inline-block;
}



.text_over{
overflow: hidden;


Loading…
Cancel
Save