nodeList.blade.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. @extends('admin.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('admin')}}">管理中心</a>
  14. <i class="fa fa-circle"></i>
  15. </li>
  16. <li>
  17. <a href="{{url('admin/nodeList')}}">节点管理</a>
  18. </li>
  19. </ul>
  20. <!-- END PAGE BREADCRUMB -->
  21. <!-- BEGIN PAGE BASE CONTENT -->
  22. <div class="row">
  23. <div class="col-md-12">
  24. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  25. <div class="portlet light bordered">
  26. <div class="portlet-title">
  27. <div class="caption font-dark">
  28. <i class="icon-list font-dark"></i>
  29. <span class="caption-subject bold uppercase"> 节点管理</span>
  30. </div>
  31. <div class="actions">
  32. <div class="btn-group">
  33. <button id="sample_editable_1_new" class="btn sbold blue" onclick="addNode()"> 新增
  34. <i class="fa fa-plus"></i>
  35. </button>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="portlet-body">
  40. <div class="table-scrollable">
  41. <table class="table table-striped table-bordered table-hover table-checkable order-column" id="sample_1">
  42. <thead>
  43. <tr>
  44. <th> ID </th>
  45. <th> 节点名称 </th>
  46. <th> 出口带宽 </th>
  47. <th> 负载 </th>
  48. <th> 在线人数 </th>
  49. <th> 产生流量/可用流量 </th>
  50. <th> 流量比例 </th>
  51. <th> 兼容SS </th>
  52. <th> 协议 </th>
  53. <th> 混淆 </th>
  54. <th> 操作 </th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. @if($nodeList->isEmpty())
  59. <tr>
  60. <td colspan="10">暂无数据</td>
  61. </tr>
  62. @else
  63. @foreach($nodeList as $node)
  64. <tr class="odd gradeX">
  65. <td> {{$node->id}} </td>
  66. <td> {{$node->name}} </td>
  67. <td> {{$node->bandwidth}}M </td>
  68. <td> <span class="label label-danger"> {{$node->load}} </span> </td>
  69. <td> <span class="label label-danger"> {{$node->online_users}} </span> </td>
  70. <td> {{$node->transfer}} / {{$node->traffic}}G </td>
  71. <td> {{$node->traffic_rate}} </td>
  72. <td> <span class="label label-info"> {{$node->compatible ? '是' : '否'}} </span> </td>
  73. <td> <span class="label label-info"> {{$node->protocol}} </span> </td>
  74. <td> <span class="label label-info"> {{$node->obfs}} </span> </td>
  75. <td>
  76. <button type="button" class="btn btn-sm blue btn-outline" onclick="editNode('{{$node->id}}')">编辑</button>
  77. <button type="button" class="btn btn-sm red btn-outline" onclick="delNode('{{$node->id}}')">删除</button>
  78. </td>
  79. </tr>
  80. @endforeach
  81. @endif
  82. </tbody>
  83. </table>
  84. </div>
  85. <div class="row">
  86. <div class="col-md-5 col-sm-5">
  87. <div class="dataTables_info" role="status" aria-live="polite">共 {{$nodeList->total()}} 个节点</div>
  88. </div>
  89. <div class="col-md-7 col-sm-7">
  90. <div class="dataTables_paginate paging_bootstrap_full_number pull-right">
  91. {{ $nodeList->links() }}
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <!-- END EXAMPLE TABLE PORTLET-->
  98. </div>
  99. </div>
  100. <!-- END PAGE BASE CONTENT -->
  101. </div>
  102. <!-- END CONTENT BODY -->
  103. @endsection
  104. @section('script')
  105. <script src="/assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
  106. <script type="text/javascript">
  107. // 添加节点
  108. function addNode() {
  109. window.location.href = '{{url('admin/addNode')}}';
  110. }
  111. // 编辑节点
  112. function editNode(id) {
  113. window.location.href = '{{url('admin/editNode?id=')}}' + id + '&page=' + '{{Request::get('page', 1)}}';
  114. }
  115. // 删除节点
  116. function delNode(id) {
  117. var _token = '{{csrf_token()}}';
  118. bootbox.confirm({
  119. message: "确定删除节点?",
  120. buttons: {
  121. confirm: {
  122. label: '确定',
  123. className: 'btn-success'
  124. },
  125. cancel: {
  126. label: '取消',
  127. className: 'btn-danger'
  128. }
  129. },
  130. callback: function (result) {
  131. if (result) {
  132. $.post("{{url('admin/delNode')}}", {id:id, _token:_token}, function(ret){
  133. if (ret.status == 'success') {
  134. bootbox.alert(ret.message, function(){
  135. window.location.reload();
  136. });
  137. } else {
  138. bootbox.alert(ret.message);
  139. }
  140. });
  141. }
  142. }
  143. });
  144. }
  145. </script>
  146. @endsection