onlineIPMonitor.blade.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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>2分钟内的实时数据</small>
  11. </h3>
  12. </div>
  13. <div class="panel-body">
  14. <div class="form-row">
  15. <div class="form-group col-lg-2 col-sm-2">
  16. <input type="number" class="form-control" name="id" id="id" value="{{Request::get('id')}}"
  17. placeholder="ID"/>
  18. </div>
  19. <div class="form-group col-lg-2 col-sm-5">
  20. <input type="text" class="form-control" name="email" id="email"
  21. value="{{Request::get('email')}}" placeholder="用户名"/>
  22. </div>
  23. <div class="form-group col-lg-2 col-sm-5">
  24. <input type="text" class="form-control" name="ip" id="ip" value="{{Request::get('ip')}}"
  25. placeholder="IP"/>
  26. </div>
  27. <div class="form-group col-lg-2 col-sm-3">
  28. <input type="number" class="form-control" name="port" id="port" value="{{Request::get('port')}}"
  29. placeholder="端口"/>
  30. </div>
  31. <div class="form-group col-lg-2 col-sm-5">
  32. <select name="nodeId" id="nodeId" class="form-control" onChange="Search()">
  33. <option value="" @if(Request::get('nodeId') == '') selected @endif hidden>选择节点</option>
  34. @foreach($nodeList as $node)
  35. <option value="{{$node->id}}"
  36. @if(Request::get('nodeId') == $node->id) selected @endif>{{$node->name}}</option>
  37. @endforeach
  38. </select>
  39. </div>
  40. <div class="form-group col-lg-2 col-sm-4 btn-group">
  41. <button class="btn btn-primary" onclick="Search()">搜 索</button>
  42. <a href="/admin/onlineIPMonitor" class="btn btn-danger">重 置</a>
  43. </div>
  44. </div>
  45. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  46. <thead class="thead-default">
  47. <tr>
  48. <th> #</th>
  49. <th> 类型</th>
  50. <th> 节点</th>
  51. <th> 用户</th>
  52. <th> IP</th>
  53. <th> 归属地</th>
  54. <th> 时间</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. @foreach($list as $vo)
  59. <tr>
  60. <td>{{$vo->id}}</td>
  61. <td>{{$vo->type}}</td>
  62. <td>{{$vo->node ? $vo->node->name : '【节点已删除】'}}</td>
  63. <td>{{$vo->user ? $vo->user->email : '【用户已删除】'}}</td>
  64. <td>
  65. @if (strpos($vo->ip, ',') == true)
  66. @foreach (explode(',', $vo->ip) as $ip)
  67. <a href="https://www.ipip.net/ip/{{$ip}}.html" target="_blank">{{$ip}}</a>
  68. @endforeach
  69. @else
  70. <a href="https://www.ipip.net/ip/{{$vo->ip}}.html" target="_blank">{{$vo->ip}}</a>
  71. @endif
  72. </td>
  73. <td>{{strpos($vo->ip, ',') == true? '':$vo->ipInfo}}</td>
  74. <td>{{date('Y-m-d H:i:s',$vo->created_at)}}</td>
  75. </tr>
  76. @endforeach
  77. </tbody>
  78. </table>
  79. </div>
  80. <div class="panel-footer">
  81. <div class="row">
  82. <div class="col-sm-4">
  83. 共 <code>{{$list->total()}}</code> 个账号
  84. </div>
  85. <div class="col-sm-8">
  86. <nav class="Page navigation float-right">
  87. {{$list->links()}}
  88. </nav>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. @endsection
  95. @section('script')
  96. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  97. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"
  98. type="text/javascript"></script>
  99. <script src="/assets/custom/Plugin/clipboardjs/clipboard.min.js" type="text/javascript"></script>
  100. <script type="text/javascript">
  101. //回车检测
  102. $(document).on("keypress", "input", function (e) {
  103. if (e.which === 13) {
  104. Search();
  105. return false;
  106. }
  107. });
  108. // 搜索
  109. function Search() {
  110. window.location.href = '/admin/onlineIPMonitor?id=' + $("#id").val() + '&ip=' + $("#ip").val() + '&email=' + $("#email").val() + '&port=' + $("#port").val() + '&nodeId=' + $("#nodeId option:selected").val();
  111. }
  112. </script>
  113. @endsection