userOnlineIP.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-content container-fluid">
  7. <div class="panel">
  8. <div class="panel-heading">
  9. <h3 class="panel-title">用户在线IP列表
  10. <small>最近10分钟</small>
  11. </h3>
  12. </div>
  13. <div class="panel-body">
  14. <div class="form-row">
  15. <div class="form-group col-lg-1 col-sm-4">
  16. <input type="number" class="form-control" id="id" name="id" value="{{Request::input('id')}}"
  17. placeholder="ID"/>
  18. </div>
  19. <div class="form-group col-lg-3 col-sm-8">
  20. <input type="text" class="form-control" name="email" id="email"
  21. value="{{Request::input('email')}}" placeholder="用户名"/>
  22. </div>
  23. <div class="form-group col-lg-2 col-sm-6">
  24. <input type="text" class="form-control" name="wechat" id="wechat"
  25. value="{{Request::input('wechat')}}" placeholder="微信"/>
  26. </div>
  27. <div class="form-group col-lg-2 col-sm-6">
  28. <input type="number" class="form-control" name="qq" id="qq" value="{{Request::input('qq')}}"
  29. placeholder="QQ"/>
  30. </div>
  31. <div class="form-group col-lg-1 col-sm-6">
  32. <input type="number" class="form-control" name="port" id="port" value="{{Request::input('port')}}"
  33. placeholder="端口"/>
  34. </div>
  35. <div class="form-group col-lg-2 col-sm-6 btn-group">
  36. <button class="btn btn-primary" onclick="Search()">搜 索</button>
  37. <a href="{{route('admin.log.ip')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
  38. </div>
  39. </div>
  40. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  41. <thead class="thead-default">
  42. <tr>
  43. <th> #</th>
  44. <th> 用户名</th>
  45. <th> 端口</th>
  46. <th> {{trans('common.status')}}</th>
  47. <th> 代理</th>
  48. <th> 连接IP</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. @foreach ($userList as $user)
  53. <tr>
  54. <td> {{$user->id}} </td>
  55. <td> {{$user->email}} </td>
  56. <td> {{$user->port}} </td>
  57. <td>
  58. @if ($user->status > 0)
  59. <span class="badge badge-lg badge-success">正常</span>
  60. @elseif ($user->status < 0)
  61. <span class="badge badge-lg badge-danger">禁用</span>
  62. @else
  63. <span class="badge badge-lg badge-default">未激活</span>
  64. @endif
  65. </td>
  66. <td>
  67. @if ($user->enable)
  68. <span class="badge badge-lg badge-success">启用</span>
  69. @else
  70. <span class="badge badge-lg badge-danger">禁用</span>
  71. @endif
  72. </td>
  73. <td>
  74. @if($user->onlineIPList->isNotEmpty())
  75. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  76. <thead>
  77. <tr>
  78. <th> 时间</th>
  79. <th> 节点</th>
  80. <th> 类型</th>
  81. <th> IP</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. @foreach($user->onlineIPList as $log)
  86. <tr>
  87. <td>{{$log->created_at}}</td>
  88. <td>{{$log->node->name ?? '【节点已删除】'}}</td>
  89. <td>{{$log->type}}</td>
  90. <td>
  91. <a href="https://www.ipip.net/ip/{{$log->ip}}.html" target="_blank">{{$log->ip}}</a>
  92. </td>
  93. </tr>
  94. @endforeach
  95. </tbody>
  96. </table>
  97. @endif
  98. </td>
  99. </tr>
  100. @endforeach
  101. </tbody>
  102. </table>
  103. </div>
  104. <div class="panel-footer">
  105. <div class="row">
  106. <div class="col-sm-4">
  107. 共 <code>{{$userList->total()}}</code> 个账号
  108. </div>
  109. <div class="col-sm-8">
  110. <nav class="Page navigation float-right">
  111. {{$userList->links()}}
  112. </nav>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. @endsection
  119. @section('javascript')
  120. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
  121. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
  122. <script>
  123. //回车检测
  124. $(document).on('keypress', 'input', function(e) {
  125. if (e.which === 13) {
  126. Search();
  127. return false;
  128. }
  129. });
  130. // 搜索
  131. function Search() {
  132. window.location.href = '{{route('admin.log.ip')}}?id' + $('#id').val() + '&email=' + $('#email').val() +
  133. '&wechat=' + $('#wechat').val() + '&qq=' + $('#qq').val() + '&port=' + $('#port').val();
  134. }
  135. </script>
  136. @endsection