groupList.blade.php 3.0 KB

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