index.blade.php 6.1 KB

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