userOnlineIPList.blade.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" type="text/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::get('id')}}" placeholder="ID"/>
  17. </div>
  18. <div class="form-group col-lg-3 col-sm-8">
  19. <input type="text" class="form-control" name="username" id="username" value="{{Request::get('username')}}" placeholder="用户名"/>
  20. </div>
  21. <div class="form-group col-lg-2 col-sm-6">
  22. <input type="text" class="form-control" name="wechat" id="wechat" value="{{Request::get('wechat')}}" placeholder="微信"/>
  23. </div>
  24. <div class="form-group col-lg-2 col-sm-6">
  25. <input type="number" class="form-control" name="qq" id="qq" value="{{Request::get('qq')}}" placeholder="QQ"/>
  26. </div>
  27. <div class="form-group col-lg-1 col-sm-6">
  28. <input type="number" class="form-control" name="port" id="port" value="{{Request::get('port')}}" placeholder="端口"/>
  29. </div>
  30. <div class="form-group col-lg-2 col-sm-6 btn-group">
  31. <button class="btn btn-primary" onclick="Search()">搜索</button>
  32. <a href="/admin/userOnlineIPList" class="btn btn-danger">重置</a>
  33. </div>
  34. </div>
  35. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  36. <thead class="thead-default">
  37. <tr>
  38. <th> #</th>
  39. <th> 用户名</th>
  40. <th> 端口</th>
  41. <th> 状态</th>
  42. <th> 代理</th>
  43. <th> 连接IP</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. @if ($userList->isEmpty())
  48. <tr>
  49. <td colspan="6">暂无数据</td>
  50. </tr>
  51. @else
  52. @foreach ($userList as $user)
  53. <tr>
  54. <td> {{$user->id}} </td>
  55. <td> {{$user->username}} </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->isEmpty())
  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 $vo)
  86. <tr>
  87. <td>{{$vo->created_at}}</td>
  88. <td>{{$vo->node ? $vo->node->name : '【节点已删除】'}}</td>
  89. <td>{{$vo->type}}</td>
  90. <td>
  91. <a href="https://www.ipip.net/ip/{{$vo->ip}}.html" target="_blank">{{$vo->ip}}</a>
  92. </td>
  93. </tr>
  94. @endforeach
  95. </tbody>
  96. </table>
  97. @endif
  98. </td>
  99. </tr>
  100. @endforeach
  101. @endif
  102. </tbody>
  103. </table>
  104. </div>
  105. <div class="panel-footer">
  106. <div class="row">
  107. <div class="col-sm-4">
  108. 共 <code>{{$userList->total()}}</code> 个账号
  109. </div>
  110. <div class="col-sm-8">
  111. <nav class="Page navigation float-right">
  112. {{$userList->links()}}
  113. </nav>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. @endsection
  120. @section('script')
  121. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  122. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js" type="text/javascript"></script>
  123. <script type="text/javascript">
  124. //回车检测
  125. $(document).on("keypress", "input", function (e) {
  126. if (e.which === 13) {
  127. Search();
  128. return false;
  129. }
  130. });
  131. // 搜索
  132. function Search() {
  133. window.location.href = '/admin/userOnlineIPList' + '?id' + $("#id").val() + '&username=' + $("#username").val() + '&wechat=' + $("#wechat").val() + '&qq=' + $("#qq").val() + '&port=' + $("#port").val();
  134. }
  135. </script>
  136. @endsection