userOnlineIPList.blade.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link rel="stylesheet" href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css">
  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-inline pb-20">
  15. <div class="form-group">
  16. <input type="text" class="form-control" name="username" value="{{Request::get('username')}}" id="username" placeholder="用户名">
  17. </div>
  18. <div class="form-group">
  19. <input type="text" class="form-control w-80" name="wechat" value="{{Request::get('wechat')}}" id="wechat" placeholder="微信">
  20. </div>
  21. <div class="form-group">
  22. <input type="text" class="form-control w-80" name="qq" value="{{Request::get('qq')}}" id="qq" placeholder="QQ">
  23. </div>
  24. <div class="form-group">
  25. <input type="text" class="form-control w-60" name="port" value="{{Request::get('port')}}" id="port" placeholder="端口">
  26. </div>
  27. <div class="btn-group">
  28. <button class="btn btn-primary" onclick="doSearch()">搜索</button>
  29. <button class="btn btn-danger" onclick="doReset()">重置</button>
  30. </div>
  31. </div>
  32. <table class="text-center" data-toggle="table" data-mobile-responsive="true">
  33. <thead class="thead-default">
  34. <tr>
  35. <th> #</th>
  36. <th> 用户名</th>
  37. <th> 端口</th>
  38. <th> 状态</th>
  39. <th> 代理</th>
  40. <th> 连接IP</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. @if ($userList->isEmpty())
  45. <tr>
  46. <td colspan="6">暂无数据</td>
  47. </tr>
  48. @else
  49. @foreach ($userList as $user)
  50. <tr>
  51. <td> {{$user->id}} </td>
  52. <td> {{$user->username}} </td>
  53. <td> {{$user->port}} </td>
  54. <td>
  55. @if ($user->status > 0)
  56. <span class="badge badge-lg badge-success">正常</span>
  57. @elseif ($user->status < 0)
  58. <span class="badge badge-lg badge-danger">禁用</span>
  59. @else
  60. <span class="badge badge-lg badge-default">未激活</span>
  61. @endif
  62. </td>
  63. <td>
  64. @if ($user->enable)
  65. <span class="badge badge-lg badge-success">启用</span>
  66. @else
  67. <span class="badge badge-lg badge-danger">禁用</span>
  68. @endif
  69. </td>
  70. <td>
  71. @if(!$user->onlineIPList->isEmpty())
  72. <table class="text-center" data-toggle="table" data-mobile-responsive="true">
  73. <thead>
  74. <tr>
  75. <th> 时间</th>
  76. <th> 节点</th>
  77. <th> 类型</th>
  78. <th> IP</th>
  79. </tr>
  80. </thead>
  81. <tbody>
  82. @foreach($user->onlineIPList as $vo)
  83. <tr>
  84. <td>{{$vo->created_at}}</td>
  85. <td>{{$vo->node ? $vo->node->name : '【节点已删除】'}}</td>
  86. <td>{{$vo->type}}</td>
  87. <td><a href="https://www.ipip.net/ip/{{$vo->ip}}.html" target="_blank">{{$vo->ip}}</a></td>
  88. </tr>
  89. @endforeach
  90. </tbody>
  91. </table>
  92. @endif
  93. </td>
  94. </tr>
  95. @endforeach
  96. @endif
  97. </tbody>
  98. </table>
  99. </div>
  100. <div class="panel-footer">
  101. <div class="row">
  102. <div class="col-sm-4">
  103. 共 {{$userList->total()}} 个账号
  104. </div>
  105. <div class="col-sm-8">
  106. <nav class="Page navigation float-right">
  107. {{ $userList->links() }}
  108. </nav>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. @endsection
  115. @section('script')
  116. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
  117. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
  118. <script type="text/javascript">
  119. // 搜索
  120. function doSearch() {
  121. var username = $("#username").val();
  122. var wechat = $("#wechat").val();
  123. var qq = $("#qq").val();
  124. var port = $("#port").val();
  125. window.location.href = '/admin/userOnlineIPList' + '?username=' + username + '&wechat=' + wechat + '&qq=' + qq + '&port=' + port;
  126. }
  127. // 重置
  128. function doReset() {
  129. window.location.href = '/admin/userOnlineIPList';
  130. }
  131. </script>
  132. @endsection