runtime.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <style type="text/css">
  2. .queryform_item{float:left;width: 20%}
  3. .queryform_label{float:left;width: 7rem;text-align: right;}
  4. .queryform_inputblock{float:left;margin:1rem !important;width:13.5rem;}
  5. </style>
  6. <div class="children-content">
  7. <blockquote class="layui-elem-quote" style="padding:10px;line-height:25px;">
  8. 系统管理 / 运行日志
  9. </blockquote>
  10. <div id="runtime_log" style="position:relative;width:98%;height:100%;line-height: 2.4rem;padding: 1rem;border:1px solid #ccc;">
  11. <div></div>
  12. </div>
  13. </div>
  14. <script type="text/javascript">
  15. var offsetCount=0;
  16. $(document).ready(function () {
  17. var h=$(".main-body").height() - $(".layui-elem-quote").height() - 120 * hRate;
  18. $("#runtime_log").height(h).children("div:first").slimscroll({
  19. height: h + "px",
  20. width: "100%",
  21. alwaysVisible: false,
  22. wheelStep: 10,
  23. size: "6px",
  24. color: "#03aee7"
  25. });
  26. getRunLog();
  27. });
  28. function getRunLog(){
  29. $.getJSON(Global.AccessUrl+"/api/log/runtime_log",{"offset":offsetCount},function(jsondata){
  30. if(jsondata.code!=0){
  31. layer.msg(jsondata.msg)
  32. return
  33. }
  34. offsetCount = jsondata.count;
  35. //显示日志内容
  36. $("#runtime_log>div>div:first").append(jsondata.data.replace(/\n/g,'<br>'));
  37. setTimeout(function(){
  38. if($("#runtime_log").length==0){
  39. return;
  40. }
  41. getRunLog();
  42. },5000);
  43. })
  44. }
  45. </script>