| @@ -119,14 +119,13 @@ | |||
| <!-- <a class="title" href="{{.DownloadURL}}?type={{$.Type}}"> --> | |||
| <span class="fitted file_name">{{.log_file_name}}</span> | |||
| <span class="fitted address">{{$.Link}}/{{.JobID}}/log</span> | |||
| <!-- {{svg "octicon-cloud-download" 16}} --> | |||
| <!-- </a> --> | |||
| <!-- {{svg "octicon-cloud-download" 16}} | |||
| </a> --> | |||
| </div> | |||
| </div> | |||
| <div class="ui attached segment log" style="height: 300px !important; overflow: auto;"> | |||
| <pre style="height: 250px">{{.log.Content}}</pre> | |||
| </div> | |||
| <button class="test">点击</button> | |||
| <pre>{{.log.Content}}</pre> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -140,50 +139,57 @@ | |||
| $('.menu .item').tab() | |||
| $('.ui.style.accordion').accordion(); | |||
| $(".test").click(function(){ | |||
| $(".log").scroll(function () { | |||
| var scrollTop = $(this)[0].scrollTop; // 滚动条Y轴的滚动距离 | |||
| var scrollHeight = $(this)[0].scrollHeight; // 文档高度 | |||
| var divHeight = $(this).height(); // 可视区高度 | |||
| var url = $('.fitted.address').text() | |||
| var log_file_name = $('.fitted.file_name').text() | |||
| var EndLine = 1 | |||
| console.log(url) | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: url, | |||
| data:{ | |||
| // StartLine: StartLine, | |||
| EndLine: EndLine, | |||
| log_file_name: log_file_name, | |||
| order: asc | |||
| }, | |||
| success:function(data){ | |||
| console.log(data) | |||
| // if(data.success){ | |||
| // $("searchResult").html(data.msg); | |||
| // }else{ | |||
| // $("#searchResult").html("出现错误:" + data.msg); | |||
| // } | |||
| }, | |||
| error:function(jqXHR){ | |||
| aler("发生错误:"+ jqXHR.status); | |||
| } | |||
| }); | |||
| }); | |||
| // $(".log").scroll(function () { | |||
| // var scrollTop = $(this).scrollTop(); // 滚动条Y轴的滚动距离 | |||
| // var scrollHeight = $("pre").height(); // 内容可视区的高度,固定值 | |||
| // var windowHeight = $(this).height(); // 滚动条高度 | |||
| // console.log($(this)) | |||
| // console.log(scrollTop, scrollHeight, windowHeight) | |||
| // if (scrollTop + windowHeight == scrollHeight) { | |||
| // alert(1) | |||
| // //此处是滚动条到底部时候触发的事件,在这里写要加载的数据,或者是拉动滚动条的操作 | |||
| // | |||
| // //var page = Number($("#redgiftNextPage").attr('currentpage')) + 1; | |||
| // //redgiftList(page); | |||
| // //$("#redgiftNextPage").attr('currentpage', page + 1); | |||
| // } | |||
| console.log(scrollTop, scrollHeight, divHeight) | |||
| if(scrollTop + divHeight + 50 >= scrollHeight){ | |||
| alert("底部该加载数据了") | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: url, | |||
| data:{ | |||
| EndLine: EndLine, | |||
| log_file_name: log_file_name, | |||
| order: 'asc' | |||
| }, | |||
| success:function(data){ | |||
| if (data==""){ | |||
| alert("日志到底了") | |||
| }else{ | |||
| pre.preappend(data) | |||
| } | |||
| }, | |||
| error:function(jqXHR){ | |||
| alert("发生错误:"+ jqXHR.status); | |||
| } | |||
| }); | |||
| } | |||
| if(scrollTop == 0){ | |||
| alert("顶部该加载数据了") | |||
| $.ajax({ | |||
| type: "GET", | |||
| url: url, | |||
| data:{ | |||
| StartLine: StartLine, | |||
| log_file_name: log_file_name, | |||
| order: 'desc' | |||
| }, | |||
| success:function(data){ | |||
| console.log(data) | |||
| if (data==""){ | |||
| alert("日志到顶了") | |||
| }else{ | |||
| pre.preappend(data) | |||
| } | |||
| }, | |||
| error:function(jqXHR){ | |||
| alert("发生错误:"+ jqXHR.status); | |||
| } | |||
| }); | |||
| } | |||
| }) | |||
| </script> | |||