trafficLog.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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')}}">管理中心</a>
  14. <i class="fa fa-circle"></i>
  15. </li>
  16. <li>
  17. <a href="{{url('admin/trafficLog')}}">流量日志</a>
  18. </li>
  19. </ul>
  20. <!-- END PAGE BREADCRUMB -->
  21. <!-- BEGIN PAGE BASE CONTENT -->
  22. <div class="row">
  23. <div class="col-md-12">
  24. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  25. <div class="portlet light bordered">
  26. <div class="portlet-title">
  27. <div class="caption font-dark">
  28. <i class="icon-speedometer font-dark"></i>
  29. <span class="caption-subject bold uppercase"> 流量日志</span>
  30. </div>
  31. </div>
  32. <div class="portlet-body">
  33. <div class="table-scrollable">
  34. <table class="table table-striped table-bordered table-hover table-checkable order-column" id="sample_1">
  35. <thead>
  36. <tr>
  37. <th> ID </th>
  38. <th> 用户 </th>
  39. <th> 节点 </th>
  40. <th> 流量比例 </th>
  41. <th> 上传流量 </th>
  42. <th> 下载流量 </th>
  43. <th> 总流量 </th>
  44. <th> 记录时间 </th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. @if($trafficLogList->isEmpty())
  49. <tr>
  50. <td colspan="9">暂无数据</td>
  51. </tr>
  52. @else
  53. @foreach($trafficLogList as $trafficLog)
  54. <tr class="odd gradeX">
  55. <td> {{$trafficLog->id}} </td>
  56. <td> <a href="{{url('admin/userList?port=') . $trafficLog->user->port}}" target="_blank"> <span class="label label-info"> {{$trafficLog->user->username}} </span> </a> </td>
  57. <td> {{$trafficLog->ssnode->name}} </td>
  58. <td> {{$trafficLog->rate}} </td>
  59. <td> {{$trafficLog->u}} </td>
  60. <td> {{$trafficLog->d}} </td>
  61. <td> <span class="label label-danger"> {{$trafficLog->traffic}} </span> </td>
  62. <td> {{$trafficLog->log_time}} </td>
  63. </tr>
  64. @endforeach
  65. @endif
  66. </tbody>
  67. </table>
  68. </div>
  69. <div class="row">
  70. <div class="col-md-5 col-sm-5">
  71. <div class="dataTables_info" role="status" aria-live="polite">共 {{$trafficLogList->total()}} 条记录</div>
  72. </div>
  73. <div class="col-md-7 col-sm-7">
  74. <div class="dataTables_paginate paging_bootstrap_full_number pull-right">
  75. {{ $trafficLogList->links() }}
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <!-- END EXAMPLE TABLE PORTLET-->
  82. </div>
  83. </div>
  84. <!-- END PAGE BASE CONTENT -->
  85. </div>
  86. <!-- END CONTENT BODY -->
  87. @endsection
  88. @section('script')
  89. <script src="/assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
  90. <script type="text/javascript">
  91. // 添加节点
  92. function addNode() {
  93. window.location.href = '{{url('admin/addNode')}}';
  94. }
  95. // 编辑节点
  96. function editNode(id) {
  97. window.location.href = '{{url('admin/editNode?id=')}}' + id;
  98. }
  99. // 删除节点
  100. function delNode(id) {
  101. var _token = '{{csrf_token()}}';
  102. bootbox.confirm({
  103. message: "确定删除节点?",
  104. buttons: {
  105. confirm: {
  106. label: '确定',
  107. className: 'btn-success'
  108. },
  109. cancel: {
  110. label: '取消',
  111. className: 'btn-danger'
  112. }
  113. },
  114. callback: function (result) {
  115. if (result) {
  116. $.post("{{url('admin/delNode')}}", {id:id, _token:_token}, function(ret){
  117. if (ret.status == 'success') {
  118. bootbox.alert(ret.message, function(){
  119. window.location.reload();
  120. });
  121. } else {
  122. bootbox.alert(ret.message);
  123. }
  124. });
  125. }
  126. }
  127. });
  128. }
  129. </script>
  130. @endsection