groupList.blade.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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/addGroup" 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> #</th>
  19. <th> 分组名称</th>
  20. <th> 分组级别</th>
  21. <th> 操作</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. @foreach($groupList as $group)
  26. <tr>
  27. <td> {{$group->id}} </td>
  28. <td> {{$group->name}} </td>
  29. <td> {{$levelMap[$group->level]}} </td>
  30. <td>
  31. <div class="btn-group">
  32. <a href="/admin/editGroup/{{$group->id}}" class="btn btn-primary"><i
  33. class="icon wb-edit"></i></a>
  34. <button class="btn btn-danger"
  35. onclick="delGroup('{{$group->id}}','{{$group->name}}')"><i
  36. class="icon wb-trash"></i></button>
  37. </div>
  38. </td>
  39. </tr>
  40. @endforeach
  41. </tbody>
  42. </table>
  43. </div>
  44. <div class="panel-footer">
  45. <div class="row">
  46. <div class="col-sm-4">
  47. 共 <code>{{$groupList->total()}}</code> 个节点分组
  48. </div>
  49. <div class="col-sm-8">
  50. <nav class="Page navigation float-right">
  51. {{$groupList->links()}}
  52. </nav>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. @endsection
  59. @section('script')
  60. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  61. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"
  62. type="text/javascript"></script>
  63. <script type="text/javascript">
  64. // 删除节点分组
  65. function delGroup(id, name) {
  66. swal.fire({
  67. title: '警告',
  68. text: '确定删除分组 【' + name + '】 ?',
  69. type: 'warning',
  70. showCancelButton: true,
  71. cancelButtonText: '{{trans('home.ticket_close')}}',
  72. confirmButtonText: '{{trans('home.ticket_confirm')}}',
  73. }).then((result) => {
  74. if (result.value) {
  75. $.post("/admin/delGroup/" + id, {_token: '{{csrf_token()}}'}, function (ret) {
  76. if (ret.status === 'success') {
  77. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  78. .then(() => window.location.reload())
  79. } else {
  80. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  81. }
  82. });
  83. }
  84. });
  85. }
  86. </script>
  87. @endsection