nodeList.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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">节点列表</h3>
  10. <div class="panel-actions">
  11. <a href="/admin/addNode" class="btn btn-primary"><i class="icon wb-plus"></i> 添加节点</a>
  12. </div>
  13. </div>
  14. <div class="panel-body">
  15. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  16. <thead class="thead-default">
  17. <tr>
  18. <th> ID</th>
  19. <th> 类型</th>
  20. <th> 名称</th>
  21. <th> IP</th>
  22. <th> 域名</th>
  23. <th> 存活</th>
  24. <th> 状态</th>
  25. <th> 在线</th>
  26. <th>产生流量</th>
  27. <th> 流量比例</th>
  28. <th> 扩展</th>
  29. <th> 操作</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. @if($nodeList->isEmpty())
  34. <tr>
  35. <td colspan="12">暂无数据</td>
  36. </tr>
  37. @else
  38. @foreach($nodeList as $node)
  39. <tr class="{{!$node->isOnline && $node->status ? 'table-danger' : ''}}">
  40. <td>
  41. {{$node->id}}
  42. </td>
  43. <td>
  44. @if($node->is_transit)
  45. 中转
  46. @else
  47. {{$node->type == 2 ? 'V2' : 'SSR'}}
  48. @endif
  49. </td>
  50. <td> {{$node->name}} </td>
  51. <td> {{$node->is_ddns ? 'DDNS' : $node->ip}} </td>
  52. <td> {{$node->server}} </td>
  53. <td> {{$node->uptime}} </td>
  54. <td> {{$node->status? $node->load : '维护'}} </td>
  55. <td> {{$node->online_users}} </td>
  56. <td> {{$node->transfer}} </td>
  57. <td> {{$node->traffic_rate}} </td>
  58. <td>
  59. @if($node->compatible) <span class="badge badge-lg badge-info">兼</span> @endif
  60. @if($node->single) <span class="badge badge-lg badge-info">单</span> @endif
  61. @if(!$node->is_subscribe) <span class="badge badge-lg badge-danger"><s>订</s></span> @endif
  62. </td>
  63. <td>
  64. <div class="btn-group">
  65. <a href="/admin/editNode?id={{$node->id}}&page={{Request::get('page', 1)}}" class="btn btn-primary"><i class="icon wb-edit"></i></a>
  66. <a href="javascript:delNode('{{$node->id}}','{{$node->name}}')" class="btn btn-danger"><i class="icon wb-trash"></i></a>
  67. <a href="/admin/nodeMonitor/{{$node->id}})" class="btn btn-primary"><i class="icon wb-stats-bars"></i></a>
  68. </div>
  69. </td>
  70. </tr>
  71. @endforeach
  72. @endif
  73. </tbody>
  74. </table>
  75. </div>
  76. <div class="panel-footer">
  77. <div class="row">
  78. <div class="col-sm-4">
  79. 共 <code>{{$nodeList->total()}}</code> 条线路
  80. </div>
  81. <div class="col-sm-8">
  82. <nav class="Page navigation float-right">
  83. {{$nodeList->links()}}
  84. </nav>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. @endsection
  91. @section('script')
  92. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  93. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js" type="text/javascript"></script>
  94. <script type="text/javascript">
  95. // 删除节点
  96. function delNode(id, name) {
  97. swal.fire({
  98. title: '警告',
  99. text: '确定删除节点 【' + name + '】 ?',
  100. type: 'warning',
  101. showCancelButton: true,
  102. cancelButtonText: '{{trans('home.ticket_close')}}',
  103. confirmButtonText: '{{trans('home.ticket_confirm')}}',
  104. }).then((result) => {
  105. if (result.value) {
  106. $.post("/admin/delNode", {id: id, _token: '{{csrf_token()}}'}, function (ret) {
  107. if (ret.status === 'success') {
  108. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  109. .then(() => window.location.reload())
  110. } else {
  111. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  112. }
  113. });
  114. }
  115. });
  116. }
  117. // 显示提示
  118. function showIdTips() {
  119. swal.fire({
  120. title: '复制成功',
  121. type: 'success',
  122. timer: 1300,
  123. showConfirmButton: false,
  124. });
  125. }
  126. </script>
  127. @endsection