trafficLog.blade.php 6.2 KB

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