analysis.blade.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" type="text/css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container">
  7. <div class="panel">
  8. <div class="panel-heading">
  9. <h2 class="panel-title">日志分析
  10. <small>仅适用于单机单节点</small>
  11. </h2>
  12. </div>
  13. @if (Session::has('analysisErrorMsg'))
  14. <div class="alert alert-danger" role="alert">
  15. <button class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span><span class="sr-only">{{trans('home.close')}}</span></button>
  16. {{Session::get('analysisErrorMsg')}}
  17. </div>
  18. @endif
  19. <div class="panel-body">
  20. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  21. <thead class="thead-default">
  22. <tr>
  23. <th>近期请求地址</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @if(empty($urlList))
  28. <tr>
  29. <td colspan="1">访问记录不足15000条,无法分析数据</td>
  30. </tr>
  31. @else
  32. @foreach($urlList as $url)
  33. <tr>
  34. <td> {{$url}} </td>
  35. </tr>
  36. @endforeach
  37. @endif
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. </div>
  43. @endsection
  44. @section('script')
  45. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  46. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js" type="text/javascript"></script>
  47. <script type="text/javascript">
  48. const TableDatatablesScroller = function () {
  49. const e = function () {
  50. const e = $("#analysis");
  51. e.dataTable({
  52. language: {
  53. aria: {
  54. sortAscending: ": activate to sort column ascending",
  55. sortDescending: ": activate to sort column descending"
  56. },
  57. emptyTable: "暂无数据",
  58. info: "第 _START_ 到 _END_ 条,共计 _TOTAL_ 条",
  59. infoEmpty: "未找到",
  60. infoFiltered: "(filtered1 from _MAX_ total entries)",
  61. lengthMenu: "_MENU_ entries",
  62. search: "搜索:",
  63. zeroRecords: "未找到"
  64. },
  65. buttons: [
  66. {extend: "print", className: "btn btn-outline-dark"},
  67. {extend: "pdf", className: "btn btn-outline-success"},
  68. {extend: "csv", className: "btn btn-outline-primary"}
  69. ],
  70. scrollY: 300,
  71. deferRender: !0,
  72. scroller: !0,
  73. stateSave: !0,
  74. order: [[0, "asc"]],
  75. lengthMenu: [[10, 15, 20, -1], [10, 15, 20, "All"]],
  76. pageLength: 20,
  77. dom: "<'row' <'col-md-12'B>><'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>"
  78. })
  79. };
  80. return {
  81. init: function () {
  82. jQuery().dataTable && (e())
  83. }
  84. }
  85. }();
  86. jQuery(document).ready(function () {
  87. TableDatatablesScroller.init()
  88. });
  89. $('#is_rand_port').on({
  90. 'switchChange.bootstrapSwitch': function (event, state) {
  91. $.post("/admin/enableRandPort", {_token: '{{csrf_token()}}', value: state ? 1 : 0}, function (ret) {
  92. console.log(ret);
  93. });
  94. }
  95. });
  96. </script>
  97. @endsection