trafficLog.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
  4. <link href="/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
  5. <style type="text/css">
  6. input,select {
  7. margin-bottom: 5px;
  8. }
  9. </style>
  10. @endsection
  11. @section('content')
  12. <!-- BEGIN CONTENT BODY -->
  13. <div class="page-content" style="padding-top:0;">
  14. <!-- BEGIN PAGE BASE CONTENT -->
  15. <div class="row">
  16. <div class="col-md-12">
  17. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  18. <div class="portlet light bordered">
  19. <div class="portlet-title">
  20. <div class="caption font-dark">
  21. <span class="caption-subject bold uppercase"> 流量日志</span>
  22. </div>
  23. </div>
  24. <div class="portlet-body">
  25. <div class="row">
  26. <div class="col-md-3 col-sm-4 col-xs-12">
  27. <input type="text" class="col-md-4 form-control" name="port" value="{{Request::get('port')}}" id="port" placeholder="端口" onkeydown="if(event.keyCode==13){do_search();}">
  28. </div>
  29. <div class="col-md-3 col-sm-4 col-xs-12">
  30. <input type="text" class="col-md-4 form-control" name="user_id" value="{{Request::get('user_id')}}" id="user_id" placeholder="用户ID" onkeydown="if(event.keyCode==13){do_search();}">
  31. </div>
  32. <div class="col-md-3 col-sm-4 col-xs-12">
  33. <input type="text" class="col-md-4 form-control" name="username" value="{{Request::get('username')}}" id="username" placeholder="用户名" onkeydown="if(event.keyCode==13){do_search();}">
  34. </div>
  35. <div class="col-md-3 col-sm-4 col-xs-12">
  36. <button type="button" class="btn blue" onclick="do_search();">查询</button>
  37. <button type="button" class="btn grey" onclick="do_reset();">重置</button>
  38. </div>
  39. </div>
  40. <div class="table-scrollable table-scrollable-borderless">
  41. <table class="table table-hover table-light">
  42. <thead>
  43. <tr>
  44. <th> # </th>
  45. <th> 用户 </th>
  46. <th> 节点 </th>
  47. <th> 流量比例 </th>
  48. <th> 上传流量 </th>
  49. <th> 下载流量 </th>
  50. <th> 总流量 </th>
  51. <th> 记录时间 </th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. @if($trafficLogList->isEmpty())
  56. <tr>
  57. <td colspan="8" style="text-align: center;">暂无数据</td>
  58. </tr>
  59. @else
  60. @foreach($trafficLogList as $trafficLog)
  61. <tr class="odd gradeX">
  62. <td> {{$trafficLog->id}} </td>
  63. <td> <a href="{{url('admin/userList?username=') . $trafficLog->user->username}}" target="_blank"> <span class="label label-info"> {{$trafficLog->user->username}} </span> </a> </td>
  64. <td> {{$trafficLog->ssnode->name}} </td>
  65. <td> {{$trafficLog->rate}} </td>
  66. <td> {{$trafficLog->u}} </td>
  67. <td> {{$trafficLog->d}} </td>
  68. <td> <span class="label label-danger"> {{$trafficLog->traffic}} </span> </td>
  69. <td> {{$trafficLog->log_time}} </td>
  70. </tr>
  71. @endforeach
  72. @endif
  73. </tbody>
  74. </table>
  75. </div>
  76. <div class="row">
  77. <div class="col-md-4 col-sm-4">
  78. <div class="dataTables_info" role="status" aria-live="polite">共 {{$trafficLogList->total()}} 条记录,合计 {{$totalTraffic}}</div>
  79. </div>
  80. <div class="col-md-8 col-sm-8">
  81. <div class="dataTables_paginate paging_bootstrap_full_number pull-right">
  82. {{ $trafficLogList->links() }}
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- END EXAMPLE TABLE PORTLET-->
  89. </div>
  90. </div>
  91. <!-- END PAGE BASE CONTENT -->
  92. </div>
  93. <!-- END CONTENT BODY -->
  94. @endsection
  95. @section('script')
  96. <script type="text/javascript">
  97. // 搜索
  98. function do_search() {
  99. var port = $("#port").val();
  100. var user_id = $("#user_id").val();
  101. var username = $("#username").val();
  102. window.location.href = '{{url('admin/trafficLog')}}' + '?port=' + port + '&user_id=' + user_id + '&username=' + username;
  103. }
  104. // 重置
  105. function do_reset() {
  106. window.location.href = '{{url('admin/trafficLog')}}';
  107. }
  108. </script>
  109. @endsection