analysis.blade.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. <x-alert type="danger" :message="Session::get('analysisErrorMsg')"/>
  15. @endif
  16. <div class="panel-body">
  17. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  18. <thead class="thead-default">
  19. <tr>
  20. <th>近期请求地址</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. @if(empty($urlList))
  25. <tr>
  26. <td colspan="1">访问记录不足15000条,无法分析数据</td>
  27. </tr>
  28. @else
  29. @foreach($urlList as $url)
  30. <tr>
  31. <td> {{$url}} </td>
  32. </tr>
  33. @endforeach
  34. @endif
  35. </tbody>
  36. </table>
  37. </div>
  38. </div>
  39. </div>
  40. @endsection
  41. @section('script')
  42. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  43. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"
  44. type="text/javascript"></script>
  45. <script type="text/javascript">
  46. const TableDatatablesScroller = function() {
  47. const e = function() {
  48. const e = $('#analysis');
  49. e.dataTable({
  50. language: {
  51. aria: {
  52. sortAscending: ': activate to sort column ascending',
  53. sortDescending: ': activate to sort column descending',
  54. },
  55. emptyTable: '暂无数据',
  56. info: '第 _START_ 到 _END_ 条,共计 _TOTAL_ 条',
  57. infoEmpty: '未找到',
  58. infoFiltered: '(filtered1 from _MAX_ total entries)',
  59. lengthMenu: '_MENU_ entries',
  60. search: '搜索:',
  61. zeroRecords: '未找到',
  62. },
  63. buttons: [
  64. {extend: 'print', className: 'btn btn-outline-dark'},
  65. {extend: 'pdf', className: 'btn btn-outline-success'},
  66. {extend: 'csv', className: 'btn btn-outline-primary'},
  67. ],
  68. scrollY: 300,
  69. deferRender: !0,
  70. scroller: !0,
  71. stateSave: !0,
  72. order: [[0, 'asc']],
  73. lengthMenu: [[10, 15, 20, -1], [10, 15, 20, 'All']],
  74. pageLength: 20,
  75. 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>>',
  76. });
  77. };
  78. return {
  79. init: function() {
  80. jQuery().dataTable && (e());
  81. },
  82. };
  83. }();
  84. jQuery(document).ready(function() {
  85. TableDatatablesScroller.init();
  86. });
  87. $('#is_rand_port').on({
  88. 'switchChange.bootstrapSwitch': function(event, state) {
  89. $.post('/admin/enableRandPort', {_token: '{{csrf_token()}}', value: state ? 1 : 0}, function(ret) {
  90. console.log(ret);
  91. });
  92. },
  93. });
  94. </script>
  95. @endsection