index.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. @extends('admin.table_layouts')
  2. @section('content')
  3. <div class="page-content container-fluid">
  4. <div class="panel">
  5. <div class="panel-heading">
  6. <h2 class="panel-title">{!! trans('admin.menu.node.cert') !!}</h2>
  7. @can('admin.node.cert.create')
  8. <div class="panel-actions">
  9. <a class="btn btn-primary" href="{{ route('admin.node.cert.create') }}">
  10. <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
  11. </a>
  12. </div>
  13. @endcan
  14. </div>
  15. <div class="panel-body">
  16. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  17. <thead class="thead-default">
  18. <tr>
  19. <th> #</th>
  20. <th> {{ trans('model.node_cert.domain') }}</th>
  21. <th> {{ trans('model.node_cert.key') }}</th>
  22. <th> {{ trans('model.node_cert.pem') }}</th>
  23. <th> {{ trans('model.node_cert.issuer') }}</th>
  24. <th> {{ trans('model.node_cert.signed_date') }}</th>
  25. <th> {{ trans('model.node_cert.expired_date') }}</th>
  26. <th> {{ trans('common.action') }}</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. @foreach ($certs as $cert)
  31. <tr>
  32. <td> {{ $cert->id }} </td>
  33. <td> {{ $cert->domain }} </td>
  34. <td> {{ $cert->key ? '✔️' : '❌' }} </td>
  35. <td> {{ $cert->pem ? '✔️' : '❌' }} </td>
  36. <td> {{ $cert->issuer }} </td>
  37. <td> {{ $cert->from }} </td>
  38. <td> {{ $cert->to }} </td>
  39. <td>
  40. @canany(['admin.node.cert.edit', 'admin.node.cert.destroy'])
  41. <div class="btn-group">
  42. @can('admin.node.cert.edit')
  43. <a class="btn btn-primary" href="{{ route('admin.node.cert.edit', $cert) }}">
  44. <i class="icon wb-edit" aria-hidden="true"></i>
  45. </a>
  46. @endcan
  47. @can('admin.node.cert.destroy')
  48. <button class="btn btn-danger" onclick="delCertificate('{{ $cert->id }}')">
  49. <i class="icon wb-trash" aria-hidden="true"></i>
  50. </button>
  51. @endcan
  52. </div>
  53. @endcanany
  54. </td>
  55. </tr>
  56. @endforeach
  57. </tbody>
  58. </table>
  59. </div>
  60. <div class="panel-footer">
  61. <div class="row">
  62. <div class="col-sm-4">
  63. {!! trans('admin.node.cert.counts', ['num' => $certs->total()]) !!}
  64. </div>
  65. <div class="col-sm-8">
  66. <nav class="Page navigation float-right">
  67. {{ $certs->links() }}
  68. </nav>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. @endsection
  75. @push('javascript')
  76. @can('admin.node.cert.destroy')
  77. <script>
  78. // 删除授权
  79. function delCertificate(id) {
  80. swal.fire({
  81. title: '{{ trans('admin.hint') }}',
  82. text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node_cert.attribute')]) }}' + id +
  83. '{{ trans('admin.confirm.delete.1') }}',
  84. icon: "info",
  85. showCancelButton: true,
  86. cancelButtonText: '{{ trans('common.close') }}',
  87. confirmButtonText: '{{ trans('common.confirm') }}'
  88. }).then((result) => {
  89. if (result.value) {
  90. $.ajax({
  91. method: "DELETE",
  92. url: '{{ route('admin.node.cert.destroy', '') }}/' + id,
  93. data: {
  94. _token: '{{ csrf_token() }}'
  95. },
  96. dataType: "json",
  97. success: function(ret) {
  98. if (ret.status === "success") {
  99. swal.fire({
  100. title: ret.message,
  101. icon: "success",
  102. timer: 1000,
  103. showConfirmButton: false
  104. }).then(() => window.location.reload());
  105. } else {
  106. swal.fire({
  107. title: ret.message,
  108. icon: "error"
  109. }).then(() => window.location.reload());
  110. }
  111. }
  112. });
  113. }
  114. });
  115. }
  116. </script>
  117. @endcan
  118. @endpush