nodeList.blade.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. @extends('user.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('user/nodeList')}}">节点列表</a>
  14. <i class="fa fa-circle"></i>
  15. </li>
  16. </ul>
  17. <!-- END PAGE BREADCRUMB -->
  18. <!-- BEGIN PAGE BASE CONTENT -->
  19. <div class="row">
  20. <div class="col-md-12">
  21. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  22. <div class="portlet light bordered">
  23. <div class="portlet-title">
  24. <div class="caption font-dark">
  25. <i class="icon-list font-dark"></i>
  26. <span class="caption-subject bold uppercase"> 节点列表 </span>
  27. </div>
  28. </div>
  29. <div class="portlet-body">
  30. <div class="alert alert-danger">
  31. <strong>流量比例:</strong> 1表示用100M就结算100M,0.1表示用100M结算10M,5表示用100M结算500M,以此类推,越是优质节点则比例越高。
  32. </div>
  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. <th> 操作 </th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. @if($nodeList->isEmpty())
  50. <tr>
  51. <td colspan="10">暂无数据</td>
  52. </tr>
  53. @else
  54. @foreach($nodeList as $node)
  55. <tr class="odd gradeX">
  56. <td> {{$node->id}} </td>
  57. <td> {{$node->name}} @if ($node->compatible) <span class="label label-warning"> 兼容SS </span> @endif </td>
  58. <td> {{$node->bandwidth}}M </td>
  59. <td> <span class="label label-danger"> {{$node->load}} </span> </td>
  60. <td> <span class="label label-danger"> {{$node->online_users}} </span> </td>
  61. <td> {{$node->traffic_rate}} </td>
  62. <td> <span class="label label-info"> {{$node->protocol}} </span> </td>
  63. <td> <span class="label label-info"> {{$node->obfs}} </span> </td>
  64. <td>
  65. <a class="btn btn-sm green btn-outline" data-toggle="modal" href="#txt_{{$node->id}}"> 查看配置 </a>
  66. <a class="btn btn-sm green btn-outline" data-toggle="modal" href="#qrcode_{{$node->id}}"> 二维码 </a>
  67. </td>
  68. </tr>
  69. @endforeach
  70. @endif
  71. </tbody>
  72. </table>
  73. </div>
  74. <div class="row">
  75. <div class="col-md-4 col-sm-4">
  76. <div class="dataTables_info" role="status" aria-live="polite">共 {{$nodeList->total()}} 个节点</div>
  77. </div>
  78. <div class="col-md-8 col-sm-8">
  79. <div class="dataTables_paginate paging_bootstrap_full_number pull-right">
  80. {{ $nodeList->links() }}
  81. </div>
  82. </div>
  83. </div>
  84. @foreach ($nodeList as $node)
  85. <div class="modal fade draggable-modal" id="txt_{{$node->id}}" tabindex="-1" role="basic" aria-hidden="true">
  86. <div class="modal-dialog">
  87. <div class="modal-content">
  88. <div class="modal-header">
  89. <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  90. <h4 class="modal-title">配置信息</h4>
  91. </div>
  92. <div class="modal-body">
  93. <textarea class="form-control" rows="10" onclick="this.focus();this.select()" readonly="readonly"> {{$node->txt}} </textarea>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="modal fade" id="qrcode_{{$node->id}}" tabindex="-1" role="dialog" aria-hidden="true">
  99. <div class="modal-dialog @if(!$node->compatible) modal-sm @endif">
  100. <div class="modal-content">
  101. <div class="modal-header">
  102. <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  103. <h4 class="modal-title">请使用客户端扫描二维码</h4>
  104. </div>
  105. <div class="modal-body">
  106. <div class="row">
  107. @if ($node->compatible)
  108. <div class="col-md-6">
  109. <div style="font-size:16px;text-align:center;padding-bottom:10px;"><span>SSR</span></div>
  110. <div id="qrcode_ssr_img_{{$node->id}}"></div>
  111. </div>
  112. <div class="col-md-6">
  113. <div style="font-size:16px;text-align:center;padding-bottom:10px;"><span>SS</span></div>
  114. <div id="qrcode_ss_img_{{$node->id}}"></div>
  115. </div>
  116. @else
  117. <div class="col-md-12">
  118. <div style="font-size:16px;text-align:center;padding-bottom:10px;"><span>SSR</span></div>
  119. <div id="qrcode_ssr_img_{{$node->id}}"></div>
  120. </div>
  121. @endif
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. @endforeach
  128. </div>
  129. </div>
  130. <!-- END EXAMPLE TABLE PORTLET-->
  131. </div>
  132. </div>
  133. <!-- END PAGE BASE CONTENT -->
  134. </div>
  135. <!-- END CONTENT BODY -->
  136. @endsection
  137. @section('script')
  138. <script src="/assets/global/plugins/jquery-qrcode/jquery.qrcode.min.js" type="text/javascript"></script>
  139. <script src="/assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
  140. <script src="/assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
  141. <script type="text/javascript">
  142. var UIModals = function () {
  143. var n = function () {
  144. @foreach($nodeList as $node)
  145. $("#txt_{{$node->id}}").draggable({handle: ".modal-header"});
  146. $("#qrcode_{{$node->id}}").draggable({handle: ".modal-header"});
  147. @endforeach
  148. };
  149. return {
  150. init: function () {
  151. n()
  152. }
  153. }
  154. }();
  155. jQuery(document).ready(function () {
  156. UIModals.init()
  157. });
  158. // 循环输出节点scheme用于生成二维码
  159. @foreach ($nodeList as $node)
  160. $('#qrcode_ssr_img_{{$node->id}}').qrcode("{{$node->ssr_scheme}}");
  161. $('#qrcode_ss_img_{{$node->id}}').qrcode("{{$node->ss_scheme}}");
  162. @endforeach
  163. </script>
  164. @endsection