| @@ -26,7 +26,7 @@ | |||
| <div class="ui container"> | |||
| <div class="ui top attached tabular menu"> | |||
| <a class="item active" data-tab="configs">配置信息</a> | |||
| <a class="item" data-tab="logs">{{$.i18n.Tr "repo.modelarts.log"}}</a> | |||
| <a class="item logs" data-tab="logs">{{$.i18n.Tr "repo.modelarts.log"}}</a> | |||
| <!-- <a class="item" data-tab="resources">资源占用情况</a> --> | |||
| </div> | |||
| <div class="ui bottom attached tab segment active" data-tab="configs"> | |||
| @@ -114,17 +114,19 @@ | |||
| </div> | |||
| <div class="ui bottom attached tab segment" data-tab="logs"> | |||
| <div class="ui top attached segment" style="background: #f0f0f0;"> | |||
| <form class="ui form" action="{{.Link}}" method="post"> | |||
| <div class="inline field"> | |||
| <label>{{$.i18n.Tr "repo.modelarts.log"}}:</label> | |||
| <text>{{.log_file_name}}</text> | |||
| </div> | |||
| </form> | |||
| <div class="center aligned"> | |||
| <label>{{$.i18n.Tr "repo.modelarts.log"}}:</label> | |||
| <!-- <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> --> | |||
| </div> | |||
| </div> | |||
| <div class="ui attached segment" style="height: 300px !important; overflow: auto;"> | |||
| <pre>{{.log.Content}}</pre> | |||
| </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> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -136,6 +138,52 @@ | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| $('.menu .item').tab() | |||
| $('.ui.style.accordion'). | |||
| accordion(); | |||
| $('.ui.style.accordion').accordion(); | |||
| $(".test").click(function(){ | |||
| 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); | |||
| // } | |||
| </script> | |||