ruleGroupList.blade.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. <h2 class="panel-title">规则分组</h2>
  10. <div class="panel-actions">
  11. <a href="/rule/group/add" class="btn btn-outline-primary">
  12. <i class="icon wb-plus" aria-hidden="true"></i>添加分组
  13. </a>
  14. </div>
  15. </div>
  16. <div class="panel-body">
  17. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  18. <thead class="thead-default">
  19. <tr>
  20. <th> #</th>
  21. <th> 分组名称</th>
  22. <th> 审计模式</th>
  23. <th> 操作</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @foreach ($ruleGroupList as $ruleGroup)
  28. <tr>
  29. <td> {{$ruleGroup->id}} </td>
  30. <td> {{$ruleGroup->name}} </td>
  31. <td> {!! $ruleGroup->type_label !!} </td>
  32. <td>
  33. <div class="btn-group">
  34. <a href="/rule/group/assign?id={{$ruleGroup->id}}" class="btn btn-sm btn-outline-primary">
  35. <i class="icon wb-plus" aria-hidden="true"></i>分配节点
  36. </a>
  37. <a href="/rule/group/edit?id={{$ruleGroup->id}}" class="btn btn-sm btn-outline-primary">
  38. <i class="icon wb-edit"></i>编辑
  39. </a>
  40. <button onclick="delRuleGroup('{{$ruleGroup->id}}', '{{$ruleGroup->name}}')" class="btn btn-sm btn-outline-danger">
  41. <i class="icon wb-trash"></i>删除
  42. </button>
  43. </div>
  44. </td>
  45. </tr>
  46. @endforeach
  47. </tbody>
  48. </table>
  49. </div>
  50. <div class="panel-footer">
  51. <div class="row">
  52. <div class="col-sm-4">
  53. 共 <code>{{$ruleGroupList->total()}}</code> 个分组
  54. </div>
  55. <div class="col-sm-8">
  56. <nav class="Page navigation float-right">
  57. {{$ruleGroupList->links()}}
  58. </nav>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. @endsection
  65. @section('script')
  66. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  67. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js" type="text/javascript"></script>
  68. <script type="text/javascript">
  69. // 删除规则分组
  70. function delRuleGroup(id, name) {
  71. swal.fire({
  72. title: '警告',
  73. text: '确定删除分组 【' + name + '】 ?',
  74. type: 'warning',
  75. showCancelButton: true,
  76. cancelButtonText: '{{trans('home.ticket_close')}}',
  77. confirmButtonText: '{{trans('home.ticket_confirm')}}',
  78. }).then((result) => {
  79. if (result.value) {
  80. $.post("/rule/group/delete", {_token: '{{csrf_token()}}', id: id}, function (ret) {
  81. if (ret.status === 'success') {
  82. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  83. .then(() => window.location.reload())
  84. } else {
  85. swal.fire({title: ret.message, type: "error"});
  86. }
  87. });
  88. }
  89. });
  90. }
  91. </script>
  92. @endsection