index.blade.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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="{{route('rule.group.create')}}" 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="{{route('rule.group.editNode',$ruleGroup->id)}}" class="btn btn-sm btn-outline-primary">
  35. <i class="icon wb-plus" aria-hidden="true"></i>分配节点
  36. </a>
  37. <a href="{{route('rule.group.edit',$ruleGroup->id)}}" class="btn btn-sm btn-outline-primary">
  38. <i class="icon wb-edit"></i>编辑
  39. </a>
  40. <button onclick="delRuleGroup('{{route('rule.group.destroy',$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(url, 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. $.ajax({
  81. type: 'DELETE',
  82. url: url,
  83. data: {_token: '{{csrf_token()}}'},
  84. dataType: 'json',
  85. success: function (ret) {
  86. if (ret.status === 'success') {
  87. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  88. .then(() => window.location.reload())
  89. } else {
  90. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  91. }
  92. }
  93. });
  94. }
  95. });
  96. }
  97. </script>
  98. @endsection