Explorar o código

Blade Format Change

BrettonYe hai 1 ano
pai
achega
31b2b91b49
Modificáronse 95 ficheiros con 7475 adicións e 6909 borrados
  1. 2 0
      package.json
  2. 38 38
      resources/views/admin/aff/detail.blade.php
  3. 163 153
      resources/views/admin/aff/index.blade.php
  4. 84 79
      resources/views/admin/aff/invite.blade.php
  5. 61 65
      resources/views/admin/aff/rebate.blade.php
  6. 121 115
      resources/views/admin/article/index.blade.php
  7. 894 801
      resources/views/admin/config/common.blade.php
  8. 100 91
      resources/views/admin/config/emailFilter.blade.php
  9. 545 362
      resources/views/admin/config/system.blade.php
  10. 79 64
      resources/views/admin/coupon/create.blade.php
  11. 127 134
      resources/views/admin/coupon/index.blade.php
  12. 49 62
      resources/views/admin/coupon/show.blade.php
  13. 40 44
      resources/views/admin/logs/callback.blade.php
  14. 43 47
      resources/views/admin/logs/notification.blade.php
  15. 48 54
      resources/views/admin/logs/onlineIPMonitor.blade.php
  16. 122 119
      resources/views/admin/logs/order.blade.php
  17. 58 59
      resources/views/admin/logs/traffic.blade.php
  18. 35 33
      resources/views/admin/logs/userBanHistory.blade.php
  19. 33 32
      resources/views/admin/logs/userCreditHistory.blade.php
  20. 66 67
      resources/views/admin/logs/userMonitor.blade.php
  21. 69 65
      resources/views/admin/logs/userOnlineIP.blade.php
  22. 40 39
      resources/views/admin/logs/userTraffic.blade.php
  23. 33 38
      resources/views/admin/marketing/emailList.blade.php
  24. 82 83
      resources/views/admin/marketing/pushList.blade.php
  25. 165 149
      resources/views/admin/node/auth.blade.php
  26. 75 70
      resources/views/admin/node/cert/index.blade.php
  27. 24 25
      resources/views/admin/node/cert/info.blade.php
  28. 455 432
      resources/views/admin/node/info.blade.php
  29. 67 68
      resources/views/admin/node/monitor.blade.php
  30. 71 65
      resources/views/admin/permission/index.blade.php
  31. 22 20
      resources/views/admin/permission/info.blade.php
  32. 73 67
      resources/views/admin/role/index.blade.php
  33. 56 54
      resources/views/admin/role/info.blade.php
  34. 68 64
      resources/views/admin/rule/group/index.blade.php
  35. 56 55
      resources/views/admin/rule/group/info.blade.php
  36. 184 180
      resources/views/admin/rule/index.blade.php
  37. 75 75
      resources/views/admin/rule/log.blade.php
  38. 128 131
      resources/views/admin/shop/index.blade.php
  39. 132 126
      resources/views/admin/shop/info.blade.php
  40. 91 79
      resources/views/admin/subscribe/index.blade.php
  41. 68 51
      resources/views/admin/subscribe/log.blade.php
  42. 18 0
      resources/views/admin/table_layouts.blade.php
  43. 138 132
      resources/views/admin/ticket/index.blade.php
  44. 154 137
      resources/views/admin/ticket/reply.blade.php
  45. 67 54
      resources/views/admin/tools/analysis.blade.php
  46. 60 62
      resources/views/admin/tools/convert.blade.php
  47. 42 40
      resources/views/admin/tools/decompile.blade.php
  48. 6 6
      resources/views/admin/tools/import.blade.php
  49. 115 114
      resources/views/admin/user/export.blade.php
  50. 66 60
      resources/views/admin/user/group/index.blade.php
  51. 54 51
      resources/views/admin/user/group/info.blade.php
  52. 330 299
      resources/views/admin/user/index.blade.php
  53. 294 313
      resources/views/admin/user/info.blade.php
  54. 18 18
      resources/views/admin/user/oauth.blade.php
  55. 6 6
      resources/views/auth/active.blade.php
  56. 13 13
      resources/views/auth/activeUser.blade.php
  57. 13 8
      resources/views/auth/captcha.blade.php
  58. 4 4
      resources/views/auth/error.blade.php
  59. 20 20
      resources/views/auth/free.blade.php
  60. 50 41
      resources/views/auth/login.blade.php
  61. 20 20
      resources/views/auth/maintenance.blade.php
  62. 158 139
      resources/views/auth/register.blade.php
  63. 12 13
      resources/views/auth/reset.blade.php
  64. 13 13
      resources/views/auth/resetPassword.blade.php
  65. 4 5
      resources/views/auth/safe.blade.php
  66. 7 7
      resources/views/components/alert.blade.php
  67. 1 1
      resources/views/components/message.blade.php
  68. 5 7
      resources/views/components/payment/detail.blade.php
  69. 3 3
      resources/views/components/system/input-file.blade.php
  70. 14 14
      resources/views/components/system/input-limit.blade.php
  71. 8 7
      resources/views/components/system/input-test.blade.php
  72. 7 7
      resources/views/components/system/input.blade.php
  73. 7 6
      resources/views/components/system/select.blade.php
  74. 7 6
      resources/views/components/system/switch.blade.php
  75. 2 2
      resources/views/components/system/tab-pane.blade.php
  76. 6 6
      resources/views/components/system/textarea.blade.php
  77. 0 2
      resources/views/mail/custom.blade.php
  78. 2 3
      resources/views/mail/simpleMarkdown.blade.php
  79. 16 17
      resources/views/user/components/notification.blade.php
  80. 3 3
      resources/views/user/components/notifications/accountExpire.blade.php
  81. 3 3
      resources/views/user/components/notifications/dataExhaust.blade.php
  82. 4 4
      resources/views/user/components/notifications/paymentReceived.blade.php
  83. 50 38
      resources/views/user/components/payment/default.blade.php
  84. 113 108
      resources/views/user/components/payment/manual.blade.php
  85. 6 4
      resources/views/user/components/payment/stripe.blade.php
  86. 19 19
      resources/views/user/components/purchase.blade.php
  87. 71 61
      resources/views/user/invite.blade.php
  88. 47 46
      resources/views/user/invoiceDetail.blade.php
  89. 112 99
      resources/views/user/invoices.blade.php
  90. 95 82
      resources/views/user/replyTicket.blade.php
  91. 173 163
      resources/views/user/services.blade.php
  92. 7 9
      resources/views/vendor/log-viewer/remark/dashboard.blade.php
  93. 35 21
      resources/views/vendor/log-viewer/remark/layouts.blade.php
  94. 95 94
      resources/views/vendor/log-viewer/remark/logs.blade.php
  95. 140 144
      resources/views/vendor/log-viewer/remark/show.blade.php

+ 2 - 0
package.json

@@ -6,8 +6,10 @@
         "build": "vite build"
     },
     "devDependencies": {
+        "@shufo/prettier-plugin-blade": "^1.14.1",
         "axios": "^1.1.2",
         "laravel-vite-plugin": "^0.7.5",
+        "prettier": "^3.3.2",
         "vite": "^4.0.0"
     }
 }

+ 38 - 38
resources/views/admin/aff/detail.blade.php

@@ -8,55 +8,55 @@
             <div class="panel-heading">
                 <h2 class="panel-title">{{ trans('admin.aff.commission_title') }}</h2>
                 <div class="panel-actions">
-                    @if($referral->status === -1)
+                    @if ($referral->status === -1)
                         <span class="badge badge-lg badge-danger"> {{ trans('common.status.rejected') }} </span>
                     @elseif($referral->status === 2)
                         <span class="badge badge-lg badge-success"> {{ trans('common.status.paid') }} </span>
                     @endif
-                    <a href="{{route('admin.aff.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.aff.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             <div class="panel-body">
                 <div class="example">
                     <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                         <thead class="thead-default">
-                        <tr>
-                            <th colspan="6">
-                                {{ trans('model.referral.id') }}: {{$referral->id}}
-                                |{{ trans('model.referral.user') }}: {{$referral->user->username}}
-                                |{{ trans('model.referral.amount') }}: {{$referral->amount_tag}}
-                                | {{ trans('model.referral.created_at') }}: {{$referral->created_at}}
-                            </th>
-                        </tr>
-                        <tr>
-                            <th> #</th>
-                            <th> {{ trans('model.aff.invitee') }}</th>
-                            <th> {{ trans('model.order.id') }}</th>
-                            <th> {{ trans('model.aff.amount') }}</th>
-                            <th> {{ trans('model.aff.commission') }}</th>
-                            <th> {{ trans('model.aff.created_at') }}</th>
-                        </tr>
-                        </thead>
-                        <tbody>
-                        @foreach($commissions as $commission)
-
                             <tr>
-                                <td> {{$commission->id}} </td>
-                                <td> {{$commission->invitee->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】'}} </td>
-                                <td>
-                                    @can('admin.order')
-                                        <a href="{{route('admin.order', ['id' => $commission->order->id])}}" target="_blank">
-                                            {{$commission->order->goods->name}}
-                                        </a>
-                                    @else
-                                        {{$commission->order->goods->name}}
-                                    @endcan
-                                </td>
-                                <td> {{$commission->amount_tag}} </td>
-                                <td> {{$commission->commission_tag}} </td>
-                                <td> {{$commission->created_at}} </td>
+                                <th colspan="6">
+                                    {{ trans('model.referral.id') }}: {{ $referral->id }}
+                                    |{{ trans('model.referral.user') }}: {{ $referral->user->username }}
+                                    |{{ trans('model.referral.amount') }}: {{ $referral->amount_tag }}
+                                    | {{ trans('model.referral.created_at') }}: {{ $referral->created_at }}
+                                </th>
+                            </tr>
+                            <tr>
+                                <th> #</th>
+                                <th> {{ trans('model.aff.invitee') }}</th>
+                                <th> {{ trans('model.order.id') }}</th>
+                                <th> {{ trans('model.aff.amount') }}</th>
+                                <th> {{ trans('model.aff.commission') }}</th>
+                                <th> {{ trans('model.aff.created_at') }}</th>
                             </tr>
-                        @endforeach
+                        </thead>
+                        <tbody>
+                            @foreach ($commissions as $commission)
+                                <tr>
+                                    <td> {{ $commission->id }} </td>
+                                    <td> {{ $commission->invitee->username ?? '【' . trans('common.deleted_item', ['attribute' => trans('common.account')]) . '】' }}
+                                    </td>
+                                    <td>
+                                        @can('admin.order')
+                                            <a href="{{ route('admin.order', ['id' => $commission->order->id]) }}" target="_blank">
+                                                {{ $commission->order->goods->name }}
+                                            </a>
+                                        @else
+                                            {{ $commission->order->goods->name }}
+                                        @endcan
+                                    </td>
+                                    <td> {{ $commission->amount_tag }} </td>
+                                    <td> {{ $commission->commission_tag }} </td>
+                                    <td> {{ $commission->created_at }} </td>
+                                </tr>
+                            @endforeach
                         </tbody>
                     </table>
                 </div>
@@ -68,7 +68,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$commissions->links()}}
+                            {{ $commissions->links() }}
                         </nav>
                     </div>
                 </div>

+ 163 - 153
resources/views/admin/aff/index.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -11,11 +8,12 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-4">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('model.user.username') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('model.user.username') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="status" id="status" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="-1">{{ trans('common.status.rejected') }}</option>
                             <option value="0">{{ trans('common.status.review') }}</option>
                             <option value="1">{{ trans('common.status.reviewed') }}</option>
@@ -23,87 +21,88 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-1 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.aff.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.aff.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.referral.created_at') }}</th>
-                        <th> {{ trans('model.referral.user') }}</th>
-                        <th> {{ trans('model.referral.amount') }}</th>
-                        <th> {{ trans('common.status.attribute') }}</th>
-                        <th> {{ trans('model.aff.updated_at') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('model.referral.created_at') }}</th>
+                            <th> {{ trans('model.referral.user') }}</th>
+                            <th> {{ trans('model.referral.amount') }}</th>
+                            <th> {{ trans('common.status.attribute') }}</th>
+                            <th> {{ trans('model.aff.updated_at') }}</th>
+                            <th> {{ trans('common.action') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($applyList as $apply)
-                        <tr>
-                            <td> {{$apply->id}} </td>
-                            <td> {{$apply->created_at}} </td>
-                            <td>
-                                @if(empty($apply->user))
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    @can('admin.user.index')
-                                        <a href="{{route('admin.user.index', ['id'=>$apply->user_id])}}" target="_blank">
-                                            {{$apply->user->username}}
-                                        </a>
+                        @foreach ($applyList as $apply)
+                            <tr>
+                                <td> {{ $apply->id }} </td>
+                                <td> {{ $apply->created_at }} </td>
+                                <td>
+                                    @if (empty($apply->user))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
                                     @else
-                                        {{$apply->user->username}}
-                                    @endcan
-                                @endif
-                            </td>
-                            <td> {{$apply->amount_tag}} </td>
-                            <td>
-                                @if($apply->status === -1)
-                                    <span class="badge badge-lg badge-danger"> {{ trans('common.status.rejected') }} </span>
-                                @elseif($apply->status === 0)
-                                    <span class="badge badge-lg badge-info"> {{ trans('common.status.review') }} </span>
-                                @elseif($apply->status === 2)
-                                    <span class="badge badge-lg badge-success"> {{ trans('common.status.paid') }} </span>
-                                @else
-                                    <span class="badge badge-lg badge-default"> {{ trans('common.status.payment_pending') }} </span>
-                                @endif
-                            </td>
-                            <td> {{$apply->created_at === $apply->updated_at ? '' : $apply->updated_at}} </td>
-                            <td>
-                                @canany(['admin.aff.setStatus', 'admin.aff.detail'])
-                                    <div class="btn-group">
-                                        @can('admin.aff.setStatus')
-                                            @if($apply->status === 0)
-                                                <a href="javascript:setStatus('{{$apply->id}}','1')" class="btn btn-sm btn-success">
-                                                    <i class="icon wb-check" aria-hidden="true"></i>{{ trans('common.status.pass') }}
-                                                </a>
-                                                <a href="javascript:setStatus('{{$apply->id}}','-1')" class="btn btn-sm btn-danger">
-                                                    <i class="icon wb-close" aria-hidden="true"></i>{{ trans('common.status.reject') }}
-                                                </a>
-                                            @elseif($apply->status === 1)
-                                                @can('admin.user.updateCredit')
-                                                    <a href="javascript:handleUserCredit('{{$apply->user->id}}','{{$apply->amount}}', '{{$apply->id}}','2')" class="btn
+                                        @can('admin.user.index')
+                                            <a href="{{ route('admin.user.index', ['id' => $apply->user_id]) }}" target="_blank">
+                                                {{ $apply->user->username }}
+                                            </a>
+                                        @else
+                                            {{ $apply->user->username }}
+                                        @endcan
+                                    @endif
+                                </td>
+                                <td> {{ $apply->amount_tag }} </td>
+                                <td>
+                                    @if ($apply->status === -1)
+                                        <span class="badge badge-lg badge-danger"> {{ trans('common.status.rejected') }} </span>
+                                    @elseif($apply->status === 0)
+                                        <span class="badge badge-lg badge-info"> {{ trans('common.status.review') }} </span>
+                                    @elseif($apply->status === 2)
+                                        <span class="badge badge-lg badge-success"> {{ trans('common.status.paid') }} </span>
+                                    @else
+                                        <span class="badge badge-lg badge-default"> {{ trans('common.status.payment_pending') }} </span>
+                                    @endif
+                                </td>
+                                <td> {{ $apply->created_at === $apply->updated_at ? '' : $apply->updated_at }} </td>
+                                <td>
+                                    @canany(['admin.aff.setStatus', 'admin.aff.detail'])
+                                        <div class="btn-group">
+                                            @can('admin.aff.setStatus')
+                                                @if ($apply->status === 0)
+                                                    <a class="btn btn-sm btn-success" href="javascript:setStatus('{{ $apply->id }}','1')">
+                                                        <i class="icon wb-check" aria-hidden="true"></i>{{ trans('common.status.pass') }}
+                                                    </a>
+                                                    <a class="btn btn-sm btn-danger" href="javascript:setStatus('{{ $apply->id }}','-1')">
+                                                        <i class="icon wb-close" aria-hidden="true"></i>{{ trans('common.status.reject') }}
+                                                    </a>
+                                                @elseif($apply->status === 1)
+                                                    @can('admin.user.updateCredit')
+                                                        <a class="btn
                                                     btn-sm
-                                                    btn-success">
-                                                        <i id="makePayment_{{$apply->id}}" class="icon wb-payment"
-                                                           aria-hidden="true"></i> {{ trans('common.status.send_to_credit') }}
+                                                    btn-success"
+                                                           href="javascript:handleUserCredit('{{ $apply->user->id }}','{{ $apply->amount }}', '{{ $apply->id }}','2')">
+                                                            <i class="icon wb-payment" id="makePayment_{{ $apply->id }}" aria-hidden="true"></i>
+                                                            {{ trans('common.status.send_to_credit') }}
+                                                        </a>
+                                                    @endcan
+                                                    <a class="btn btn-sm btn-primary" href="javascript:setStatus('{{ $apply->id }}', '2')">
+                                                        <i class="icon wb-check-circle" aria-hidden="true"></i> {{ trans('common.status.paid') }}
                                                     </a>
-                                                @endcan
-                                                <a href="javascript:setStatus('{{$apply->id}}', '2')" class="btn btn-sm btn-primary">
-                                                    <i class="icon wb-check-circle" aria-hidden="true"></i> {{ trans('common.status.paid') }}
-                                                </a>
-                                            @endif
-                                        @endcan
-                                        @can('admin.aff.detail')
-                                            <a href="{{route('admin.aff.detail', $apply->id)}}" class="btn btn-sm btn-default">
-                                                <i class="icon wb-search"></i></a>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
-                        </tr>
-                    @endforeach
+                                                @endif
+                                            @endcan
+                                            @can('admin.aff.detail')
+                                                <a class="btn btn-sm btn-default" href="{{ route('admin.aff.detail', $apply->id) }}">
+                                                    <i class="icon wb-search"></i></a>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -114,91 +113,102 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$applyList->links()}}
+                            {{ $applyList->links() }}
                         </nav>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::query('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').selectpicker('val', @json(Request::query('status')));
+        });
 
-      @can('admin.aff.setStatus')
-      // 更改状态
-      function setStatus(id, status) {
-        $.ajax({
-          method: 'PUT',
-          url: '{{route('admin.aff.setStatus','')}}/' + id,
-          data: {
-            _token: '{{csrf_token()}}',
-            status: status,
-          },
-          dataType: 'json',
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({
-                title: '{{ trans('admin.hint') }}',
-                html: str,
-                icon: 'error',
-                confirmButtonText: '{{ trans('common.confirm') }}',
-              });
+        @can('admin.aff.setStatus')
+            // 更改状态
+            function setStatus(id, status) {
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.aff.setStatus', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        status: status,
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                    error: function(data) {
+                        let str = '';
+                        const errors = data.responseJSON;
+                        if ($.isEmptyObject(errors) === false) {
+                            $.each(errors.errors, function(index, value) {
+                                str += '<li>' + value + '</li>';
+                            });
+                            swal.fire({
+                                title: '{{ trans('admin.hint') }}',
+                                html: str,
+                                icon: 'error',
+                                confirmButtonText: '{{ trans('common.confirm') }}',
+                            });
+                        }
+                    },
+                });
             }
-          },
-        });
-      }
-      @endcan
+        @endcan
 
-      @can('admin.user.updateCredit')
-      // 余额充值
-      function handleUserCredit(uid, amount, aid, status) {
-        $.ajax({
-          url: '{{route('admin.user.updateCredit', '')}}/' + uid,
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', amount: amount, description: '{{ trans('admin.aff.referral') }}'},
-          beforeSend: function() {
-            $('#makePayment_' + aid).removeClass('wb-payment').addClass('wb-loop icon-spin');
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
-                setStatus(aid, status);
-              });
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        @can('admin.user.updateCredit')
+            // 余额充值
+            function handleUserCredit(uid, amount, aid, status) {
+                $.ajax({
+                    url: '{{ route('admin.user.updateCredit', '') }}/' + uid,
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        amount: amount,
+                        description: '{{ trans('admin.aff.referral') }}',
+                    },
+                    beforeSend: function() {
+                        $('#makePayment_' + aid).removeClass('wb-payment').addClass('wb-loop icon-spin');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false
+                            }).then(() => {
+                                setStatus(aid, status);
+                            });
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                    error: function() {
+                        $('#msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {},
+                });
             }
-          },
-          error: function() {
-            $('#msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-          },
-        });
-      }
         @endcan
     </script>
-@endsection
+@endpush

+ 84 - 79
resources/views/admin/aff/invite.blade.php

@@ -11,9 +11,9 @@
                         <h4 class="card-title cyan-600"><i class="icon wb-plus"></i>
                             {{ trans('common.generate_item', ['attribute' => trans('user.invite.attribute')]) }}
                         </h4>
-                        <x-alert type="info" :message="trans('user.invite.tips', ['num'=>10, 'days' => sysConfig('user_invite_days')])"/>
+                        <x-alert type="info" :message="trans('user.invite.tips', ['num' => 10, 'days' => sysConfig('user_invite_days')])" />
                         @can('admin.invite.create')
-                            <button type="button" class="btn btn-primary btn-animate btn-animate-side" onclick="makeInvite()">
+                            <button class="btn btn-primary btn-animate btn-animate-side" type="button" onclick="makeInvite()">
                                 <i class="icon wb-plus"></i> {{ trans('common.generate') }}
                             </button>
                         @endcan
@@ -35,35 +35,36 @@
                     <div class="panel-body">
                         <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                             <thead class="thead-default">
-                            <tr>
-                                <th> #</th>
-                                <th> {{ trans('user.invite.attribute') }} </th>
-                                <th> {{ trans('common.available_date') }} </th>
-                                <th> {{ trans('user.inviter') }}</th>
-                                <th> {{ trans('common.status.attribute') }} </th>
-                                <th> {{ trans('user.invitee') }} </th>
-                            </tr>
-                            </thead>
-                            <tbody>
-                            @foreach($inviteList as $invite)
                                 <tr>
-                                    <td> {{$invite->id}} </td>
-                                    <td>
-                                        <a href="javascript:void(0)" class="mt-clipboard" data-clipboard-action="copy"
-                                           data-clipboard-text="{{route('register',['code' => $invite->code])}}">{{$invite->code}}</a>
-                                    </td>
-                                    <td> {{$invite->dateline}} </td>
-                                    <td>
-                                        {{$invite->inviter_id === null ? trans('admin.system_generate') : ($invite->inviter->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】')}}
-                                    </td>
-                                    <td>
-                                        {!!$invite->status_label!!}
-                                    </td>
-                                    <td>
-                                        {{$invite->status === 1 ? ($invite->invitee->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】') : ''}}
-                                    </td>
+                                    <th> #</th>
+                                    <th> {{ trans('user.invite.attribute') }} </th>
+                                    <th> {{ trans('common.available_date') }} </th>
+                                    <th> {{ trans('user.inviter') }}</th>
+                                    <th> {{ trans('common.status.attribute') }} </th>
+                                    <th> {{ trans('user.invitee') }} </th>
                                 </tr>
-                            @endforeach
+                            </thead>
+                            <tbody>
+                                @foreach ($inviteList as $invite)
+                                    <tr>
+                                        <td> {{ $invite->id }} </td>
+                                        <td>
+                                            <a class="mt-clipboard" data-clipboard-action="copy"
+                                               data-clipboard-text="{{ route('register', ['code' => $invite->code]) }}"
+                                               href="javascript:void(0)">{{ $invite->code }}</a>
+                                        </td>
+                                        <td> {{ $invite->dateline }} </td>
+                                        <td>
+                                            {{ $invite->inviter_id === null ? trans('admin.system_generate') : $invite->inviter->username ?? '【' . trans('common.deleted_item', ['attribute' => trans('common.account')]) . '】' }}
+                                        </td>
+                                        <td>
+                                            {!! $invite->status_label !!}
+                                        </td>
+                                        <td>
+                                            {{ $invite->status === 1 ? $invite->invitee->username ?? '【' . trans('common.deleted_item', ['attribute' => trans('common.account')]) . '】' : '' }}
+                                        </td>
+                                    </tr>
+                                @endforeach
                             </tbody>
                         </table>
                     </div>
@@ -74,7 +75,7 @@
                             </div>
                             <div class="col-md-8">
                                 <nav class="Page navigation float-right">
-                                    {{$inviteList->links()}}
+                                    {{ $inviteList->links() }}
                                 </nav>
                             </div>
                         </div>
@@ -83,7 +84,6 @@
             </div>
         </div>
     </div>
-
 @endsection
 @section('javascript')
     <script src="/assets/custom/clipboardjs/clipboard.min.js"></script>
@@ -91,65 +91,70 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
         @can('admin.invite.create')
-        // 生成邀请码
-        function makeInvite() {
-          $.ajax({
-            method: 'POST',
-            url: '{{route('admin.invite.create')}}',
-            dataType: 'json',
-            data: {_token: '{{csrf_token()}}'},
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
+            // 生成邀请码
+            function makeInvite() {
+                $.ajax({
+                    method: 'POST',
+                    url: '{{ route('admin.invite.create') }}',
+                    dataType: 'json',
+                    data: {
+                        _token: '{{ csrf_token() }}'
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                });
 
-          return false;
-        }
+                return false;
+            }
         @endcan
 
         @can('admin.invite.export')
-        // 导出邀请码
-        function exportInvite() {
-          swal.fire({
-            title: '{{ trans('admin.hint') }}',
-            text: '{{ trans('admin.confirm.export') }}',
-            icon: 'question',
-            showCancelButton: true,
-            cancelButtonText: '{{ trans('common.close') }}',
-            confirmButtonText: '{{ trans('common.confirm') }}',
-          }).then((result) => {
-            if (result.value) {
-              window.location.href = '{{route('admin.invite.export')}}';
+            // 导出邀请码
+            function exportInvite() {
+                swal.fire({
+                    title: '{{ trans('admin.hint') }}',
+                    text: '{{ trans('admin.confirm.export') }}',
+                    icon: 'question',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        window.location.href = '{{ route('admin.invite.export') }}';
+                    }
+                });
             }
-          });
-        }
         @endcan
 
         const clipboard = new ClipboardJS('.mt-clipboard');
         clipboard.on('success', function() {
-          swal.fire({
-            title: '{{ trans('common.copy.success') }}',
-            icon: 'success',
-            timer: 1300,
-            showConfirmButton: false,
-          });
+            swal.fire({
+                title: '{{ trans('common.copy.success') }}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
         clipboard.on('error', function() {
-          swal.fire({
-            title: '{{ trans('common.copy.failed') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
+            swal.fire({
+                title: '{{ trans('common.copy.failed') }}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
     </script>
 @endsection

+ 61 - 65
resources/views/admin/aff/rebate.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -11,74 +8,76 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="invitee_username" value="{{Request::query('invitee_username')}}"
-                               placeholder="{{ trans('model.aff.invitee') }}"/>
+                        <input class="form-control" name="invitee_username" type="text" value="{{ Request::query('invitee_username') }}"
+                               placeholder="{{ trans('model.aff.invitee') }}" />
                     </div>
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="inviter_username" value="{{Request::query('inviter_username')}}"
-                               placeholder="{{ trans('model.user.inviter') }}"/>
+                        <input class="form-control" name="inviter_username" type="text" value="{{ Request::query('inviter_username') }}"
+                               placeholder="{{ trans('model.user.inviter') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select name="status" id="status" class="form-control" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="0">{{ trans('common.status.unwithdrawn') }}</option>
                             <option value="1">{{ trans('common.status.applying') }}</option>
                             <option value="2">{{ trans('common.status.withdrawn') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.aff.rebate')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.aff.rebate') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.aff.invitee') }}</th>
-                        <th> {{ trans('model.user.inviter') }}</th>
-                        <th> {{ trans('model.order.id') }}</th>
-                        <th> {{ trans('model.aff.amount') }}</th>
-                        <th> {{ trans('model.aff.commission') }}</th>
-                        <th> {{ trans('model.aff.created_at') }}</th>
-                        <th> {{ trans('model.aff.updated_at') }}</th>
-                        <th> {{ trans('common.status.attribute') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($referralLogs as $referralLog)
                         <tr>
-                            <td> {{$referralLog->id}} </td>
-                            <td>
-                                @if(empty($referralLog->invitee))
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    <a href="{{route('admin.aff.rebate',['invitee_username' => $referralLog->invitee->username])}}"> {{$referralLog->invitee->username}} </a>
-                                @endif
-                            </td>
-                            <td>
-                                @if(empty($referralLog->inviter))
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    <a href="{{route('admin.aff.rebate',['inviter_username' => $referralLog->inviter->username])}}"> {{$referralLog->inviter->username}} </a>
-                                @endif
-                            </td>
-                            <td> {{$referralLog->order_id}} </td>
-                            <td> {{$referralLog->amount}} </td>
-                            <td> {{$referralLog->commission}} </td>
-                            <td> {{$referralLog->created_at}} </td>
-                            <td> {{$referralLog->updated_at}} </td>
-                            <td>
-                                @if ($referralLog->status === 1)
-                                    <span class="badge badge-danger">{{ trans('common.status.applying') }}</span>
-                                @elseif($referralLog->status === 2)
-                                    <span class="badge badge-default">{{ trans('common.status.withdrawn') }}</span>
-                                @else
-                                    <span class="badge badge-info">{{ trans('common.status.unwithdrawn') }}</span>
-                                @endif
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.aff.invitee') }}</th>
+                            <th> {{ trans('model.user.inviter') }}</th>
+                            <th> {{ trans('model.order.id') }}</th>
+                            <th> {{ trans('model.aff.amount') }}</th>
+                            <th> {{ trans('model.aff.commission') }}</th>
+                            <th> {{ trans('model.aff.created_at') }}</th>
+                            <th> {{ trans('model.aff.updated_at') }}</th>
+                            <th> {{ trans('common.status.attribute') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($referralLogs as $referralLog)
+                            <tr>
+                                <td> {{ $referralLog->id }} </td>
+                                <td>
+                                    @if (empty($referralLog->invitee))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
+                                    @else
+                                        <a href="{{ route('admin.aff.rebate', ['invitee_username' => $referralLog->invitee->username]) }}">
+                                            {{ $referralLog->invitee->username }} </a>
+                                    @endif
+                                </td>
+                                <td>
+                                    @if (empty($referralLog->inviter))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
+                                    @else
+                                        <a href="{{ route('admin.aff.rebate', ['inviter_username' => $referralLog->inviter->username]) }}">
+                                            {{ $referralLog->inviter->username }} </a>
+                                    @endif
+                                </td>
+                                <td> {{ $referralLog->order_id }} </td>
+                                <td> {{ $referralLog->amount }} </td>
+                                <td> {{ $referralLog->commission }} </td>
+                                <td> {{ $referralLog->created_at }} </td>
+                                <td> {{ $referralLog->updated_at }} </td>
+                                <td>
+                                    @if ($referralLog->status === 1)
+                                        <span class="badge badge-danger">{{ trans('common.status.applying') }}</span>
+                                    @elseif($referralLog->status === 2)
+                                        <span class="badge badge-default">{{ trans('common.status.withdrawn') }}</span>
+                                    @else
+                                        <span class="badge badge-info">{{ trans('common.status.unwithdrawn') }}</span>
+                                    @endif
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -89,21 +88,18 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$referralLogs->links()}}
+                            {{ $referralLogs->links() }}
                         </nav>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::query('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').selectpicker('val', @json(Request::query('status')));
+        });
     </script>
-@endsection
+@endpush

+ 121 - 115
resources/views/admin/article/index.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -9,7 +6,7 @@
                 <h3 class="panel-title">{{ trans('admin.article.title') }}</h3>
                 @can('admin.article.create')
                     <div class="panel-actions">
-                        <a href="{{route('admin.article.create')}}" class="btn btn-primary">
+                        <a class="btn btn-primary" href="{{ route('admin.article.create') }}">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -18,94 +15,103 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-1 col-md-1 col-sm-4">
-                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="ID"/>
+                        <input class="form-control" type="number" value="{{ Request::query('id') }}" placeholder="ID" />
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="type" name="type">
-                            <option value="" hidden>{{ trans('model.common.type') }}</option>
+                        <select class="form-control" id="type" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.common.type') }}">
                             <option value="1">{{ trans('admin.article.type.knowledge') }}</option>
                             <option value="2">{{ trans('admin.article.type.announcement') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="category" name="category">
-                            <option value="" hidden>{{ trans('model.article.category') }}</option>
-                            @foreach($categories as $category)
-                                <option value="{{$category->category}}">{{$category->category}}</option>
+                        <select class="form-control" id="category" name="category" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.article.category') }}">
+                            @foreach ($categories as $category)
+                                <option value="{{ $category->category }}">{{ $category->category }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="language" name="language">
-                            <option value="" hidden>{{ trans('model.article.language') }}</option>
+                        <select class="form-control" id="language" name="language" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.article.language') }}">
                             @foreach (config('common.language') as $key => $value)
-                                <option value="{{$key}}">
-                                    <i class="fi fi-{{$value[1]}}" aria-hidden="true"></i>
-                                    <span style="padding: inherit;">{{$value[0]}}</span>
+                                <option value="{{ $key }}">
+                                    <i class="fi fi-{{ $value[1] }}" aria-hidden="true"></i>
+                                    <span style="padding: inherit;">{{ $value[0] }}</span>
                                 </option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.article.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.article.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.common.type') }}</th>
-                        <th> {{ trans('model.article.category') }}</th>
-                        <th> {{ trans('validation.attributes.title') }}</th>
-                        <th> {{ trans('model.article.language') }}</th>
-                        <th> {{ trans('model.common.sort') }}</th>
-                        <th> {{ trans('model.article.created_at') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($articles as $article)
                         <tr>
-                            <td> {{$article->id}} </td>
-                            @if ($article->type === 1)
-                                <td> {{ trans('admin.article.type.knowledge') }}</td>
-                            @elseif ($article->type === 2)
-                                <td> {{ trans('admin.article.type.announcement') }}</td>
-                            @else
-                                <td> {{ trans('common.status.unknown') }}</td>
-                            @endif
-                            <td class="text-left">
-                                {{ Str::limit($article->category, 30) }}
-                            </td>
-                            <td class="text-left">
-                                {{ Str::limit($article->title, 50) }}
-                            </td>
-                            <td>
-                            {!! isset(config('common.language')[$article->language]) ? '<i class="fi fi-'.config('common.language')[$article->language][1].' aria-hidden="true"></i>
-                             <span style="padding: inherit;">'.config('common.language')[$article->language][0].'</span>': __('common.status.unknown') !!}
-                            <td> {{$article->sort}} </td>
-                            <td> {{$article->created_at}} </td>
-                            <td>
-                                @canany(['admin.article.edit', 'admin.article.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.article.show')
-                                            <a href="{{route('admin.article.show',$article)}}" class="btn btn-outline-success">
-                                                <i class="icon wb-eye" aria-hidden="true"></i></a>
-                                        @endcan
-                                        @can('admin.article.edit')
-                                            <a href="{{route('admin.article.edit',['article'=>$article->id, 'page'=>Request::query('page')])}}" class="btn btn-outline-primary">
-                                                <i class="icon wb-edit" aria-hidden="true"></i></a>
-                                        @endcan
-                                        @can('admin.article.destroy')
-                                            <a class="btn btn-outline-danger" href="javascript:delArticle('{{route('admin.article.destroy',$article->id)}}', '{{$article->id}}')">
-                                                <i class="icon wb-close" aria-hidden="true"></i></a>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.common.type') }}</th>
+                            <th> {{ trans('model.article.category') }}</th>
+                            <th> {{ trans('validation.attributes.title') }}</th>
+                            <th> {{ trans('model.article.language') }}</th>
+                            <th> {{ trans('model.common.sort') }}</th>
+                            <th> {{ trans('model.article.created_at') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($articles as $article)
+                            <tr>
+                                <td> {{ $article->id }} </td>
+                                @if ($article->type === 1)
+                                    <td> {{ trans('admin.article.type.knowledge') }}</td>
+                                @elseif ($article->type === 2)
+                                    <td> {{ trans('admin.article.type.announcement') }}</td>
+                                @else
+                                    <td> {{ trans('common.status.unknown') }}</td>
+                                @endif
+                                <td class="text-left">
+                                    {{ Str::limit($article->category, 30) }}
+                                </td>
+                                <td class="text-left">
+                                    @if (! empty($article->logo))
+                                        <img class="mr-5" src="{{ asset($article->logo) }}" alt="logo" style="height: 32px" loading="lazy" />
+                                    @endif
+                                    {{ Str::limit($article->title, 50) }}
+                                </td>
+                                <td>
+                                    @if (isset(config('common.language')[$article->language]))
+                                        <i class="fi fi-{{ config('common.language')[$article->language][1] }}" aria-hidden="true"></i>
+                                        <span style="padding: inherit;">{{ config('common.language')[$article->language][0] }}</span>
+                                    @else
+                                        {{ __('common.status.unknown') }}
+                                    @endif
+                                <td> {{ $article->sort }} </td>
+                                <td> {{ $article->created_at }} </td>
+                                <td>
+                                    @canany(['admin.article.show', 'admin.article.edit', 'admin.article.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.article.show')
+                                                <a class="btn btn-outline-success" href="{{ route('admin.article.show', $article) }}">
+                                                    <i class="icon wb-eye" aria-hidden="true"></i></a>
+                                            @endcan
+                                            @can('admin.article.edit')
+                                                <a class="btn btn-outline-primary"
+                                                   href="{{ route('admin.article.edit', ['article' => $article->id, 'page' => Request::query('page')]) }}">
+                                                    <i class="icon wb-edit" aria-hidden="true"></i></a>
+                                            @endcan
+                                            @can('admin.article.destroy')
+                                                <a class="btn btn-outline-danger"
+                                                   href="javascript:delArticle('{{ route('admin.article.destroy', $article->id) }}', '{{ $article->id }}')">
+                                                    <i class="icon wb-close" aria-hidden="true"></i></a>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -116,7 +122,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$articles->links()}}
+                            {{ $articles->links() }}
                         </nav>
                     </div>
                 </div>
@@ -124,53 +130,53 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     @can('admin.article.destroy')
         <script>
-          $(document).ready(function() {
-            $('#id').val('{{Request::query('id')}}');
-            $('#type').val('{{Request::query('type')}}');
-            $('#category').val('{{Request::query('category')}}');
-            $('#language').val('{{Request::query('language')}}');
-            $('select').on('change', function() {
-              this.form.submit();
-            });
-          });
+            $(document).ready(function() {
+                $('#type').selectpicker('val', @json(Request::query('type')))
+                $('#category').selectpicker('val', @json(Request::query('category')))
+                $('#language').selectpicker('val', @json(Request::query('language')))
+            })
 
-          // 删除文章
-          function delArticle(url, id) {
-            swal.fire({
-              title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.article.attribute')]) }}' + id +
-                  '{{ trans('admin.confirm.delete.1') }}',
-              icon: 'question',
-              showCancelButton: true,
-              cancelButtonText: '{{ trans('common.close') }}',
-              confirmButtonText: '{{ trans('common.confirm') }}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({
-                        title: ret.message,
-                        icon: 'success',
-                        timer: 1000,
-                        showConfirmButton: false,
-                      }).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除文章
+            function delArticle(url, id) {
+                swal.fire({
+                    title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.article.attribute')]) }}' +
+                        id +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'question',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}',
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload())
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error',
+                                    }).then(() => window.location.reload())
+                                }
+                            },
+                        })
                     }
-                  },
-                });
-              }
-            });
-          }
+                })
+            }
         </script>
     @endcan
-@endsection
+@endpush

+ 894 - 801
resources/views/admin/config/common.blade.php

@@ -7,31 +7,32 @@
         <div class="panel">
             <div class="panel-heading">
                 <h1 class="panel-title">
-                    <i class="icon wb-settings" aria-hidden="true"></i>{{ trans('admin.setting.common.title') }}</h1>
+                    <i class="icon wb-settings" aria-hidden="true"></i>{{ trans('admin.setting.common.title') }}
+                </h1>
             </div>
             <div class="panel-body container-fluid">
                 <div class="nav-tabs-vertical" data-plugin="tabs">
                     <ul class="nav nav-tabs mr-25" role="tablist">
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link active" data-toggle="tab" href="#method" aria-controls="method" role="tab">{{ trans('model.node.method') }}</a>
+                            <a class="nav-link active" data-toggle="tab" href="#method" role="tab" aria-controls="method">{{ trans('model.node.method') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#protocol" aria-controls="protocol" role="tab">{{ trans('model.node.protocol') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#protocol" role="tab" aria-controls="protocol">{{ trans('model.node.protocol') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#obfs" aria-controls="obfs" role="tab">{{ trans('model.node.obfs') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#obfs" role="tab" aria-controls="obfs">{{ trans('model.node.obfs') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#level" aria-controls="level" role="tab">{{ trans('model.common.level') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#level" role="tab" aria-controls="level">{{ trans('model.common.level') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#country" aria-controls="country" role="tab">{{ trans('model.node.country') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#country" role="tab" aria-controls="country">{{ trans('model.node.country') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#label" aria-controls="label" role="tab">{{ trans('model.node.label') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#label" role="tab" aria-controls="label">{{ trans('model.node.label') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#category" aria-controls="category" role="tab">{{ trans('model.goods.category') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#category" role="tab" aria-controls="category">{{ trans('model.goods.category') }}</a>
                         </li>
                     </ul>
                     <div class="tab-content py-15">
@@ -41,31 +42,31 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('validation.attributes.name') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($methods as $method)
                                     <tr>
-                                        <td> {{$method->name}}</td>
-                                        <td>
-                                            @if($method->is_default)
-                                                <span class='badge badge-lg badge-default'>{{ trans('common.default') }}</span>
-                                            @else
-                                                <div class="btn-group">
-                                                    <button class="btn btn-primary" onclick="setDefault('{{$method->id}}')">
-                                                        {{ trans('admin.setting.common.set_default') }}
-                                                    </button>
-                                                    <button class="btn btn-danger" onclick="delConfig('{{$method->id}}','{{$method->name}}')">
-                                                        <i class="icon wb-trash"></i>
-                                                    </button>
-                                                </div>
-                                            @endif
-                                        </td>
+                                        <th> {{ trans('validation.attributes.name') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($methods as $method)
+                                        <tr>
+                                            <td> {{ $method->name }}</td>
+                                            <td>
+                                                @if ($method->is_default)
+                                                    <span class='badge badge-lg badge-default'>{{ trans('common.default') }}</span>
+                                                @else
+                                                    <div class="btn-group">
+                                                        <button class="btn btn-primary" onclick="setDefault('{{ $method->id }}')">
+                                                            {{ trans('admin.setting.common.set_default') }}
+                                                        </button>
+                                                        <button class="btn btn-danger" onclick="delConfig('{{ $method->id }}','{{ $method->name }}')">
+                                                            <i class="icon wb-trash"></i>
+                                                        </button>
+                                                    </div>
+                                                @endif
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -75,31 +76,31 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('validation.attributes.name') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($protocols as $protocol)
                                     <tr>
-                                        <td> {{$protocol->name}}</td>
-                                        <td>
-                                            @if($protocol->is_default)
-                                                <span class="badge badge-lg badge-default">{{ trans('common.default') }}</span>
-                                            @else
-                                                <div class="btn-group">
-                                                    <button class="btn btn-primary" onclick="setDefault('{{$protocol->id}}')">
-                                                        {{ trans('admin.setting.common.set_default') }}
-                                                    </button>
-                                                    <button class="btn btn-danger" onclick="delConfig('{{$protocol->id}}','{{$protocol->name}}')">
-                                                        <i class="icon wb-trash"></i>
-                                                    </button>
-                                                </div>
-                                            @endif
-                                        </td>
+                                        <th> {{ trans('validation.attributes.name') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($protocols as $protocol)
+                                        <tr>
+                                            <td> {{ $protocol->name }}</td>
+                                            <td>
+                                                @if ($protocol->is_default)
+                                                    <span class="badge badge-lg badge-default">{{ trans('common.default') }}</span>
+                                                @else
+                                                    <div class="btn-group">
+                                                        <button class="btn btn-primary" onclick="setDefault('{{ $protocol->id }}')">
+                                                            {{ trans('admin.setting.common.set_default') }}
+                                                        </button>
+                                                        <button class="btn btn-danger" onclick="delConfig('{{ $protocol->id }}','{{ $protocol->name }}')">
+                                                            <i class="icon wb-trash"></i>
+                                                        </button>
+                                                    </div>
+                                                @endif
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -109,31 +110,31 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('validation.attributes.name') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($obfsList as $obfs)
                                     <tr>
-                                        <td> {{$obfs->name}}</td>
-                                        <td>
-                                            @if($obfs->is_default)
-                                                <span class="badge badge-lg badge-default">{{ trans('common.default') }}</span>
-                                            @else
-                                                <div class="btn-group">
-                                                    <button class="btn btn-primary" onclick="setDefault('{{$obfs->id}}')">
-                                                        {{ trans('admin.setting.common.set_default') }}
-                                                    </button>
-                                                    <button class="btn btn-danger" onclick="delConfig('{{$obfs->id}}','{{$obfs->name}}')">
-                                                        <i class="icon wb-trash"></i>
-                                                    </button>
-                                                </div>
-                                            @endif
-                                        </td>
+                                        <th> {{ trans('validation.attributes.name') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($obfsList as $obfs)
+                                        <tr>
+                                            <td> {{ $obfs->name }}</td>
+                                            <td>
+                                                @if ($obfs->is_default)
+                                                    <span class="badge badge-lg badge-default">{{ trans('common.default') }}</span>
+                                                @else
+                                                    <div class="btn-group">
+                                                        <button class="btn btn-primary" onclick="setDefault('{{ $obfs->id }}')">
+                                                            {{ trans('admin.setting.common.set_default') }}
+                                                        </button>
+                                                        <button class="btn btn-danger" onclick="delConfig('{{ $obfs->id }}','{{ $obfs->name }}')">
+                                                            <i class="icon wb-trash"></i>
+                                                        </button>
+                                                    </div>
+                                                @endif
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -143,31 +144,34 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('model.common.level') }}</th>
-                                    <th> {{ trans('validation.attributes.name') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($levels as $level)
                                     <tr>
-                                        <td>
-                                            <input type="text" class="form-control" name="level" id="level_{{$level->id}}" value="{{$level->level}}"/>
-                                        </td>
-                                        <td>
-                                            <input type="text" class="form-control" name="level_name" id="level_name_{{$level->id}}" value="{{$level->name}}"/>
-                                        </td>
-                                        <td>
-                                            <div class="btn-group">
-                                                <button type="button" class="btn btn-primary" onclick="updateLevel('{{$level->id}}')">
-                                                    <i class="icon wb-edit" aria-hidden="true"></i></button>
-                                                <button type="button" class="btn btn-danger" onclick="delLevel('{{$level->id}}','{{$level->name}}')">
-                                                    <i class="icon wb-trash"></i></button>
-                                            </div>
-                                        </td>
+                                        <th> {{ trans('model.common.level') }}</th>
+                                        <th> {{ trans('validation.attributes.name') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($levels as $level)
+                                        <tr>
+                                            <td>
+                                                <input class="form-control" id="level_{{ $level->id }}" name="level" type="text"
+                                                       value="{{ $level->level }}" />
+                                            </td>
+                                            <td>
+                                                <input class="form-control" id="level_name_{{ $level->id }}" name="level_name" type="text"
+                                                       value="{{ $level->name }}" />
+                                            </td>
+                                            <td>
+                                                <div class="btn-group">
+                                                    <button class="btn btn-primary" type="button" onclick="updateLevel('{{ $level->id }}')">
+                                                        <i class="icon wb-edit" aria-hidden="true"></i></button>
+                                                    <button class="btn btn-danger" type="button"
+                                                            onclick="delLevel('{{ $level->id }}','{{ $level->name }}')">
+                                                        <i class="icon wb-trash"></i></button>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -177,31 +181,34 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('validation.attributes.name') }}</th>
-                                    <th> {{ trans('model.common.sort') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($categories as $category)
                                     <tr>
-                                        <td>
-                                            <input type="text" class="form-control" name="name" id="category_name_{{$category->id}}" value="{{$category->name}}"/>
-                                        </td>
-                                        <td>
-                                            <input type="text" class="form-control" name="sort" id="category_sort_{{$category->id}}" value="{{$category->sort}}"/>
-                                        </td>
-                                        <td>
-                                            <div class="btn-group">
-                                                <button type="button" class="btn btn-primary" onclick="updateCategory('{{$category->id}}')">
-                                                    <i class="icon wb-edit" aria-hidden="true"></i></button>
-                                                <button type="button" class="btn btn-danger" onclick="delCategory('{{$category->id}}','{{$category->name}}')">
-                                                    <i class="icon wb-trash"></i></button>
-                                            </div>
-                                        </td>
+                                        <th> {{ trans('validation.attributes.name') }}</th>
+                                        <th> {{ trans('model.common.sort') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($categories as $category)
+                                        <tr>
+                                            <td>
+                                                <input class="form-control" id="category_name_{{ $category->id }}" name="name" type="text"
+                                                       value="{{ $category->name }}" />
+                                            </td>
+                                            <td>
+                                                <input class="form-control" id="category_sort_{{ $category->id }}" name="sort" type="text"
+                                                       value="{{ $category->sort }}" />
+                                            </td>
+                                            <td>
+                                                <div class="btn-group">
+                                                    <button class="btn btn-primary" type="button" onclick="updateCategory('{{ $category->id }}')">
+                                                        <i class="icon wb-edit" aria-hidden="true"></i></button>
+                                                    <button class="btn btn-danger" type="button"
+                                                            onclick="delCategory('{{ $category->id }}','{{ $category->name }}')">
+                                                        <i class="icon wb-trash"></i></button>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -211,35 +218,37 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('model.country.icon') }}</th>
-                                    <th> {{ trans('model.country.code') }}</th>
-                                    <th> {{ trans('model.country.name') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($countries as $country)
                                     <tr>
-                                        <td>
-                                            <i class="fi fis fi-{{$country->code}} h-40 w-40" aria-hidden="true"></i>
-                                        </td>
-                                        <td>
-                                            {{$country->code}}
-                                        </td>
-                                        <td>
-                                            <input type="text" class="form-control" name="country_name" id="country_{{$country->code}}" value="{{$country->name}}"/>
-                                        </td>
-                                        <td>
-                                            <div class="btn-group">
-                                                <button type="button" class="btn btn-primary" onclick="updateCountry('{{$country->code}}')">
-                                                    <i class="icon wb-edit" aria-hidden="true"></i></button>
-                                                <button type="button" class="btn btn-danger" onclick="delCountry('{{$country->code}}','{{$country->name}}')">
-                                                    <i class="icon wb-trash"></i></button>
-                                            </div>
-                                        </td>
+                                        <th> {{ trans('model.country.icon') }}</th>
+                                        <th> {{ trans('model.country.code') }}</th>
+                                        <th> {{ trans('model.country.name') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($countries as $country)
+                                        <tr>
+                                            <td>
+                                                <i class="fi fis fi-{{ $country->code }} h-40 w-40" aria-hidden="true"></i>
+                                            </td>
+                                            <td>
+                                                {{ $country->code }}
+                                            </td>
+                                            <td>
+                                                <input class="form-control" id="country_{{ $country->code }}" name="country_name" type="text"
+                                                       value="{{ $country->name }}" />
+                                            </td>
+                                            <td>
+                                                <div class="btn-group">
+                                                    <button class="btn btn-primary" type="button" onclick="updateCountry('{{ $country->code }}')">
+                                                        <i class="icon wb-edit" aria-hidden="true"></i></button>
+                                                    <button class="btn btn-danger" type="button"
+                                                            onclick="delCountry('{{ $country->code }}','{{ $country->name }}')">
+                                                        <i class="icon wb-trash"></i></button>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -249,33 +258,36 @@
                             </button>
                             <table class="text-md-center" data-toggle="table" data-height="700" data-virtual-scroll="true" data-mobile-responsive="true">
                                 <thead class="thead-default">
-                                <tr>
-                                    <th> {{ trans('validation.attributes.name') }}</th>
-                                    <th> {{ trans('admin.setting.common.connect_nodes') }}</th>
-                                    <th> {{ trans('model.common.sort') }}</th>
-                                    <th> {{ trans('common.action') }}</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                @foreach($labels as $label)
                                     <tr>
-                                        <td>
-                                            <input type="text" class="form-control" name="label_name" id="label_name_{{$label->id}}" value="{{$label->name}}"/>
-                                        </td>
-                                        <td> {{$label->nodes->count()}} </td>
-                                        <td>
-                                            <input type="number" class="form-control" name="label_sort" id="label_sort_{{$label->id}}" value="{{$label->sort}}"/>
-                                        </td>
-                                        <td>
-                                            <div class="btn-group">
-                                                <button type="button" class="btn btn-primary" onclick="updateLabel('{{$label->id}}')">
-                                                    <i class="icon wb-edit" aria-hidden="true"></i></button>
-                                                <button type="button" class="btn btn-danger" onclick="delLabel('{{$label->id}}','{{$label->name}}')">
-                                                    <i class="icon wb-trash"></i></button>
-                                            </div>
-                                        </td>
+                                        <th> {{ trans('validation.attributes.name') }}</th>
+                                        <th> {{ trans('admin.setting.common.connect_nodes') }}</th>
+                                        <th> {{ trans('model.common.sort') }}</th>
+                                        <th> {{ trans('common.action') }}</th>
                                     </tr>
-                                @endforeach
+                                </thead>
+                                <tbody>
+                                    @foreach ($labels as $label)
+                                        <tr>
+                                            <td>
+                                                <input class="form-control" id="label_name_{{ $label->id }}" name="label_name" type="text"
+                                                       value="{{ $label->name }}" />
+                                            </td>
+                                            <td> {{ $label->nodes->count() }} </td>
+                                            <td>
+                                                <input class="form-control" id="label_sort_{{ $label->id }}" name="label_sort" type="number"
+                                                       value="{{ $label->sort }}" />
+                                            </td>
+                                            <td>
+                                                <div class="btn-group">
+                                                    <button class="btn btn-primary" type="button" onclick="updateLabel('{{ $label->id }}')">
+                                                        <i class="icon wb-edit" aria-hidden="true"></i></button>
+                                                    <button class="btn btn-danger" type="button"
+                                                            onclick="delLabel('{{ $label->id }}','{{ $label->name }}')">
+                                                        <i class="icon wb-trash"></i></button>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    @endforeach
                                 </tbody>
                             </table>
                         </div>
@@ -285,27 +297,27 @@
         </div>
     </div>
 
-    <div class="modal fade" id="add_config_modal" aria-hidden="true" role="dialog" tabindex="-1">
+    <div class="modal fade" id="add_config_modal" role="dialog" aria-hidden="true" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">{{ trans('common.add') }}</h4>
                 </div>
-                <form action="#" method="post" class="modal-body">
-                    <div class="alert alert-danger" style="display: none;" id="msg"></div>
+                <form class="modal-body" action="#" method="post">
+                    <div class="alert alert-danger" id="msg" style="display: none;"></div>
                     <div class="row">
                         <div class="col-md-6 form-group">
-                            <select class="form-control" name="type" id="type">
+                            <select class="form-control" id="type" name="type">
                                 <option value="1" selected>{{ trans('model.node.method') }}</option>
                                 <option value="2">{{ trans('model.node.protocol') }}</option>
                                 <option value="3">{{ trans('model.node.obfs') }}</option>
                             </select>
                         </div>
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="name" id="name" placeholder="{{ trans('validation.attributes.name') }}">
+                            <input class="form-control" id="name" name="name" type="text" placeholder="{{ trans('validation.attributes.name') }}">
                         </div>
                     </div>
                 </form>
@@ -317,112 +329,116 @@
         </div>
     </div>
 
-    <div class="modal fade" id="add_level_modal" aria-hidden="true" role="dialog" tabindex="-1">
+    <div class="modal fade" id="add_level_modal" role="dialog" aria-hidden="true" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">{{ trans('admin.action.add_item', ['attribute' => trans('model.common.level')]) }}</h4>
                 </div>
-                <form action="#" method="post" class="modal-body">
-                    <div class="alert alert-danger" style="display: none;" id="level_msg"></div>
+                <form class="modal-body" action="#" method="post">
+                    <div class="alert alert-danger" id="level_msg" style="display: none;"></div>
                     <div class="row">
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="level" id="add_level" placeholder="{{ trans('model.common.level') }}">
+                            <input class="form-control" id="add_level" name="level" type="text" placeholder="{{ trans('model.common.level') }}">
                         </div>
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="level_name" id="add_level_name" placeholder="{{ trans('validation.attributes.name') }}">
+                            <input class="form-control" id="add_level_name" name="level_name" type="text"
+                                   placeholder="{{ trans('validation.attributes.name') }}">
                         </div>
                     </div>
                 </form>
                 <div class="modal-footer">
-                    <button data-dismiss="modal" class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
+                    <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
                     <button class="btn btn-primary" onclick="addLevel()">{{ trans('common.submit') }}</button>
                 </div>
             </div>
         </div>
     </div>
 
-    <div class="modal fade" id="add_category_modal" aria-hidden="true" role="dialog" tabindex="-1">
+    <div class="modal fade" id="add_category_modal" role="dialog" aria-hidden="true" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">{{ trans('admin.action.add_item', ['attribute' => trans('model.goods.category')]) }}</h4>
                 </div>
-                <form action="#" method="post" class="modal-body">
-                    <div class="alert alert-danger" style="display: none;" id="category_msg"></div>
+                <form class="modal-body" action="#" method="post">
+                    <div class="alert alert-danger" id="category_msg" style="display: none;"></div>
                     <div class="row">
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="name" id="add_category_name" placeholder="{{ trans('validation.attributes.name') }}">
+                            <input class="form-control" id="add_category_name" name="name" type="text"
+                                   placeholder="{{ trans('validation.attributes.name') }}">
                         </div>
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="sort" id="add_category_sort" placeholder="{{ trans('model.common.sort') }}">
+                            <input class="form-control" id="add_category_sort" name="sort" type="text" placeholder="{{ trans('model.common.sort') }}">
                         </div>
                     </div>
                 </form>
                 <div class="modal-footer">
-                    <button data-dismiss="modal" class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
+                    <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
                     <button class="btn btn-primary" onclick="addCategory()">{{ trans('common.submit') }}</button>
                 </div>
             </div>
         </div>
     </div>
 
-    <div class="modal fade" id="add_country_modal" aria-hidden="true" role="dialog" tabindex="-1">
+    <div class="modal fade" id="add_country_modal" role="dialog" aria-hidden="true" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">{{ trans('admin.action.add_item', ['attribute' => trans('model.country.name')]) }}</h4>
                 </div>
-                <form action="#" method="post" class="modal-body">
-                    <div class="alert alert-danger" style="display: none;" id="country_msg"></div>
+                <form class="modal-body" action="#" method="post">
+                    <div class="alert alert-danger" id="country_msg" style="display: none;"></div>
                     <div class="row">
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="country_code" id="add_country_code" placeholder="{{ trans('model.country.code') }}">
+                            <input class="form-control" id="add_country_code" name="country_code" type="text"
+                                   placeholder="{{ trans('model.country.code') }}">
                         </div>
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="country_name" id="add_country_name" placeholder="{{ trans('model.country.name') }}">
+                            <input class="form-control" id="add_country_name" name="country_name" type="text"
+                                   placeholder="{{ trans('model.country.name') }}">
                         </div>
                     </div>
                 </form>
                 <div class="modal-footer">
-                    <button data-dismiss="modal" class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
+                    <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
                     <button class="btn btn-primary" onclick="addCountry()">{{ trans('common.submit') }}</button>
                 </div>
             </div>
         </div>
     </div>
 
-    <div class="modal fade" id="add_label_modal" aria-hidden="true" role="dialog" tabindex="-1">
+    <div class="modal fade" id="add_label_modal" role="dialog" aria-hidden="true" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">{{ trans('admin.action.add_item', ['attribute' => trans('model.node.label')]) }}</h4>
                 </div>
-                <form action="#" method="post" class="modal-body">
-                    <div class="alert alert-danger" style="display: none;" id="lable_msg"></div>
+                <form class="modal-body" action="#" method="post">
+                    <div class="alert alert-danger" id="lable_msg" style="display: none;"></div>
                     <div class="row">
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="label" id="add_label" placeholder="{{ trans('validation.attributes.name') }}">
+                            <input class="form-control" id="add_label" name="label" type="text" placeholder="{{ trans('validation.attributes.name') }}">
                         </div>
                         <div class="col-md-6 form-group">
-                            <input type="text" class="form-control" name="label_sort" id="add_label_sort" placeholder="{{ trans('model.common.sort') }}">
+                            <input class="form-control" id="add_label_sort" name="label_sort" type="text" placeholder="{{ trans('model.common.sort') }}">
                         </div>
                     </div>
                 </form>
                 <div class="modal-footer">
-                    <button data-dismiss="modal" class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
+                    <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
                     <button class="btn btn-primary" onclick="addLabel()">{{ trans('common.submit') }}</button>
                 </div>
             </div>
@@ -434,635 +450,712 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      function addLevel() { // 添加等级
-          @can('admin.config.level.store')
-        const level = $('#add_level').val();
-        const level_name = $('#add_level_name').val();
+        function addLevel() { // 添加等级
+            @can('admin.config.level.store')
+                const level = $('#add_level').val();
+                const level_name = $('#add_level_name').val();
 
-        if (level.trim() === '') {
-          $('#level_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.common.level')]) }}');
-          $('#level').focus();
-          return false;
-        }
+                if (level.trim() === '') {
+                    $('#level_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.common.level')]) }}');
+                    $('#level').focus();
+                    return false;
+                }
+
+                if (level_name.trim() === '') {
+                    $('#level_msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
+                    $('#level_name').focus();
+                    return false;
+                }
 
-        if (level_name.trim() === '') {
-          $('#level_msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
-          $('#level_name').focus();
-          return false;
+                $.ajax({
+                    url: '{{ route('admin.config.level.store') }}',
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        level: level,
+                        name: level_name
+                    },
+                    beforeSend: function() {
+                        $('#level_msg').show().html('{{ trans('admin.creating') }}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#level_msg').show().html(ret.message);
+                            return false;
+                        }
+                        $('#add_level_modal').modal('hide');
+                        window.location.reload();
+                    },
+                    error: function() {
+                        $('#level_msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {
+                        swal.fire({
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => window.location.reload());
+                    },
+                });
+            @endcan
+            @cannot('admin.config.level.store')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
         }
 
-        $.ajax({
-          url: '{{route('admin.config.level.store')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', level: level, name: level_name},
-          beforeSend: function() {
-            $('#level_msg').show().html('{{ trans('admin.creating') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#level_msg').show().html(ret.message);
-              return false;
-            }
-            $('#add_level_modal').modal('hide');
-            window.location.reload();
-          },
-          error: function() {
-            $('#level_msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-            swal.fire({icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-          },
-        });
-          @endcan
-          @cannot('admin.config.level.store')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function updateLevel(id) { // 更新等级
+            @can('admin.config.level.update')
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.config.level.update', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        level: $('#level_' + id).val(),
+                        name: $('#level_name_' + id).val(),
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                });
+            @endcan
+            @cannot('admin.config.level.update')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function updateLevel(id) { // 更新等级
-          @can('admin.config.level.update')
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.level.update', '')}}/' + id,
-            data: {
-              _token: '{{csrf_token()}}',
-              level: $('#level_' + id).val(),
-              name: $('#level_name_' + id).val(),
-            },
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
+        function delLevel(id, name) { // 删除等级
+            @can('admin.config.level.destroy')
+                swal.fire({
+                    title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.common.level')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'question',
+                    allowEnterKey: false,
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.config.level.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            @endcan
+            @cannot('admin.config.level.destroy')
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
-          @endcan
-          @cannot('admin.config.level.update')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function delLevel(id, name) { // 删除等级
-          @can('admin.config.level.destroy')
-          swal.fire({
-            title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.common.level')]) }}' + name +
-                '{{ trans('admin.confirm.delete.1') }}',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.level.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
-          @endcan
-          @cannot('admin.config.level.destroy')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function addCategory() { // 添加分类
+            @can('admin.config.category.store')
+                const name = $('#add_category_name').val();
+                const sort = $('#add_category_sort').val();
 
-      function addCategory() { // 添加分类
-          @can('admin.config.category.store')
-        const name = $('#add_category_name').val();
-        const sort = $('#add_category_sort').val();
+                if (name.trim() === '') {
+                    $('#category_msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
+                    $('#category_name').focus();
+                    return false;
+                }
 
-        if (name.trim() === '') {
-          $('#category_msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
-          $('#category_name').focus();
-          return false;
-        }
+                if (sort.trim() === '') {
+                    $('#category_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.common.sort')]) }}');
+                    $('#category_sort').focus();
+                    return false;
+                }
 
-        if (sort.trim() === '') {
-          $('#category_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.common.sort')]) }}');
-          $('#category_sort').focus();
-          return false;
+                $.ajax({
+                    url: '{{ route('admin.config.category.store') }}',
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: name,
+                        sort: sort
+                    },
+                    beforeSend: function() {
+                        $('#category_msg').show().html('{{ trans('admin.creating') }}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#category_msg').show().html(ret.message);
+                            return false;
+                        }
+                        $('#add_category_modal').modal('hide');
+                        window.location.reload();
+                    },
+                    error: function() {
+                        $('#category_msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {
+                        swal.fire({
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => window.location.reload());
+                    },
+                });
+            @endcan
+            @cannot('admin.config.category.store')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
         }
 
-        $.ajax({
-          url: '{{route('admin.config.category.store')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', name: name, sort: sort},
-          beforeSend: function() {
-            $('#category_msg').show().html('{{ trans('admin.creating') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#category_msg').show().html(ret.message);
-              return false;
-            }
-            $('#add_category_modal').modal('hide');
-            window.location.reload();
-          },
-          error: function() {
-            $('#category_msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-            swal.fire({icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-          },
-        });
-          @endcan
-          @cannot('admin.config.category.store')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function updateCategory(id) { // 更新分类
+            @can('admin.config.category.update')
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.config.category.update', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: $('#category_name_' + id).val(),
+                        sort: $('#category_sort_' + id).val(),
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                });
+            @endcan
+            @cannot('admin.config.category.update')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function updateCategory(id) { // 更新分类
-          @can('admin.config.category.update')
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.category.update', '')}}/' + id,
-            data: {
-              _token: '{{csrf_token()}}',
-              name: $('#category_name_' + id).val(),
-              sort: $('#category_sort_' + id).val(),
-            },
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
+        function delCategory(id, name) { // 删除分类
+            @can('admin.config.category.destroy')
+                swal.fire({
+                    title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.goods.category')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'question',
+                    allowEnterKey: false,
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.config.category.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            @endcan
+            @cannot('admin.config.category.destroy')
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
-          @endcan
-          @cannot('admin.config.category.update')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function delCategory(id, name) { // 删除分类
-          @can('admin.config.category.destroy')
-          swal.fire({
-            title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.goods.category')]) }}' + name +
-                '{{ trans('admin.confirm.delete.1') }}',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.category.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
-          @endcan
-          @cannot('admin.config.category.destroy')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function addCountry() { // 添加国家/地区
+            @can('admin.config.country.store')
+                const country_name = $('#add_country_name').val();
+                const country_code = $('#add_country_code').val();
 
-      function addCountry() { // 添加国家/地区
-          @can('admin.config.country.store')
-        const country_name = $('#add_country_name').val();
-        const country_code = $('#add_country_code').val();
+                if (country_code.trim() === '') {
+                    $('#country_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.country.code')]) }}');
+                    $('#add_country_code').focus();
+                    return false;
+                }
 
-        if (country_code.trim() === '') {
-          $('#country_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.country.code')]) }}');
-          $('#add_country_code').focus();
-          return false;
-        }
+                if (country_name.trim() === '') {
+                    $('#country_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.country.name')]) }}');
+                    $('#add_country_name').focus();
+                    return false;
+                }
 
-        if (country_name.trim() === '') {
-          $('#country_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.country.name')]) }}');
-          $('#add_country_name').focus();
-          return false;
+                $.ajax({
+                    url: '{{ route('admin.config.country.store') }}',
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        code: country_code,
+                        name: country_name
+                    },
+                    beforeSend: function() {
+                        $('#country_msg').show().html('{{ trans('admin.creating') }}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#country_msg').show().html(ret.message);
+                            return false;
+                        }
+                        $('#add_country_modal').modal('hide');
+                        window.location.reload();
+                    },
+                    error: function() {
+                        $('#country_msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {
+                        swal.fire({
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.reload());
+                    },
+                });
+            @endcan
+            @cannot('admin.config.country.store')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
         }
 
-        $.ajax({
-          url: '{{route('admin.config.country.store')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', code: country_code, name: country_name},
-          beforeSend: function() {
-            $('#country_msg').show().html('{{ trans('admin.creating') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#country_msg').show().html(ret.message);
-              return false;
-            }
-            $('#add_country_modal').modal('hide');
-            window.location.reload();
-          },
-          error: function() {
-            $('#country_msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-            swal.fire({
-              icon: 'success',
-              timer: 1000,
-              showConfirmButton: false,
-            }).then(() => window.location.reload());
-          },
-        });
-          @endcan
-          @cannot('admin.config.country.store')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function updateCountry(code) { // 更新国家/地区
+            @can('admin.config.country.update')
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.config.country.update', '') }}/' + code,
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: $('#country_' + code).val()
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            });
+                        }
+                    },
+                });
+            @endcan
+            @cannot('admin.config.country.update')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function updateCountry(code) { // 更新国家/地区
-          @can('admin.config.country.update')
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.country.update', '')}}/' + code,
-            data: {_token: '{{csrf_token()}}', name: $('#country_' + code).val()},
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
+        function delCountry(code, name) { // 删除国家/地区
+            @can('admin.config.country.destroy')
+                swal.fire({
+                    title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node.country')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'question',
+                    allowEnterKey: false,
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.config.country.destroy', '') }}/' + code,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            @endcan
+            @cannot('admin.config.country.destroy')
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'});
-              }
-            },
-          });
-          @endcan
-          @cannot('admin.config.country.update')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function delCountry(code, name) { // 删除国家/地区
-          @can('admin.config.country.destroy')
-          swal.fire({
-            title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node.country')]) }}' + name +
-                '{{ trans('admin.confirm.delete.1') }}',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.country.destroy', '')}}/' + code,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
-          @endcan
-          @cannot('admin.config.country.destroy')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function addConfig() { // 添加配置
+            @can('admin.config.ss.store')
+                const name = $('#name').val();
+                const type = $('#type').val();
 
-      function addConfig() { // 添加配置
-          @can('admin.config.ss.store')
-        const name = $('#name').val();
-        const type = $('#type').val();
+                if (name.trim() === '') {
+                    $('#msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
+                    $('#name').focus();
+                    return false;
+                }
 
-        if (name.trim() === '') {
-          $('#msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
-          $('#name').focus();
-          return false;
-        }
+                $.ajax({
+                    url: '{{ route('admin.config.ss.store') }}',
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: name,
+                        type: type
+                    },
+                    dataType: 'json',
+                    beforeSend: function() {
+                        $('#msg').show().html('{{ trans('admin.creating') }}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#msg').show().html(ret.message);
+                            return false;
+                        }
 
-        $.ajax({
-          url: '{{route('admin.config.ss.store')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', name: name, type: type},
-          dataType: 'json',
-          beforeSend: function() {
-            $('#msg').show().html('{{ trans('admin.creating') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#msg').show().html(ret.message);
-              return false;
-            }
+                        $('#add_config_modal').modal('hide');
+                    },
+                    error: function() {
+                        $('#msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {
+                        swal.fire({
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => window.location.reload());
+                    },
+                });
+            @endcan
+            @cannot('admin.config.ss.store')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-            $('#add_config_modal').modal('hide');
-          },
-          error: function() {
-            $('#msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-            swal.fire({icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
-          },
-        });
-          @endcan
-          @cannot('admin.config.ss.store')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function setDefault(id) { // 置为默认
+            @can('admin.config.ss.update')
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.config.ss.update', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}'
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                });
+            @endcan
+            @cannot('admin.config.ss.update')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function setDefault(id) { // 置为默认
-          @can('admin.config.ss.update')
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.ss.update', '')}}/' + id,
-            data: {_token: '{{csrf_token()}}'},
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
+        function delConfig(id, name) { // 删除配置
+            @can('admin.config.ss.destroy')
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
-          @endcan
-          @cannot('admin.config.ss.update')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+                    title: '{{ trans('admin.confirm.delete.0', ['attribute' => '']) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'question',
+                    allowEnterKey: false,
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.config.ss.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            @endcan
+            @cannot('admin.config.ss.destroy')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function delConfig(id, name) { // 删除配置
-          @can('admin.config.ss.destroy')
-          swal.fire({
-            title: '{{ trans('admin.confirm.delete.0', ['attribute' => '']) }}' + name +
-                '{{ trans('admin.confirm.delete.1') }}',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.ss.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
-            }
-          });
-          @endcan
-          @cannot('admin.config.ss.destroy')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+        function addLabel() { // 添加标签
+            @can('admin.config.label.store')
+                const name = $('#add_label').val();
+                const sort = $('#add_label_sort').val();
 
-      function addLabel() { // 添加标签
-          @can('admin.config.label.store')
-        const name = $('#add_label').val();
-        const sort = $('#add_label_sort').val();
+                if (name.trim() === '') {
+                    $('#lable_msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
+                    return false;
+                }
 
-        if (name.trim() === '') {
-          $('#lable_msg').show().html('{{ trans('validation.required', ['attribute' => trans('validation.attributes.name')]) }}');
-          return false;
-        }
+                if (sort.trim() === '') {
+                    $('#lable_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.common.sort')]) }}');
+                    return false;
+                }
 
-        if (sort.trim() === '') {
-          $('#lable_msg').show().html('{{ trans('validation.required', ['attribute' => trans('model.common.sort')]) }}');
-          return false;
+                $.ajax({
+                    url: '{{ route('admin.config.label.store') }}',
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: name,
+                        sort: sort
+                    },
+                    beforeSend: function() {
+                        $('#level_msg').show().html('{{ trans('admin.creating') }}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#lable_msg').show().html(ret.message);
+                            return false;
+                        }
+                        $('#add_label_modal').modal('hide');
+                        window.location.reload();
+                    },
+                    error: function() {
+                        $('#lable_msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {
+                        swal.fire({
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.reload());
+                    },
+                });
+            @endcan
+            @cannot('admin.config.label.store')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
         }
 
-        $.ajax({
-          url: '{{route('admin.config.label.store')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', name: name, sort: sort},
-          beforeSend: function() {
-            $('#level_msg').show().html('{{ trans('admin.creating') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#lable_msg').show().html(ret.message);
-              return false;
-            }
-            $('#add_label_modal').modal('hide');
-            window.location.reload();
-          },
-          error: function() {
-            $('#lable_msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-            swal.fire({
-              icon: 'success',
-              timer: 1000,
-              showConfirmButton: false,
-            }).then(() => window.location.reload());
-          },
-        });
-          @endcan
-          @cannot('admin.config.label.store')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
-
-      function updateLabel(id) { // 编辑标签
-          @can('admin.config.label.update')
-          $.ajax({
-            method: 'PUT',
-            url: '{{route('admin.config.label.update', '')}}/' + id,
-            data: {
-              _token: '{{csrf_token()}}',
-              name: $('#label_name_' + id).val(),
-              sort: $('#label_sort_' + id).val(),
-            },
-            dataType: 'json',
-            success: function(ret) {
-              if (ret.status === 'success') {
+        function updateLabel(id) { // 编辑标签
+            @can('admin.config.label.update')
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.config.label.update', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: $('#label_name_' + id).val(),
+                        sort: $('#label_sort_' + id).val(),
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                });
+            @endcan
+            @cannot('admin.config.label.update')
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            },
-          });
-          @endcan
-          @cannot('admin.config.label.update')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcannot
+        }
 
-      function delLabel(id, name) { // 删除标签
-          @can('admin.config.label.destroy')
-          swal.fire({
-            title: '{{ trans('common.warning') }}',
-            text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node.label')]) }}' + name +
-                '{{ trans('admin.confirm.delete.1') }}',
-            icon: 'warning',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            $.ajax({
-              method: 'DELETE',
-              url: '{{route('admin.config.label.destroy', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
+        function delLabel(id, name) { // 删除标签
+            @can('admin.config.label.destroy')
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node.label')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    $.ajax({
+                        method: 'DELETE',
+                        url: '{{ route('admin.config.label.destroy', '') }}/' + id,
+                        data: {
+                            _token: '{{ csrf_token() }}'
+                        },
+                        dataType: 'json',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                }).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                });
+            @endcan
+            @cannot('admin.config.label.destroy')
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
                     showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          });
-          @endcan
-          @cannot('admin.config.label.destroy')
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcannot
-      }
+                });
+            @endcannot
+        }
     </script>
 @endsection

+ 100 - 91
resources/views/admin/config/emailFilter.blade.php

@@ -10,8 +10,8 @@
                 </h2>
                 @can('admin.config.filter.store')
                     <div class="panel-actions">
-                        <button class="btn btn-primary" data-toggle="modal"
-                                data-target="#add_email_suffix"> {{ trans('admin.action.add_item', ['attribute' => trans('admin.setting.email.tail')]) }}
+                        <button class="btn btn-primary" data-toggle="modal" data-target="#add_email_suffix">
+                            {{ trans('admin.action.add_item', ['attribute' => trans('admin.setting.email.tail')]) }}
                         </button>
                     </div>
                 @endcan
@@ -19,28 +19,28 @@
             <div class="panel-body">
                 <table class="table text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('admin.setting.email.rule') }}</th>
-                        <th> {{ trans('admin.setting.email.tail') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($filters as $filter)
                         <tr>
-                            <td> {{$filter->id}} </td>
-                            <td> {{$filter->type === 1? trans('admin.setting.email.black') : trans('admin.setting.email.white')}} </td>
-                            <td> {{$filter->words}} </td>
-                            <td>
-                                @can('admin.config.filter.destroy')
-                                    <button class="btn btn-danger" onclick="delSuffix('{{$filter->id}}','{{$filter->words}}')">
-                                        <i class="icon wb-trash"></i>
-                                    </button>
-                                @endcan
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('admin.setting.email.rule') }}</th>
+                            <th> {{ trans('admin.setting.email.tail') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($filters as $filter)
+                            <tr>
+                                <td> {{ $filter->id }} </td>
+                                <td> {{ $filter->type === 1 ? trans('admin.setting.email.black') : trans('admin.setting.email.white') }} </td>
+                                <td> {{ $filter->words }} </td>
+                                <td>
+                                    @can('admin.config.filter.destroy')
+                                        <button class="btn btn-danger" onclick="delSuffix('{{ $filter->id }}','{{ $filter->words }}')">
+                                            <i class="icon wb-trash"></i>
+                                        </button>
+                                    @endcan
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -51,7 +51,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$filters->links()}}
+                            {{ $filters->links() }}
                         </nav>
                     </div>
                 </div>
@@ -60,11 +60,11 @@
     </div>
 
     @can('admin.config.filter.store')
-        <div id="add_email_suffix" class="modal fade" tabindex="-1" data-focus-on="input:first" data-keyboard="false">
+        <div class="modal fade" id="add_email_suffix" data-focus-on="input:first" data-keyboard="false" tabindex="-1">
             <div class="modal-dialog modal-simple modal-center modal-lg">
                 <div class="modal-content">
                     <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                        <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                             <span aria-hidden="true">×</span>
                         </button>
                         <h4 class="modal-title"> {{ trans('admin.action.add_item', ['attribute' => trans('admin.setting.email.tail')]) }} </h4>
@@ -74,11 +74,11 @@
                             <label class="col-form-label col-md-2" for="type">{{ trans('admin.setting.email.rule') }}</label>
                             <div class="col-md-10 d-flex align-items-center">
                                 <div class="radio-custom radio-primary radio-inline">
-                                    <input type="radio" name="type" value="1" checked/>
+                                    <input name="type" type="radio" value="1" checked />
                                     <label for="type">{{ trans('admin.setting.email.black') }}</label>
                                 </div>
                                 <div class="radio-custom radio-primary radio-inline">
-                                    <input type="radio" name="type" value="2"/>
+                                    <input name="type" type="radio" value="2" />
                                     <label for="type">{{ trans('admin.setting.email.white') }}</label>
                                 </div>
                             </div>
@@ -86,13 +86,14 @@
                         <div class="form-group row">
                             <label class="col-form-label col-md-2" for="words">{{ trans('admin.setting.email.tail') }}</label>
                             <div class="col-md-9">
-                                <input type="text" class="form-control" name="words" id="words" placeholder="{{ trans('admin.setting.email.tail_placeholder') }}"/>
+                                <input class="form-control" id="words" name="words" type="text"
+                                       placeholder="{{ trans('admin.setting.email.tail_placeholder') }}" />
                             </div>
                         </div>
                     </div>
                     <div class="modal-footer">
-                        <button data-dismiss="modal" class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
-                        <button data-dismiss="modal" class="btn btn-success" onclick="addEmailSuffix()">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
+                        <button class="btn btn-success" data-dismiss="modal" onclick="addEmailSuffix()">{{ trans('common.submit') }}</button>
                     </div>
                 </div>
             </div>
@@ -104,73 +105,81 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
         @can('admin.config.filter.store')
-        // 添加邮箱后缀
-        function addEmailSuffix() {
-          const words = $('#words').val();
-          if (words.trim() === '') {
-            swal.fire({
-              title: '{{ trans('validation.required', ['attribute' => trans('admin.setting.email.tail')]) }}',
-              icon: 'warning',
-              timer: 1000,
-              showConfirmButton: false,
-            });
-            $('#words').focus();
-            return false;
-          }
+            // 添加邮箱后缀
+            function addEmailSuffix() {
+                const words = $('#words').val();
+                if (words.trim() === '') {
+                    swal.fire({
+                        title: '{{ trans('validation.required', ['attribute' => trans('admin.setting.email.tail')]) }}',
+                        icon: 'warning',
+                        timer: 1000,
+                        showConfirmButton: false,
+                    });
+                    $('#words').focus();
+                    return false;
+                }
 
-          $.post('{{route('admin.config.filter.store')}}', {
-            _token: '{{csrf_token()}}',
-            type: $('input:radio[name=\'type\']:checked').val(),
-            words: words,
-          }, function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                $.post('{{ route('admin.config.filter.store') }}', {
+                    _token: '{{ csrf_token() }}',
+                    type: $('input:radio[name=\'type\']:checked').val(),
+                    words: words,
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.reload());
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        }).then(() => window.location.reload());
+                    }
+                });
             }
-          });
-        }
         @endcan
 
         @can('admin.config.filter.destroy')
-        // 删除邮箱后缀
-        function delSuffix(id, name) {
-          swal.fire({
-            title: '{{ trans('common.warning') }}',
-            text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('admin.setting.email.tail')]) }}' + name +
-                '{{ trans('admin.confirm.delete.1') }}',
-            icon: 'warning',
-            showCancelButton: true,
-            cancelButtonText: '{{ trans('common.cancel') }}',
-            confirmButtonText: '{{ trans('common.confirm') }}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.config.filter.destroy', '')}}/' + id,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
-                    swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-              });
+            // 删除邮箱后缀
+            function delSuffix(id, name) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('admin.setting.email.tail')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.cancel') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.config.filter.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
             }
-          });
-        }
         @endcan
     </script>
 @endsection

+ 545 - 362
resources/views/admin/config/system.blade.php

@@ -9,249 +9,393 @@
         <div class="panel">
             <div class="panel-heading">
                 <h1 class="panel-title">
-                    <i class="icon wb-settings" aria-hidden="true"></i>{{ trans('admin.setting.system.title') }}</h1>
+                    <i class="icon wb-settings" aria-hidden="true"></i>{{ trans('admin.setting.system.title') }}
+                </h1>
             </div>
             <div class="panel-body">
                 <div class="nav-tabs-horizontal" data-plugin="tabs">
                     <ul class="nav nav-tabs" role="tablist">
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link active" data-toggle="tab" href="#webSetting" aria-controls="webSetting" role="tab">{{ trans('admin.setting.system.web') }}</a>
+                            <a class="nav-link active" data-toggle="tab" href="#webSetting" role="tab"
+                               aria-controls="webSetting">{{ trans('admin.setting.system.web') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#account" aria-controls="account" role="tab">{{ trans('admin.setting.system.account') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#account" role="tab"
+                               aria-controls="account">{{ trans('admin.setting.system.account') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#node" aria-controls="node" role="tab">{{ trans('admin.setting.system.node') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#node" role="tab" aria-controls="node">{{ trans('admin.setting.system.node') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#extend" aria-controls="extend" role="tab">{{ trans('admin.setting.system.extend') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#extend" role="tab"
+                               aria-controls="extend">{{ trans('admin.setting.system.extend') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#checkIn" aria-controls="checkIn" role="tab">{{ trans('admin.setting.system.check_in') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#checkIn" role="tab"
+                               aria-controls="checkIn">{{ trans('admin.setting.system.check_in') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#promo" aria-controls="promo" role="tab">{{ trans('admin.setting.system.promotion') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#promo" role="tab"
+                               aria-controls="promo">{{ trans('admin.setting.system.promotion') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#notify" aria-controls="notify" role="tab">{{ trans('admin.setting.system.notify') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#notify" role="tab"
+                               aria-controls="notify">{{ trans('admin.setting.system.notify') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#auto" aria-controls="auto" role="tab">{{ trans('admin.setting.system.auto_job') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#auto" role="tab"
+                               aria-controls="auto">{{ trans('admin.setting.system.auto_job') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#other" aria-controls="other" role="tab">{{ trans('admin.setting.system.other') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#other" role="tab" aria-controls="other">{{ trans('admin.setting.system.other') }}</a>
                         </li>
                         <li class="nav-item" role="presentation">
-                            <a class="nav-link" data-toggle="tab" href="#payment" aria-controls="payment" role="tab">{{ trans('admin.setting.system.payment') }}</a>
+                            <a class="nav-link" data-toggle="tab" href="#payment" role="tab"
+                               aria-controls="payment">{{ trans('admin.setting.system.payment') }}</a>
                         </li>
                         <li class="dropdown nav-item" role="presentation">
-                            <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false">{{ trans('admin.setting.system.menu') }}</a>
+                            <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"
+                               aria-expanded="false">{{ trans('admin.setting.system.menu') }}</a>
                             <div class="dropdown-menu" role="menu">
-                                <a class="dropdown-item active" data-toggle="tab" href="#webSetting" aria-controls="webSetting"
-                                   role="tab">{{ trans('admin.setting.system.web') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#account" aria-controls="account" role="tab">{{ trans('admin.setting.system.account') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#node" aria-controls="node" role="tab">{{ trans('admin.setting.system.node') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#extend" aria-controls="extend" role="tab">{{ trans('admin.setting.system.extend') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#checkIn" aria-controls="checkIn" role="tab">{{ trans('admin.setting.system.check_in') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#promo" aria-controls="promo" role="tab">{{ trans('admin.setting.system.promotion') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#notify" aria-controls="notify" role="tab">{{ trans('admin.setting.system.notify') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#auto" aria-controls="auto" role="tab">{{ trans('admin.setting.system.auto_job') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#other" aria-controls="other" role="tab">{{ trans('admin.setting.system.other') }}</a>
-                                <a class="dropdown-item" data-toggle="tab" href="#payment" aria-controls="payment" role="tab">{{ trans('admin.setting.system.payment') }}</a>
+                                <a class="dropdown-item active" data-toggle="tab" href="#webSetting" role="tab"
+                                   aria-controls="webSetting">{{ trans('admin.setting.system.web') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#account" role="tab"
+                                   aria-controls="account">{{ trans('admin.setting.system.account') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#node" role="tab"
+                                   aria-controls="node">{{ trans('admin.setting.system.node') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#extend" role="tab"
+                                   aria-controls="extend">{{ trans('admin.setting.system.extend') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#checkIn" role="tab"
+                                   aria-controls="checkIn">{{ trans('admin.setting.system.check_in') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#promo" role="tab"
+                                   aria-controls="promo">{{ trans('admin.setting.system.promotion') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#notify" role="tab"
+                                   aria-controls="notify">{{ trans('admin.setting.system.notify') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#auto" role="tab"
+                                   aria-controls="auto">{{ trans('admin.setting.system.auto_job') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#other" role="tab"
+                                   aria-controls="other">{{ trans('admin.setting.system.other') }}</a>
+                                <a class="dropdown-item" data-toggle="tab" href="#payment" role="tab"
+                                   aria-controls="payment">{{ trans('admin.setting.system.payment') }}</a>
                             </div>
                         </li>
                     </ul>
                     <div class="tab-content py-35 px-35">
                         <x-system.tab-pane id="webSetting" :active="true">
-                            <x-system.input code="website_name" :value="$website_name"/>
-                            <x-system.input code="website_url" :value="$website_url" type="url"/>
-                            <x-system.select code="standard_currency" :list="array_column(config('common.currency'), 'code', 'name')"/>
-                            <x-system.input code="AppStore_id" :value="$AppStore_id" type="email"/>
-                            <x-system.input code="AppStore_password" :value="$AppStore_password" type="password"/>
-                            <x-system.input code="webmaster_email" :value="$webmaster_email" type="email"/>
+                            <x-system.input code="website_name" :value="$website_name" />
+                            <x-system.input type="url" code="website_url" :value="$website_url" />
+                            <x-system.select code="standard_currency" :list="array_column(config('common.currency'), 'code', 'name')" />
+                            <x-system.input type="email" code="AppStore_id" :value="$AppStore_id" />
+                            <x-system.input type="password" code="AppStore_password" :value="$AppStore_password" />
+                            <x-system.input type="email" code="webmaster_email" :value="$webmaster_email" />
                             <div class="form-group col-lg-6">
                                 <div class="form-row">
                                     <label class="col-md-3 col-form-label" for="website_security_code">{{ trans('admin.system.website_security_code') }}</label>
                                     <div class="col-md-6">
                                         <div class="input-group">
-                                            <input type="text" class="form-control" id="website_security_code" value="{{$website_security_code}}"/>
+                                            <input class="form-control" id="website_security_code" type="text" value="{{ $website_security_code }}" />
                                             <span class="input-group-append">
-                                                <button class="btn btn-info" type="button" onclick="makeWebsiteSecurityCode()">{{ trans('common.generate') }}</button>
-                                                <button class="btn btn-primary" type="button" onclick="update('website_security_code')">{{ trans('common.update') }}</button>
+                                                <button class="btn btn-info" type="button"
+                                                        onclick="makeWebsiteSecurityCode()">{{ trans('common.generate') }}</button>
+                                                <button class="btn btn-primary" type="button"
+                                                        onclick="update('website_security_code')">{{ trans('common.update') }}</button>
                                             </span>
                                         </div>
-                                        <span class="text-help">{!! trans('admin.system.hint.website_security_code', ['url' => route('login').'?securityCode=']) !!}</span>
+                                        <span class="text-help">{!! trans('admin.system.hint.website_security_code', ['url' => route('login') . '?securityCode=']) !!}</span>
                                     </div>
                                 </div>
                             </div>
-                            <x-system.select code="forbid_mode"
-                                             :list="[trans('common.status.closed') => '', trans('admin.system.forbid.mainland')=> 'ban_mainland', trans('admin.system.forbid.china') => 'ban_china', trans('admin.system.forbid.oversea') => 'ban_oversea']"/>
-                            <x-system.switch code="is_forbid_robot" :check="$is_forbid_robot"/>
-                            <x-system.switch code="maintenance_mode" :check="$maintenance_mode" :url="route('admin.login')"/>
-                            <x-system.input code="maintenance_time" :value="$maintenance_time" type="datetime-local"/>
-                            <x-system.textarea code="maintenance_content" :value="$maintenance_content" row="3"/>
-                            <x-system.input code="redirect_url" :value="$redirect_url" type="url"/>
+                            <x-system.select code="forbid_mode" :list="[
+                                trans('common.status.closed') => '',
+                                trans('admin.system.forbid.mainland') => 'ban_mainland',
+                                trans('admin.system.forbid.china') => 'ban_china',
+                                trans('admin.system.forbid.oversea') => 'ban_oversea',
+                            ]" />
+                            <x-system.switch code="is_forbid_robot" :check="$is_forbid_robot" />
+                            <x-system.switch code="maintenance_mode" :check="$maintenance_mode" :url="route('admin.login')" />
+                            <x-system.input type="datetime-local" code="maintenance_time" :value="$maintenance_time" />
+                            <x-system.textarea code="maintenance_content" :value="$maintenance_content" row="3" />
+                            <x-system.input type="url" code="redirect_url" :value="$redirect_url" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="account">
-                            <x-system.switch code="is_register" :check="$is_register"/>
-                            <x-system.select code="oauth_path" multiple="1" :list="array_flip(config('common.oauth.labels'))"/>
-                            <x-system.select code="username_type" :list="[trans('admin.system.username.email') => 'email', trans('admin.system.username.mobile') => 'numeric',
-                            trans('admin.system.username.any') => 'string']"/>
-                            <x-system.select code="is_invite_register" :list="[trans('common.status.closed') => '', trans('admin.optional') => 1, trans('admin.require') => 2]"/>
-                            <x-system.select code="is_activate_account"
-                                             :list="[trans('common.status.closed') => '', trans('admin.system.active_account.before') => 1, trans('admin.system.active_account.after') => 2]"/>
-                            <x-system.select code="password_reset_notification" :list="[trans('common.status.closed') => '', trans('admin.system.notification.channel.email') =>
-                            'mail']"/>
-                            <x-system.switch code="is_free_code" :check="$is_free_code"/>
-                            <x-system.input code="aff_salt" :value="$aff_salt"/>
-                            <x-system.switch code="is_rand_port" :check="$is_rand_port"/>
-                            <x-system.input-limit code="min_port" hcode="max_port" :value="$min_port" min="1000" max="$('#max_port').val()" :hvalue="$max_port" hmin="$
-                            ('#min_port').val()" hmax="65535"/>
-                            <x-system.input-limit code="default_days" :value="$default_days" unit="{{ trans_choice('common.days.attribute', 1) }}"/>
-                            <x-system.input-limit code="default_traffic" :value="$default_traffic" unit="MB"/>
-                            <x-system.input-limit code="invite_num" :value="$invite_num"/>
-                            <x-system.input-limit code="reset_password_times" :value="$reset_password_times"/>
-                            <x-system.select code="is_email_filtering"
-                                             :list="[trans('common.status.closed') => '', trans('admin.setting.email.black') => 1, trans('admin.setting.email.white') => 2]"/>
-                            <x-system.input-limit code="active_times" :value="$active_times"/>
-                            <x-system.input-limit code="register_ip_limit" :value="$register_ip_limit"/>
-                            <x-system.input-limit code="user_invite_days" :value="$user_invite_days" min="1" unit="{{ trans_choice('common.days.attribute', 1) }}"/>
-                            <x-system.input-limit code="admin_invite_days" :value="$admin_invite_days" min="1" unit="{{ trans_choice('common.days.attribute', 1) }}"/>
+                            <x-system.switch code="is_register" :check="$is_register" />
+                            <x-system.select code="oauth_path" multiple="1" :list="array_flip(config('common.oauth.labels'))" />
+                            <x-system.select code="username_type" :list="[
+                                trans('admin.system.username.email') => 'email',
+                                trans('admin.system.username.mobile') => 'numeric',
+                                trans('admin.system.username.any') => 'string',
+                            ]" />
+                            <x-system.select code="is_invite_register" :list="[trans('common.status.closed') => '', trans('admin.optional') => 1, trans('admin.require') => 2]" />
+                            <x-system.select code="is_activate_account" :list="[
+                                trans('common.status.closed') => '',
+                                trans('admin.system.active_account.before') => 1,
+                                trans('admin.system.active_account.after') => 2,
+                            ]" />
+                            <x-system.select code="password_reset_notification" :list="[trans('common.status.closed') => '', trans('admin.system.notification.channel.email') => 'mail']" />
+                            <x-system.switch code="is_free_code" :check="$is_free_code" />
+                            <x-system.input code="aff_salt" :value="$aff_salt" />
+                            <x-system.switch code="is_rand_port" :check="$is_rand_port" />
+                            <x-system.input-limit code="min_port" hcode="max_port" :value="$min_port" min="1000" max="$('#max_port').val()"
+                                                  :hvalue="$max_port" hmin="$
+                            ('#min_port').val()" hmax="65535" />
+                            <x-system.input-limit code="default_days" :value="$default_days" unit="{{ trans_choice('common.days.attribute', 1) }}" />
+                            <x-system.input-limit code="default_traffic" :value="$default_traffic" unit="MB" />
+                            <x-system.input-limit code="invite_num" :value="$invite_num" />
+                            <x-system.input-limit code="reset_password_times" :value="$reset_password_times" />
+                            <x-system.select code="is_email_filtering" :list="[trans('common.status.closed') => '', trans('admin.setting.email.black') => 1, trans('admin.setting.email.white') => 2]" />
+                            <x-system.input-limit code="active_times" :value="$active_times" />
+                            <x-system.input-limit code="register_ip_limit" :value="$register_ip_limit" />
+                            <x-system.input-limit code="user_invite_days" :value="$user_invite_days" min="1"
+                                                  unit="{{ trans_choice('common.days.attribute', 1) }}" />
+                            <x-system.input-limit code="admin_invite_days" :value="$admin_invite_days" min="1"
+                                                  unit="{{ trans_choice('common.days.attribute', 1) }}" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="node">
-                            <x-system.input code="subscribe_domain" :value="$subscribe_domain" :holder="trans('admin.system.placeholder.default_url', ['url' => $website_url])"
-                                            type="url"/>
-                            <x-system.input-limit code="subscribe_max" :value="$subscribe_max"/>
-                            <x-system.switch code="rand_subscribe" :check="$rand_subscribe"/>
-                            <x-system.switch code="is_custom_subscribe" :check="$is_custom_subscribe"/>
-                            <x-system.input code="web_api_url" :value="$web_api_url" type="url"/>
-                            <x-system.input code="v2ray_license" :value="$v2ray_license"/>
-                            <x-system.input code="trojan_license" :value="$trojan_license"/>
-                            <x-system.input code="v2ray_tls_provider" :value="$v2ray_tls_provider"/>
+                            <x-system.input type="url" code="subscribe_domain" :value="$subscribe_domain" :holder="trans('admin.system.placeholder.default_url', ['url' => $website_url])" />
+                            <x-system.input-limit code="subscribe_max" :value="$subscribe_max" />
+                            <x-system.switch code="rand_subscribe" :check="$rand_subscribe" />
+                            <x-system.switch code="is_custom_subscribe" :check="$is_custom_subscribe" />
+                            <x-system.input type="url" code="web_api_url" :value="$web_api_url" />
+                            <x-system.input code="v2ray_license" :value="$v2ray_license" />
+                            <x-system.input code="trojan_license" :value="$trojan_license" />
+                            <x-system.input code="v2ray_tls_provider" :value="$v2ray_tls_provider" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="extend">
-                            <x-system.select code="ddns_mode" :list="$ddns_labels"/>
-                            <x-system.input code="ddns_key" :value="$ddns_key"/>
-                            <x-system.input code="ddns_secret" :value="$ddns_secret"/>
+                            <x-system.select code="ddns_mode" :list="$ddns_labels" />
+                            <x-system.input code="ddns_key" :value="$ddns_key" />
+                            <x-system.input code="ddns_secret" :value="$ddns_secret" />
                             <hr class="col-lg-12">
-                            <x-system.select code="is_captcha" :list="[trans('common.status.closed') => '', trans('admin.system.captcha.standard') => 1, trans('admin.system.captcha.geetest') => 2, trans('admin.system.captcha.recaptcha') => 3, trans('admin.system.captcha.hcaptcha') => 4, trans('admin.system.captcha.turnstile') => 5]"/>
-                            <x-system.input code="captcha_key" :value="$captcha_key"/>
-                            <x-system.input code="captcha_secret" :value="$captcha_secret"/>
+                            <x-system.select code="is_captcha" :list="[
+                                trans('common.status.closed') => '',
+                                trans('admin.system.captcha.standard') => 1,
+                                trans('admin.system.captcha.geetest') => 2,
+                                trans('admin.system.captcha.recaptcha') => 3,
+                                trans('admin.system.captcha.hcaptcha') => 4,
+                                trans('admin.system.captcha.turnstile') => 5,
+                            ]" />
+                            <x-system.input code="captcha_key" :value="$captcha_key" />
+                            <x-system.input code="captcha_secret" :value="$captcha_secret" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="checkIn">
-                            <x-system.switch code="is_checkin" :check="$is_checkin"/>
-                            <x-system.input-limit code="traffic_limit_time" :value="$traffic_limit_time"/>
+                            <x-system.switch code="is_checkin" :check="$is_checkin" />
+                            <x-system.input-limit code="traffic_limit_time" :value="$traffic_limit_time" />
                             <x-system.input-limit code="min_rand_traffic" hcode="max_rand_traffic" :value="$min_rand_traffic" :hvalue="$max_rand_traffic" :max="$max_rand_traffic"
-                                                  :hmin="$min_rand_traffic" unit="MB"/>
+                                                  :hmin="$min_rand_traffic" unit="MB" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="promo">
-                            <x-system.switch code="referral_status" :check="$referral_status"/>
-                            <x-system.select code="referral_type"
-                                             :list="[trans('common.status.closed') => '', trans('admin.system.referral.once') => 1, trans('admin.system.referral.loop') => 2]"/>
-                            <x-system.input-limit code="referral_traffic" :value="$referral_traffic" unit="MB"/>
-                            <x-system.input-limit code="referral_percent" :value="$referral_percent * 100" max="100" unit="%"/>
+                            <x-system.switch code="referral_status" :check="$referral_status" />
+                            <x-system.select code="referral_type" :list="[
+                                trans('common.status.closed') => '',
+                                trans('admin.system.referral.once') => 1,
+                                trans('admin.system.referral.loop') => 2,
+                            ]" />
+                            <x-system.input-limit code="referral_traffic" :value="$referral_traffic" unit="MB" />
+                            <x-system.input-limit code="referral_percent" :value="$referral_percent * 100" max="100" unit="%" />
                             <x-system.input-limit code="referral_money" :value="$referral_money"
-                                                  unit="{{array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')]}}"/>
+                                                  unit="{{ array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')] }}" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="notify">
                             <x-system.input-test code="server_chan_key" :value="$server_chan_key" holder="{{ trans('admin.system.placeholder.server_chan_key') }}"
-                                                 test="serverChan"/>
-                            <x-system.input-test code="pushDeer_key" :value="$pushDeer_key" holder="{{ trans('admin.system.placeholder.pushDeer_key') }}" test="pushDeer"/>
-                            <x-system.input-test code="iYuu_token" :value="$iYuu_token" holder="{{ trans('admin.system.placeholder.iYuu_token') }}" test="iYuu"/>
-                            <x-system.input-test code="bark_key" :value="$bark_key" holder="{{ trans('admin.system.placeholder.bark_key') }}" test="bark"/>
-                            <x-system.input-test code="telegram_token" :value="$telegram_token" holder="{{ trans('admin.system.placeholder.telegram_token') }}" test="telegram"/>
-                            <x-system.input-test code="pushplus_token" :value="$pushplus_token" holder="{{ trans('admin.system.placeholder.pushplus_token') }}" test="pushPlus"/>
-                            <x-system.input code="dingTalk_access_token" :value="$dingTalk_access_token" holder="{{ trans('admin.system.placeholder.dingTalk_access_token') }}"/>
-                            <x-system.input-test code="dingTalk_secret" :value="$dingTalk_secret" holder="{{ trans('admin.system.placeholder.dingTalk_secret') }}" test="dingTalk"/>
-                            <x-system.input code="wechat_cid" :value="$wechat_cid" holder="{{ trans('admin.system.placeholder.wechat_cid') }}"/>
-                            <x-system.input code="wechat_aid" :value="$wechat_aid" holder="{{ trans('admin.system.placeholder.wechat_aid') }}"/>
-                            <x-system.input-test code="wechat_secret" :value="$wechat_secret" holder="{{ trans('admin.system.placeholder.wechat_secret') }}" test="weChat"/>
-                            <x-system.input code="wechat_token" :value="$wechat_token" :url="route('wechat.verify')"/>
-                            <x-system.input code="wechat_encodingAESKey" :value="$wechat_encodingAESKey"/>
-                            <x-system.input-test code="tg_chat_token" :value="$tg_chat_token" holder="{{ trans('admin.system.placeholder.tg_chat_token') }}" test="tgChat"/>
-                            <hr class="col-10"/>
-                            <x-system.select code="account_expire_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.site') => 'database']"/>
-                            <x-system.input-limit code="expire_days" :value="$expire_days" unit="{{ trans_choice('common.days.attribute', 1) }}"/>
-                            <x-system.select code="data_exhaust_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.site') => 'database']"/>
-                            <x-system.input-limit code="traffic_warning_percent" :value="$traffic_warning_percent" unit="%"/>
-                            <x-system.select code="node_offline_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.bark') => 'bark', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
-                            <x-system.input-limit code="offline_check_times" :value="$offline_check_times" unit="{{ trans('admin.times') }}"/>
-                            <x-system.select code="node_blocked_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
-                            <x-system.input-limit code="detection_check_times" :value="$detection_check_times" max="12" unit="{{ trans('admin.times') }}"/>
-                            <x-system.select code="payment_received_notification" multiple="1" :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin
-                            .system.notification.channel.site') => 'database', trans('admin.system.notification.channel.telegram') => 'telegram']"/>
-                            <x-system.select code="payment_confirm_notification"
-                                             :list="[trans('common.status.closed') => '', trans('admin.system.notification.channel.telegram')=> 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat']"/>
-                            <x-system.select code="ticket_closed_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.bark') => 'bark', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
-                            <x-system.select code="ticket_created_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.bark') => 'bark', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
-                            <x-system.select code="ticket_replied_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.bark') => 'bark', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
+                                                 test="serverChan" />
+                            <x-system.input-test code="pushDeer_key" :value="$pushDeer_key" holder="{{ trans('admin.system.placeholder.pushDeer_key') }}"
+                                                 test="pushDeer" />
+                            <x-system.input-test code="iYuu_token" :value="$iYuu_token" holder="{{ trans('admin.system.placeholder.iYuu_token') }}"
+                                                 test="iYuu" />
+                            <x-system.input-test code="bark_key" :value="$bark_key" holder="{{ trans('admin.system.placeholder.bark_key') }}" test="bark" />
+                            <x-system.input-test code="telegram_token" :value="$telegram_token" holder="{{ trans('admin.system.placeholder.telegram_token') }}"
+                                                 test="telegram" />
+                            <x-system.input-test code="pushplus_token" :value="$pushplus_token" holder="{{ trans('admin.system.placeholder.pushplus_token') }}"
+                                                 test="pushPlus" />
+                            <x-system.input code="dingTalk_access_token" :value="$dingTalk_access_token"
+                                            holder="{{ trans('admin.system.placeholder.dingTalk_access_token') }}" />
+                            <x-system.input-test code="dingTalk_secret" :value="$dingTalk_secret" holder="{{ trans('admin.system.placeholder.dingTalk_secret') }}"
+                                                 test="dingTalk" />
+                            <x-system.input code="wechat_cid" :value="$wechat_cid" holder="{{ trans('admin.system.placeholder.wechat_cid') }}" />
+                            <x-system.input code="wechat_aid" :value="$wechat_aid" holder="{{ trans('admin.system.placeholder.wechat_aid') }}" />
+                            <x-system.input-test code="wechat_secret" :value="$wechat_secret" holder="{{ trans('admin.system.placeholder.wechat_secret') }}"
+                                                 test="weChat" />
+                            <x-system.input code="wechat_token" :value="$wechat_token" :url="route('wechat.verify')" />
+                            <x-system.input code="wechat_encodingAESKey" :value="$wechat_encodingAESKey" />
+                            <x-system.input-test code="tg_chat_token" :value="$tg_chat_token" holder="{{ trans('admin.system.placeholder.tg_chat_token') }}"
+                                                 test="tgChat" />
+                            <hr class="col-10" />
+                            <x-system.select code="account_expire_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.site') => 'database',
+                            ]" />
+                            <x-system.input-limit code="expire_days" :value="$expire_days" unit="{{ trans_choice('common.days.attribute', 1) }}" />
+                            <x-system.select code="data_exhaust_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.site') => 'database',
+                            ]" />
+                            <x-system.input-limit code="traffic_warning_percent" :value="$traffic_warning_percent" unit="%" />
+                            <x-system.select code="node_offline_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.bark') => 'bark',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
+                            <x-system.input-limit code="offline_check_times" :value="$offline_check_times" unit="{{ trans('admin.times') }}" />
+                            <x-system.select code="node_blocked_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
+                            <x-system.input-limit code="detection_check_times" :value="$detection_check_times" max="12" unit="{{ trans('admin.times') }}" />
+                            <x-system.select code="payment_received_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.site') => 'database',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                            ]" />
+                            <x-system.select code="payment_confirm_notification" :list="[
+                                trans('common.status.closed') => '',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                            ]" />
+                            <x-system.select code="ticket_closed_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.bark') => 'bark',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
+                            <x-system.select code="ticket_created_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.bark') => 'bark',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
+                            <x-system.select code="ticket_replied_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.bark') => 'bark',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="auto">
-                            <x-system.switch code="is_clear_log" :check="$is_clear_log"/>
-                            <x-system.switch code="reset_traffic" :check="$reset_traffic"/>
-                            <x-system.switch code="is_subscribe_ban" :check="$is_subscribe_ban"/>
-                            <x-system.input-limit code="subscribe_ban_times" :value="$subscribe_ban_times"/>
-                            <x-system.switch code="is_traffic_ban" :check="$is_traffic_ban"/>
-                            <x-system.select code="data_anomaly_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.bark') => 'bark', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
-                            <x-system.input-limit code="traffic_ban_value" :value="$traffic_ban_value" min="1" unit="GB"/>
-                            <x-system.input-limit code="traffic_ban_time" :value="$traffic_ban_time" unit="{{ trans('admin.minute') }}"/>
-                            <x-system.switch code="auto_release_port" :check="$auto_release_port"/>
-                            <x-system.switch code="is_ban_status" :check="$is_ban_status"/>
-                            <x-system.select code="node_daily_notification" multiple="1"
-                                             :list="[trans('admin.system.notification.channel.email') => 'mail', trans('admin.system.notification.channel.serverchan') => 'serverChan', trans('admin.system.notification.channel.pushdeer') => 'pushDear', trans('admin.system.notification.channel.iyuu') => 'iYuu', trans('admin.system.notification.channel.telegram') => 'telegram', trans('admin.system.notification.channel.dingtalk') => 'dingTalk', trans('admin.system.notification.channel.wechat') => 'weChat', trans('admin.system.notification.channel.tg_chat') => 'tgChat', trans('admin.system.notification.channel.pushplus') => 'pushPlus']"/>
+                            <x-system.switch code="is_clear_log" :check="$is_clear_log" />
+                            <x-system.switch code="reset_traffic" :check="$reset_traffic" />
+                            <x-system.switch code="is_subscribe_ban" :check="$is_subscribe_ban" />
+                            <x-system.input-limit code="subscribe_ban_times" :value="$subscribe_ban_times" />
+                            <x-system.switch code="is_traffic_ban" :check="$is_traffic_ban" />
+                            <x-system.select code="data_anomaly_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.bark') => 'bark',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
+                            <x-system.input-limit code="traffic_ban_value" :value="$traffic_ban_value" min="1" unit="GB" />
+                            <x-system.input-limit code="traffic_ban_time" :value="$traffic_ban_time" unit="{{ trans('admin.minute') }}" />
+                            <x-system.switch code="auto_release_port" :check="$auto_release_port" />
+                            <x-system.switch code="is_ban_status" :check="$is_ban_status" />
+                            <x-system.select code="node_daily_notification" multiple="1" :list="[
+                                trans('admin.system.notification.channel.email') => 'mail',
+                                trans('admin.system.notification.channel.serverchan') => 'serverChan',
+                                trans('admin.system.notification.channel.pushdeer') => 'pushDear',
+                                trans('admin.system.notification.channel.iyuu') => 'iYuu',
+                                trans('admin.system.notification.channel.telegram') => 'telegram',
+                                trans('admin.system.notification.channel.dingtalk') => 'dingTalk',
+                                trans('admin.system.notification.channel.wechat') => 'weChat',
+                                trans('admin.system.notification.channel.tg_chat') => 'tgChat',
+                                trans('admin.system.notification.channel.pushplus') => 'pushPlus',
+                            ]" />
                         </x-system.tab-pane>
                         <x-system.tab-pane id="other">
                             <div class="col-12">
-                                @if($errors->any())
-                                    <x-alert type="danger" :message="$errors->all()"/>
+                                @if ($errors->any())
+                                    <x-alert type="danger" :message="$errors->all()" />
                                 @endif
                                 @if (Session::has('successMsg'))
-                                    <x-alert type="success" :message="Session::pull('successMsg')"/>
+                                    <x-alert type="success" :message="Session::pull('successMsg')" />
                                 @endif
                             </div>
-                            <x-system.input code="website_home_logo" :value="$website_home_logo" type="url"/>
-                            <x-system.input code="website_logo" :value="$website_logo" type="url"/>
-                            <form action="{{route('admin.system.extend')}}" method="post" enctype="multipart/form-data" class="upload-form col-lg-12 row" role="form"
-                                  id="setExtend">@csrf
-                                <x-system.input-file code="website_home_logo" :value="$website_home_logo"/>
-                                <x-system.input-file code="website_logo" :value="$website_logo"/>
+                            <x-system.input type="url" code="website_home_logo" :value="$website_home_logo" />
+                            <x-system.input type="url" code="website_logo" :value="$website_logo" />
+                            <form class="upload-form col-lg-12 row" role="form" action="{{ route('admin.system.extend') }}" method="post"
+                                  enctype="multipart/form-data">@csrf
+                                <x-system.input-file code="website_home_logo" :value="$website_home_logo" />
+                                <x-system.input-file code="website_logo" :value="$website_logo" />
                             </form>
-                            <x-system.textarea code="website_analytics" :value="$website_analytics"/>
-                            <x-system.textarea code="website_customer_service" :value="$website_customer_service"/>
+                            <x-system.textarea code="website_analytics" :value="$website_analytics" />
+                            <x-system.textarea code="website_customer_service" :value="$website_customer_service" />
                         </x-system.tab-pane>
                         <div class="tab-pane" id="payment" role="tabpanel">
                             <div class="tab-content pb-100">
                                 <x-system.tab-pane id="paymentSetting" :active="true">
-                                    <x-system.select code="is_AliPay" :list="[trans('common.status.closed') => '', trans('admin.system.payment.channel.alipay') => 'f2fpay',
-                                    trans('admin.system.payment.channel.codepay') => 'codepay', trans('admin.system.payment.channel.epay') => 'epay', trans('admin.system.payment.channel.paybeaver') => 'paybeaver', trans('admin.system.payment.channel.theadpay') => 'theadpay', trans('admin.system.payment.channel.stripe') => 'stripe']"/>
-                                    <x-system.select code="is_QQPay" :list="[trans('common.status.closed') => '', trans('admin.system.payment.channel.codepay') => 'codepay',
-                                    trans('admin.system.payment.channel.epay') => 'epay']"/>
-                                    <x-system.select code="is_WeChatPay" :list="[trans('common.status.closed') => '', trans('admin.system.payment.channel.codepay') => 'codepay',
-                                     trans('admin.system.payment.channel.payjs') => 'payjs', trans('admin.system.payment.channel.epay') => 'epay', trans('admin.system.payment.channel.paybeaver') => 'paybeaver', trans('admin.system.payment.channel.stripe') => 'stripe']"/>
-                                    <x-system.select code="is_otherPay" multiple="1"
-                                                     :list="[trans('admin.system.payment.channel.paypal') => 'paypal', trans('admin.system.payment.channel.stripe') => 'stripe']"/>
-                                    <x-system.input code="subject_name" :value="$subject_name"/>
-                                    <x-system.input code="website_callback_url" :value="$website_callback_url" :holder="trans('admin.system.placeholder.default_url', ['url' =>
-                                    $website_url])" type="url"/>
+                                    <x-system.select code="is_AliPay" :list="[
+                                        trans('common.status.closed') => '',
+                                        trans('admin.system.payment.channel.alipay') => 'f2fpay',
+                                        trans('admin.system.payment.channel.codepay') => 'codepay',
+                                        trans('admin.system.payment.channel.epay') => 'epay',
+                                        trans('admin.system.payment.channel.paybeaver') => 'paybeaver',
+                                        trans('admin.system.payment.channel.theadpay') => 'theadpay',
+                                        trans('admin.system.payment.channel.stripe') => 'stripe',
+                                    ]" />
+                                    <x-system.select code="is_QQPay" :list="[
+                                        trans('common.status.closed') => '',
+                                        trans('admin.system.payment.channel.codepay') => 'codepay',
+                                        trans('admin.system.payment.channel.epay') => 'epay',
+                                    ]" />
+                                    <x-system.select code="is_WeChatPay" :list="[
+                                        trans('common.status.closed') => '',
+                                        trans('admin.system.payment.channel.codepay') => 'codepay',
+                                        trans('admin.system.payment.channel.payjs') => 'payjs',
+                                        trans('admin.system.payment.channel.epay') => 'epay',
+                                        trans('admin.system.payment.channel.paybeaver') => 'paybeaver',
+                                        trans('admin.system.payment.channel.stripe') => 'stripe',
+                                    ]" />
+                                    <x-system.select code="is_otherPay" multiple="1" :list="[
+                                        trans('admin.system.payment.channel.paypal') => 'paypal',
+                                        trans('admin.system.payment.channel.stripe') => 'stripe',
+                                    ]" />
+                                    <x-system.input code="subject_name" :value="$subject_name" />
+                                    <x-system.input type="url" code="website_callback_url" :value="$website_callback_url" :holder="trans('admin.system.placeholder.default_url', ['url' => $website_url])" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="AlipayF2F">
                                     <div class="form-group col-lg-6 d-flex">
-                                        <label class="col-md-3 col-form-label">{{  trans('admin.system.payment.channel.alipay') }}</label>
+                                        <label class="col-md-3 col-form-label">{{ trans('admin.system.payment.channel.alipay') }}</label>
                                         <div class="col-md-9">
                                             {!! trans('admin.system.payment.hint.alipay') !!}
                                         </div>
                                     </div>
-                                    <x-system.input code="f2fpay_app_id" :value="$f2fpay_app_id"/>
-                                    <x-system.input code="f2fpay_private_key" :value="$f2fpay_private_key"/>
-                                    <x-system.input code="f2fpay_public_key" :value="$f2fpay_public_key"/>
+                                    <x-system.input code="f2fpay_app_id" :value="$f2fpay_app_id" />
+                                    <x-system.input code="f2fpay_private_key" :value="$f2fpay_private_key" />
+                                    <x-system.input code="f2fpay_public_key" :value="$f2fpay_public_key" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="CodePay">
                                     <div class="form-group col-lg-6 d-flex">
@@ -260,9 +404,9 @@
                                             {!! trans('admin.system.payment.hint.codepay') !!}
                                         </div>
                                     </div>
-                                    <x-system.input code="codepay_url" :value="$codepay_url" :holder="trans('admin.system.placeholder.codepay_url')" type="url"/>
-                                    <x-system.input code="codepay_id" :value="$codepay_id"/>
-                                    <x-system.input code="codepay_key" :value="$codepay_key"/>
+                                    <x-system.input type="url" code="codepay_url" :value="$codepay_url" :holder="trans('admin.system.placeholder.codepay_url')" />
+                                    <x-system.input code="codepay_id" :value="$codepay_id" />
+                                    <x-system.input code="codepay_key" :value="$codepay_key" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="EPay">
                                     <div class="form-group col-lg-6 d-flex">
@@ -273,9 +417,9 @@
                                             </div>
                                         @endcan
                                     </div>
-                                    <x-system.input code="epay_url" :value="$epay_url" type="url"/>
-                                    <x-system.input code="epay_mch_id" :value="$epay_mch_id"/>
-                                    <x-system.input code="epay_key" :value="$epay_key"/>
+                                    <x-system.input type="url" code="epay_url" :value="$epay_url" />
+                                    <x-system.input code="epay_mch_id" :value="$epay_mch_id" />
+                                    <x-system.input code="epay_key" :value="$epay_key" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="PayJs">
                                     <div class="form-group col-lg-6 d-flex">
@@ -284,8 +428,8 @@
                                             {!! trans('admin.system.payment.hint.payjs') !!}
                                         </div>
                                     </div>
-                                    <x-system.input code="payjs_mch_id" :value="$payjs_mch_id"/>
-                                    <x-system.input code="payjs_key" :value="$payjs_key"/>
+                                    <x-system.input code="payjs_mch_id" :value="$payjs_mch_id" />
+                                    <x-system.input code="payjs_key" :value="$payjs_key" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="PayPal">
                                     <div class="form-group col-lg-6 d-flex">
@@ -294,17 +438,17 @@
                                             {!! trans('admin.system.payment.hint.paypal') !!}
                                         </div>
                                     </div>
-                                    <x-system.input code="paypal_client_id" :value="$paypal_client_id"/>
-                                    <x-system.input code="paypal_client_secret" :value="$paypal_client_secret"/>
-                                    <x-system.input code="paypal_app_id" :value="$paypal_app_id"/>
+                                    <x-system.input code="paypal_client_id" :value="$paypal_client_id" />
+                                    <x-system.input code="paypal_client_secret" :value="$paypal_client_secret" />
+                                    <x-system.input code="paypal_app_id" :value="$paypal_app_id" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="Stripe">
                                     <div class="form-group col-lg-6 d-flex">
                                         <label class="col-md-3 col-form-label">{{ trans('admin.system.payment.channel.stripe') }}</label>
                                     </div>
-                                    <x-system.input code="stripe_public_key" :value="$stripe_public_key"/>
-                                    <x-system.input code="stripe_secret_key" :value="$stripe_secret_key"/>
-                                    <x-system.input code="stripe_signing_secret" :value="$stripe_signing_secret"/>
+                                    <x-system.input code="stripe_public_key" :value="$stripe_public_key" />
+                                    <x-system.input code="stripe_secret_key" :value="$stripe_secret_key" />
+                                    <x-system.input code="stripe_signing_secret" :value="$stripe_signing_secret" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="PayBeaver">
                                     <div class="form-group col-lg-6 d-flex">
@@ -313,8 +457,8 @@
                                             {!! trans('admin.system.payment.hint.paybeaver') !!}
                                         </div>
                                     </div>
-                                    <x-system.input code="paybeaver_app_id" :value="$paybeaver_app_id"/>
-                                    <x-system.input code="paybeaver_app_secret" :value="$paybeaver_app_secret"/>
+                                    <x-system.input code="paybeaver_app_id" :value="$paybeaver_app_id" />
+                                    <x-system.input code="paybeaver_app_secret" :value="$paybeaver_app_secret" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="THeadPay">
                                     <div class="form-group col-lg-6 d-flex">
@@ -323,9 +467,9 @@
                                             {!! trans('admin.system.payment.hint.theadpay') !!}
                                         </div>
                                     </div>
-                                    <x-system.input code="theadpay_url" :value="$theadpay_url" type="url"/>
-                                    <x-system.input code="theadpay_mchid" :value="$theadpay_mchid"/>
-                                    <x-system.input code="theadpay_key" :value="$theadpay_key"/>
+                                    <x-system.input type="url" code="theadpay_url" :value="$theadpay_url" />
+                                    <x-system.input code="theadpay_mchid" :value="$theadpay_mchid" />
+                                    <x-system.input code="theadpay_key" :value="$theadpay_key" />
                                 </x-system.tab-pane>
                                 <x-system.tab-pane id="Manual">
                                     <div class="form-group col-lg-12 d-flex">
@@ -335,80 +479,87 @@
                                         </div>
                                     </div>
                                     <div class="col-12">
-                                        @if($errors->any())
-                                            <x-alert type="danger" :message="$errors->all()"/>
+                                        @if ($errors->any())
+                                            <x-alert type="danger" :message="$errors->all()" />
                                         @endif
                                         @if (Session::has('successMsg'))
-                                            <x-alert type="success" :message="Session::pull('successMsg')"/>
+                                            <x-alert type="success" :message="Session::pull('successMsg')" />
                                         @endif
                                     </div>
-                                    <x-system.input code="alipay_qrcode" :value="$alipay_qrcode" type="url"/>
-                                    <x-system.input code="wechat_qrcode" :value="$wechat_qrcode" type="url"/>
-                                    <form action="{{route('admin.system.extend')}}" method="post" enctype="multipart/form-data" class="upload-form col-lg-12 row" role="form"
-                                          id="setExtend">@csrf
-                                        <x-system.input-file code="alipay_qrcode" :value="$alipay_qrcode"/>
-                                        <x-system.input-file code="wechat_qrcode" :value="$wechat_qrcode"/>
+                                    <x-system.input type="url" code="alipay_qrcode" :value="$alipay_qrcode" />
+                                    <x-system.input type="url" code="wechat_qrcode" :value="$wechat_qrcode" />
+                                    <form class="upload-form col-lg-12 row" role="form" action="{{ route('admin.system.extend') }}" method="post"
+                                          enctype="multipart/form-data">@csrf
+                                        <x-system.input-file code="alipay_qrcode" :value="$alipay_qrcode" />
+                                        <x-system.input-file code="wechat_qrcode" :value="$wechat_qrcode" />
                                     </form>
                                 </x-system.tab-pane>
                             </div>
                             <ul class="nav nav-tabs nav-tabs-bottom nav-tabs-line dropup" role="tablist">
                                 <li class="nav-item">
-                                    <a class="nav-link active" data-toggle="tab" href="#paymentSetting" aria-controls="paymentSetting"
-                                       role="tab">{{ trans('admin.system.payment.attribute') }}</a>
+                                    <a class="nav-link active" data-toggle="tab" href="#paymentSetting" role="tab"
+                                       aria-controls="paymentSetting">{{ trans('admin.system.payment.attribute') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#AlipayF2F" aria-controls="AlipayF2F"
-                                       role="tab">{{ trans('admin.system.payment.channel.alipay') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#AlipayF2F" role="tab"
+                                       aria-controls="AlipayF2F">{{ trans('admin.system.payment.channel.alipay') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#CodePay" aria-controls="CodePay" role="tab">{{ trans('admin.system.payment.channel.codepay') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#CodePay" role="tab"
+                                       aria-controls="CodePay">{{ trans('admin.system.payment.channel.codepay') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#EPay" aria-controls="EPay" role="tab">{{ trans('admin.system.payment.channel.epay') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#EPay" role="tab"
+                                       aria-controls="EPay">{{ trans('admin.system.payment.channel.epay') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#PayJs" aria-controls="PayJs" role="tab">{{ trans('admin.system.payment.channel.payjs') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#PayJs" role="tab"
+                                       aria-controls="PayJs">{{ trans('admin.system.payment.channel.payjs') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#PayPal" aria-controls="PayPal" role="tab">{{ trans('admin.system.payment.channel.paypal') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#PayPal" role="tab"
+                                       aria-controls="PayPal">{{ trans('admin.system.payment.channel.paypal') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#Stripe" aria-controls="Stripe" role="tab">{{ trans('admin.system.payment.channel.stripe') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#Stripe" role="tab"
+                                       aria-controls="Stripe">{{ trans('admin.system.payment.channel.stripe') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#PayBeaver" aria-controls="PayBeaver"
-                                       role="tab">{{ trans('admin.system.payment.channel.paybeaver') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#PayBeaver" role="tab"
+                                       aria-controls="PayBeaver">{{ trans('admin.system.payment.channel.paybeaver') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#THeadPay" aria-controls="THeadPay"
-                                       role="tab">{{ trans('admin.system.payment.channel.theadpay') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#THeadPay" role="tab"
+                                       aria-controls="THeadPay">{{ trans('admin.system.payment.channel.theadpay') }}</a>
                                 </li>
                                 <li class="nav-item">
-                                    <a class="nav-link" data-toggle="tab" href="#Manual" aria-controls="Manual" role="tab">{{ trans('admin.system.payment.channel.manual') }}</a>
+                                    <a class="nav-link" data-toggle="tab" href="#Manual" role="tab"
+                                       aria-controls="Manual">{{ trans('admin.system.payment.channel.manual') }}</a>
                                 </li>
                                 <li class="nav-item dropdown" style="display: none;">
                                     <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false"
                                        aria-haspopup="true">{{ trans('admin.setting.system.menu') }}</a>
                                     <div class="dropdown-menu" role="menu">
-                                        <a class="dropdown-item active" data-toggle="tab" href="#paymentSetting" aria-controls="paymentSetting"
-                                           role="tab">{{ trans('admin.system.payment.attribute') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#AlipayF2F" aria-controls="AlipayF2F"
-                                           role="tab">{{ trans('admin.system.payment.channel.alipay') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#CodePay" aria-controls="CodePay"
-                                           role="tab">{{ trans('admin.system.payment.channel.codepay') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#EPay" aria-controls="EPay" role="tab">{{ trans('admin.system.payment.channel.epay') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#PayJs" aria-controls="PayJs"
-                                           role="tab">{{ trans('admin.system.payment.channel.payjs') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#PayPal" aria-controls="PayPal"
-                                           role="tab">{{ trans('admin.system.payment.channel.paypal') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#Stripe" aria-controls="Stripe"
-                                           role="tab">{{ trans('admin.system.payment.channel.stripe') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#PayBeaver" aria-controls="PayBeaver"
-                                           role="tab">{{ trans('admin.system.payment.channel.paybeaver') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#THeadPay" aria-controls="THeadPay"
-                                           role="tab">{{ trans('admin.system.payment.channel.theadpay') }}</a>
-                                        <a class="dropdown-item" data-toggle="tab" href="#Manual" aria-controls="Manual"
-                                           role="tab">{{ trans('admin.system.payment.channel.manual') }}</a>
+                                        <a class="dropdown-item active" data-toggle="tab" href="#paymentSetting" role="tab"
+                                           aria-controls="paymentSetting">{{ trans('admin.system.payment.attribute') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#AlipayF2F" role="tab"
+                                           aria-controls="AlipayF2F">{{ trans('admin.system.payment.channel.alipay') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#CodePay" role="tab"
+                                           aria-controls="CodePay">{{ trans('admin.system.payment.channel.codepay') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#EPay" role="tab"
+                                           aria-controls="EPay">{{ trans('admin.system.payment.channel.epay') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#PayJs" role="tab"
+                                           aria-controls="PayJs">{{ trans('admin.system.payment.channel.payjs') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#PayPal" role="tab"
+                                           aria-controls="PayPal">{{ trans('admin.system.payment.channel.paypal') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#Stripe" role="tab"
+                                           aria-controls="Stripe">{{ trans('admin.system.payment.channel.stripe') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#PayBeaver" role="tab"
+                                           aria-controls="PayBeaver">{{ trans('admin.system.payment.channel.paybeaver') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#THeadPay" role="tab"
+                                           aria-controls="THeadPay">{{ trans('admin.system.payment.channel.theadpay') }}</a>
+                                        <a class="dropdown-item" data-toggle="tab" href="#Manual" role="tab"
+                                           aria-controls="Manual">{{ trans('admin.system.payment.channel.manual') }}</a>
                                     </div>
                                 </li>
                             </ul>
@@ -430,159 +581,191 @@
     <script src="/assets/custom/jump-tab.js"></script>
     <script src="/assets/global/js/Plugin/dropify.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#forbid_mode').selectpicker('val', '{{$forbid_mode}}');
-        $('#username_type').selectpicker('val', '{{$username_type ?? 'email'}}');
-        $('#is_invite_register').selectpicker('val', '{{$is_invite_register}}');
-        $('#is_activate_account').selectpicker('val', '{{$is_activate_account}}');
-        $('#ddns_mode').selectpicker('val', '{{$ddns_mode}}');
-        $('#is_captcha').selectpicker('val', '{{$is_captcha}}');
-        $('#referral_type').selectpicker('val', '{{$referral_type}}');
-        $('#is_email_filtering').selectpicker('val', '{{$is_email_filtering}}');
-        $('#is_AliPay').selectpicker('val', '{{$is_AliPay}}');
-        $('#is_QQPay').selectpicker('val', '{{$is_QQPay}}');
-        $('#is_WeChatPay').selectpicker('val', '{{$is_WeChatPay}}');
-        $('#standard_currency').selectpicker('val', '{{$standard_currency}}');
-        $('#is_otherPay').selectpicker('val', {!! $is_otherPay !!});
-        $('#oauth_path').selectpicker('val', {!! $oauth_path !!});
-        $('#account_expire_notification').selectpicker('val', {!! $account_expire_notification !!});
-        $('#data_anomaly_notification').selectpicker('val', {!! $data_anomaly_notification !!});
-        $('#data_exhaust_notification').selectpicker('val', {!! $data_exhaust_notification !!});
-        $('#node_blocked_notification').selectpicker('val', {!! $node_blocked_notification !!});
-        $('#node_daily_notification').selectpicker('val', {!! $node_daily_notification !!});
-        $('#node_offline_notification').selectpicker('val', {!! $node_offline_notification !!});
-        $('#password_reset_notification').selectpicker('val', '{{$password_reset_notification}}');
-        $('#payment_confirm_notification').selectpicker('val', '{{$payment_confirm_notification}}');
-        $('#payment_received_notification').selectpicker('val', {!! $payment_received_notification !!});
-        $('#ticket_closed_notification').selectpicker('val', {!! $ticket_closed_notification !!});
-        $('#ticket_created_notification').selectpicker('val', {!! $ticket_created_notification !!});
-        $('#ticket_replied_notification').selectpicker('val', {!! $ticket_replied_notification !!});
+        $(document).ready(function() {
+            $('#forbid_mode').selectpicker('val', '{{ $forbid_mode }}');
+            $('#username_type').selectpicker('val', '{{ $username_type ?? 'email' }}');
+            $('#is_invite_register').selectpicker('val', '{{ $is_invite_register }}');
+            $('#is_activate_account').selectpicker('val', '{{ $is_activate_account }}');
+            $('#ddns_mode').selectpicker('val', '{{ $ddns_mode }}');
+            $('#is_captcha').selectpicker('val', '{{ $is_captcha }}');
+            $('#referral_type').selectpicker('val', '{{ $referral_type }}');
+            $('#is_email_filtering').selectpicker('val', '{{ $is_email_filtering }}');
+            $('#is_AliPay').selectpicker('val', '{{ $is_AliPay }}');
+            $('#is_QQPay').selectpicker('val', '{{ $is_QQPay }}');
+            $('#is_WeChatPay').selectpicker('val', '{{ $is_WeChatPay }}');
+            $('#standard_currency').selectpicker('val', '{{ $standard_currency }}');
+            $('#is_otherPay').selectpicker('val', {!! $is_otherPay !!});
+            $('#oauth_path').selectpicker('val', {!! $oauth_path !!});
+            $('#account_expire_notification').selectpicker('val', {!! $account_expire_notification !!});
+            $('#data_anomaly_notification').selectpicker('val', {!! $data_anomaly_notification !!});
+            $('#data_exhaust_notification').selectpicker('val', {!! $data_exhaust_notification !!});
+            $('#node_blocked_notification').selectpicker('val', {!! $node_blocked_notification !!});
+            $('#node_daily_notification').selectpicker('val', {!! $node_daily_notification !!});
+            $('#node_offline_notification').selectpicker('val', {!! $node_offline_notification !!});
+            $('#password_reset_notification').selectpicker('val', '{{ $password_reset_notification }}');
+            $('#payment_confirm_notification').selectpicker('val', '{{ $payment_confirm_notification }}');
+            $('#payment_received_notification').selectpicker('val', {!! $payment_received_notification !!});
+            $('#ticket_closed_notification').selectpicker('val', {!! $ticket_closed_notification !!});
+            $('#ticket_created_notification').selectpicker('val', {!! $ticket_created_notification !!});
+            $('#ticket_replied_notification').selectpicker('val', {!! $ticket_replied_notification !!});
 
-        // Get all options within select
-        disablePayment(document.getElementById('is_AliPay').getElementsByTagName('option'));
-        disablePayment(document.getElementById('is_QQPay').getElementsByTagName('option'));
-        disablePayment(document.getElementById('is_WeChatPay').getElementsByTagName('option'));
-        disablePayment(document.getElementById('is_otherPay').getElementsByTagName('option'));
+            // Get all options within select
+            disablePayment(document.getElementById('is_AliPay').getElementsByTagName('option'));
+            disablePayment(document.getElementById('is_QQPay').getElementsByTagName('option'));
+            disablePayment(document.getElementById('is_WeChatPay').getElementsByTagName('option'));
+            disablePayment(document.getElementById('is_otherPay').getElementsByTagName('option'));
 
-          @if (!$captcha)
-          disableCaptcha(document.getElementById('is_captcha').getElementsByTagName('option'));
-          @endif
+            @if (!$captcha)
+                disableCaptcha(document.getElementById('is_captcha').getElementsByTagName('option'));
+            @endif
 
-      });
-
-      function disablePayment(op) {
-        for (let i = 1; i < op.length; i++) {
-            @json($payments).
-          includes(op[i].value) ? op[i].disabled = false : op[i].disabled = true;
-        }
-      }
+        });
 
-      function disableCaptcha(op) {
-        for (let i = 2; i < op.length; i++) {
-          op[i].disabled = true;
+        function disablePayment(op) {
+            for (let i = 1; i < op.length; i++) {
+                @json($payments).
+                includes(op[i].value) ? op[i].disabled = false : op[i].disabled = true;
+            }
         }
-      }
 
-      // 系统设置更新
-      function systemUpdate(systemItem, value) {
-          @can('admin.system.update')
-          $.post('{{route('admin.system.update')}}', {
-            _token: '{{csrf_token()}}',
-            name: systemItem,
-            value: value,
-          }, function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1500, showConfirmButton: false});
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        function disableCaptcha(op) {
+            for (let i = 2; i < op.length; i++) {
+                op[i].disabled = true;
             }
-          });
-          @else
-          swal.fire({
-            title: '{{ trans('admin.setting.no_permission') }}',
-            icon: 'error',
-            timer: 1500,
-            showConfirmButton: false,
-          });
-          @endcan
-      }
+        }
 
-      // 正常input更新
-      function update(systemItem) {
-        systemUpdate(systemItem, $('#' + systemItem).val());
-      }
+        // 系统设置更新
+        function systemUpdate(systemItem, value) {
+            @can('admin.system.update')
+                $.post('{{ route('admin.system.update') }}', {
+                    _token: '{{ csrf_token() }}',
+                    name: systemItem,
+                    value: value,
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1500,
+                            showConfirmButton: false
+                        });
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        }).then(() => window.location.reload());
+                    }
+                });
+            @else
+                swal.fire({
+                    title: '{{ trans('admin.setting.no_permission') }}',
+                    icon: 'error',
+                    timer: 1500,
+                    showConfirmButton: false,
+                });
+            @endcan
+        }
 
-      // 需要检查限制的更新
-      function updateFromInput(systemItem, lowerBound = false, upperBound = false) {
-        let value = parseInt($('#' + systemItem).val());
-        if (lowerBound !== false && value < lowerBound) {
-          swal.fire({title: '不能小于' + lowerBound, icon: 'warning', timer: 1500, showConfirmButton: false});
-        } else if (upperBound !== false && value > upperBound) {
-          swal.fire({title: '不能大于' + upperBound, icon: 'warning', timer: 1500, showConfirmButton: false});
-        } else {
-          systemUpdate(systemItem, value);
+        // 正常input更新
+        function update(systemItem) {
+            systemUpdate(systemItem, $('#' + systemItem).val());
         }
-      }
 
-      // 其他项更新选择
-      function updateFromOther(inputType, systemItem) {
-        let input = $('#' + systemItem);
-        switch (inputType) {
-          case 'select':
-            input.on('changed.bs.select', function() {
-              systemUpdate(systemItem, $(this).val());
-            });
-            break;
-          case 'multiSelect':
-            input.on('changed.bs.select', function() {
-              systemUpdate(systemItem, $(this).val().join(','));
-            });
-            break;
-          case 'switch':
-            systemUpdate(systemItem, document.getElementById(systemItem).checked ? 1 : 0);
-            break;
-          default:
-            break;
+        // 需要检查限制的更新
+        function updateFromInput(systemItem, lowerBound = false, upperBound = false) {
+            let value = parseInt($('#' + systemItem).val());
+            if (lowerBound !== false && value < lowerBound) {
+                swal.fire({
+                    title: '不能小于' + lowerBound,
+                    icon: 'warning',
+                    timer: 1500,
+                    showConfirmButton: false
+                });
+            } else if (upperBound !== false && value > upperBound) {
+                swal.fire({
+                    title: '不能大于' + upperBound,
+                    icon: 'warning',
+                    timer: 1500,
+                    showConfirmButton: false
+                });
+            } else {
+                systemUpdate(systemItem, value);
+            }
         }
-      }
 
-      // 使用通知渠道 发送测试消息
-      @can('admin.test.notify')
-      function sendTestNotification(channel) {
-        $.post('{{route('admin.test.notify')}}', {_token: '{{csrf_token()}}', channel: channel}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({title: ret.message, icon: 'success', timer: 1500, showConfirmButton: false});
-          } else {
-            swal.fire({title: ret.message, icon: 'error'});
-          }
-        });
-      }
-      @endcan
+        // 其他项更新选择
+        function updateFromOther(inputType, systemItem) {
+            let input = $('#' + systemItem);
+            switch (inputType) {
+                case 'select':
+                    input.on('changed.bs.select', function() {
+                        systemUpdate(systemItem, $(this).val());
+                    });
+                    break;
+                case 'multiSelect':
+                    input.on('changed.bs.select', function() {
+                        systemUpdate(systemItem, $(this).val().join(','));
+                    });
+                    break;
+                case 'switch':
+                    systemUpdate(systemItem, document.getElementById(systemItem).checked ? 1 : 0);
+                    break;
+                default:
+                    break;
+            }
+        }
 
-      // 生成网站安全码
-      function makeWebsiteSecurityCode() {
-        $.get('{{route('createStr')}}', function(ret) {
-          $('#website_security_code').val(ret);
-        });
-      }
+        // 使用通知渠道 发送测试消息
+        @can('admin.test.notify')
+            function sendTestNotification(channel) {
+                $.post('{{ route('admin.test.notify') }}', {
+                    _token: '{{ csrf_token() }}',
+                    channel: channel
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1500,
+                            showConfirmButton: false
+                        });
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        });
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.test.epay')
-      function epayInfo() {
-        $.get('{{route('admin.test.epay')}}', function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({
-              title: '易支付信息(仅供参考)',
-              html: '商户状态: ' + ret.data['active'] + ' | 账号余额: ' + ret.data['money'] + ' | 结算账号:' +
-                  ret.data['account'] + '<br\><br\>渠道手续费:【支付宝 - ' + (100 - ret.data['alirate']) +
-                  '% | 微信 - ' + (100 - ret.data['wxrate']) + '% | QQ钱包 - ' + (100 - ret.data['qqrate']) +
-                  '%】<br\><br\> 请按照支付平台的介绍为准,本信息纯粹为Api获取信息',
-              icon: 'info',
+        // 生成网站安全码
+        function makeWebsiteSecurityCode() {
+            $.get('{{ route('createStr') }}', function(ret) {
+                $('#website_security_code').val(ret);
             });
-          } else {
-            swal.fire({title: ret.message, icon: 'error'});
-          }
-        });
-      }
+        }
+
+        @can('admin.test.epay')
+            function epayInfo() {
+                $.get('{{ route('admin.test.epay') }}', function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: '易支付信息(仅供参考)',
+                            html: '商户状态: ' + ret.data['active'] + ' | 账号余额: ' + ret.data['money'] + ' | 结算账号:' +
+                                ret.data['account'] + '<br\><br\>渠道手续费:【支付宝 - ' + (100 - ret.data['alirate']) +
+                                '% | 微信 - ' + (100 - ret.data['wxrate']) + '% | QQ钱包 - ' + (100 - ret.data['qqrate']) +
+                                '%】<br\><br\> 请按照支付平台的介绍为准,本信息纯粹为Api获取信息',
+                            icon: 'info',
+                        });
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
 @endsection

+ 79 - 64
resources/views/admin/coupon/create.blade.php

@@ -11,51 +11,51 @@
             <div class="panel-heading">
                 <h1 class="panel-title">{{ trans('admin.action.add_item', ['attribute' => trans('model.coupon.attribute')]) }}</h1>
                 <div class="panel-actions">
-                    <a href="{{route('admin.coupon.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.coupon.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="{{route('admin.coupon.store')}}" method="post" enctype="multipart/form-data"
-                      class="form-horizontal" role="form">@csrf
+                <form class="form-horizontal" role="form" action="{{ route('admin.coupon.store') }}" method="post" enctype="multipart/form-data">@csrf
                     <div class="form-group row">
                         <label class="col-md-2 col-form-label" for="name">{{ trans('model.coupon.name') }}</label>
                         <div class="col-md-10">
-                            <input type="text" class="form-control col-md-4" name="name" id="name" value="{{old('name')}}" required/>
+                            <input class="form-control col-md-4" id="name" name="name" type="text" value="{{ old('name') }}" required />
                             <span class="text-help"> {{ trans('admin.coupon.name_hint') }} </span>
                         </div>
                     </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-form-label" for="sn">{{ trans('model.coupon.sn') }}</label>
                         <div class="col-md-10">
-                            <input type="text" class="form-control col-md-4" name="sn" id="sn" value="{{old('sn')}}"/>
+                            <input class="form-control col-md-4" id="sn" name="sn" type="text" value="{{ old('sn') }}" />
                             <span class="text-help"> {{ trans('admin.coupon.sn_hint') }} </span>
                         </div>
                     </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-form-label" for="logo">{{ trans('model.coupon.logo') }}</label>
                         <div class="col-md-6">
-                            <input type="file" id="logo" name="logo" data-plugin="dropify" data-default-file="{{asset('/assets/images/default.png')}}"/>
+                            <input id="logo" name="logo" data-plugin="dropify" data-default-file="{{ asset('/assets/images/default.png') }}"
+                                   type="file" />
                         </div>
                     </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-form-label">{{ trans('model.common.type') }}</label>
                         <div class="col-md-10 align-items-center">
                             <div class="radio-custom radio-primary radio-inline">
-                                <input type="radio" name="type" id="voucher" value="1" checked/>
+                                <input id="voucher" name="type" type="radio" value="1" checked />
                                 <label for="voucher">{{ trans('admin.coupon.type.voucher') }}</label>
                             </div>
                             <div class="radio-custom radio-primary radio-inline">
-                                <input type="radio" name="type" id="discount" value="2"/>
+                                <input id="discount" name="type" type="radio" value="2" />
                                 <label for="discount">{{ trans('admin.coupon.type.discount') }}</label>
                             </div>
                             <div class="radio-custom radio-primary radio-inline">
-                                <input type="radio" name="type" id="charge" value="3"/>
+                                <input id="charge" name="type" type="radio" value="3" />
                                 <label for="charge">{{ trans('admin.coupon.type.charge') }}</label>
                             </div>
                             <span class="text-help"> {{ trans('admin.coupon.type_hint') }} </span>
@@ -66,9 +66,11 @@
                         <div class="col-md-10">
                             <div class="input-group">
                                 <div class="input-group-prepend" id="amount">
-                                    <span class="input-group-text">{{array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')]}}</span>
+                                    <span
+                                          class="input-group-text">{{ array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')] }}</span>
                                 </div>
-                                <input type="number" class="form-control col-md-3" min="1" name="value" id="value" value="{{old('value')}}" required/>
+                                <input class="form-control col-md-3" id="value" name="value" type="number" value="{{ old('value') }}" min="1"
+                                       required />
                                 <span class="input-group-text discount" style="display: none;">%</span>
                             </div>
                             <span class="text-help discount" style="display: none;"> {{ trans('admin.coupon.value_hint') }}</span>
@@ -79,7 +81,8 @@
                             <label class="col-md-2 col-form-label" for="priority"> {{ trans('model.coupon.priority') }} </label>
                             <div class="col-md-10">
                                 <div class="input-group">
-                                    <input type="number" class="form-control col-md-2" min="1" max="255" name="priority" id="priority" value="{{old('priority')}}"/>
+                                    <input class="form-control col-md-2" id="priority" name="priority" type="number" value="{{ old('priority') }}"
+                                           min="1" max="255" />
                                 </div>
                                 <span class="text-help"> {{ trans('admin.coupon.priority_hint') }} </span>
                             </div>
@@ -87,7 +90,8 @@
                         <div class="form-group row">
                             <label class="col-md-2 col-form-label" for="usable_times">{{ trans('model.coupon.usable_times') }}</label>
                             <div class="col-md-4 input-group">
-                                <input type="number" class="form-control" min="1" name="usable_times" id="usable_times" value="{{old('usable_times', 1)}}"/>
+                                <input class="form-control" id="usable_times" name="usable_times" type="number" value="{{ old('usable_times', 1) }}"
+                                       min="1" />
                                 <span class="input-group-text">{{ trans('admin.times') }}</span>
                             </div>
                         </div>
@@ -97,40 +101,45 @@
                             <div class="col-md-10">
                                 <div class="input-group">
                                     <div class="input-group-prepend">
-                                        <span class="input-group-text">{{array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')]}}</span>
+                                        <span
+                                              class="input-group-text">{{ array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')] }}</span>
                                     </div>
-                                    <input type="number" class="form-control col-md-3" name="minimum" id="minimum" value="{{old('minimum')}}" step="0.01"/>
+                                    <input class="form-control col-md-3" id="minimum" name="minimum" type="number" value="{{ old('minimum') }}"
+                                           step="0.01" />
                                 </div>
-                                <span class="text-help"> {!! trans('admin.coupon.minimum_hint', ['num' => 'N']).' '.trans('admin.zero_unlimited_hint') !!} </span>
+                                <span class="text-help"> {!! trans('admin.coupon.minimum_hint', ['num' => 'N']) . ' ' . trans('admin.zero_unlimited_hint') !!} </span>
                             </div>
                         </div>
                         <div class="form-group row">
                             <label class="col-md-2 col-form-label" for="used">{{ trans('model.coupon.used') }}</label>
                             <div class="col-md-10">
                                 <div class="input-group">
-                                    <input type="number" class="form-control col-md-3" name="used" id="used" value="{{old('used')}}" step="1"/>
+                                    <input class="form-control col-md-3" id="used" name="used" type="number" value="{{ old('used') }}"
+                                           step="1" />
                                     <span class="input-group-text">{{ trans('admin.times') }}</span>
                                 </div>
-                                <span class="text-help"> {!! trans('admin.coupon.used_hint', ['num' => 'N']).' '.trans('admin.zero_unlimited_hint') !!}</span>
+                                <span class="text-help"> {!! trans('admin.coupon.used_hint', ['num' => 'N']) . ' ' . trans('admin.zero_unlimited_hint') !!}</span>
                             </div>
                         </div>
                         <div class="form-group row">
-                            <label for="levels" class="col-md-2 col-form-label">{{ trans('model.coupon.levels') }}</label>
+                            <label class="col-md-2 col-form-label" for="levels">{{ trans('model.coupon.levels') }}</label>
                             <div class="col-md-10">
-                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control show-tick" id="levels" name="levels[]" multiple>
-                                    @foreach($levels as $key => $level)
-                                        <option value="{{$key}}">{{$level}}</option>
+                                <select class="col-md-5 form-control show-tick" id="levels" name="levels[]" data-plugin="selectpicker"
+                                        data-style="btn-outline btn-primary" multiple>
+                                    @foreach ($levels as $key => $level)
+                                        <option value="{{ $key }}">{{ $level }}</option>
                                     @endforeach
                                 </select>
                                 <span class="text-help"> {{ trans('admin.coupon.levels_hint') }}</span>
                             </div>
                         </div>
                         <div class="form-group row">
-                            <label for="groups" class="col-md-2 col-form-label">{{ trans('model.coupon.groups') }}</label>
+                            <label class="col-md-2 col-form-label" for="groups">{{ trans('model.coupon.groups') }}</label>
                             <div class="col-md-10">
-                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control show-tick" id="groups" name="groups[]" multiple>
-                                    @foreach($userGroups as $key => $group)
-                                        <option value="{{$key}}">{{$group}}</option>
+                                <select class="col-md-5 form-control show-tick" id="groups" name="groups[]" data-plugin="selectpicker"
+                                        data-style="btn-outline btn-primary" multiple>
+                                    @foreach ($userGroups as $key => $group)
+                                        <option value="{{ $key }}">{{ $group }}</option>
                                     @endforeach
                                 </select>
                                 <span class="text-help"> {{ trans('admin.coupon.groups_hint') }}</span>
@@ -139,44 +148,48 @@
                         <div class="form-group row">
                             <label class="col-md-2 col-form-label" for="users_whitelist">{{ trans('model.coupon.users_whitelist') }}</label>
                             <div class="col-md-10">
-                                <input type="text" class="form-control col-md-6" data-plugin="tokenfield" id="users_whitelist" name="users_whitelist" value="{{old('users_whitelist')}}" placeholder="{{ trans('admin.coupon.users_placeholder') }}"/>
+                                <input class="form-control col-md-6" id="users_whitelist" name="users_whitelist" data-plugin="tokenfield" type="text"
+                                       value="{{ old('users_whitelist') }}" placeholder="{{ trans('admin.coupon.users_placeholder') }}" />
                                 <span class="text-help"> {{ trans('admin.coupon.user_whitelist_hint') }}</span>
                             </div>
                         </div>
                         <div class="form-group row">
                             <label class="col-md-2 col-form-label" for="users_blacklist">{{ trans('model.coupon.users_blacklist') }}</label>
                             <div class="col-md-10">
-                                <input type="text" class="form-control col-md-6" data-plugin="tokenfield" id="users_blacklist" name="users_blacklist" value="{{old('users_blacklist')}}" placeholder="{{ trans('admin.coupon.users_placeholder') }}"/>
+                                <input class="form-control col-md-6" id="users_blacklist" name="users_blacklist" data-plugin="tokenfield" type="text"
+                                       value="{{ old('users_blacklist') }}" placeholder="{{ trans('admin.coupon.users_placeholder') }}" />
                                 <span class="text-help"> {{ trans('admin.coupon.users_blacklist_hint') }}</span>
                             </div>
                         </div>
                         <div class="form-group row">
                             <label class="col-md-2 col-form-label" for="services_whitelist">{{ trans('model.coupon.services_whitelist') }}</label>
                             <div class="col-md-10">
-                                <input type="text" class="form-control col-md-4" data-plugin="tokenfield" id="services_whitelist" name="services_whitelist" value="{{old('services_whitelist')}}" placeholder="{{ trans('admin.coupon.services_placeholder') }}"/>
+                                <input class="form-control col-md-4" id="services_whitelist" name="services_whitelist" data-plugin="tokenfield" type="text"
+                                       value="{{ old('services_whitelist') }}" placeholder="{{ trans('admin.coupon.services_placeholder') }}" />
                                 <span class="text-help"> {{ trans('admin.coupon.services_whitelist_hint') }}</span>
                             </div>
                         </div>
                         <div class="form-group row">
                             <label class="col-md-2 col-form-label" for="services_blacklist">{{ trans('model.coupon.services_blacklist') }}</label>
                             <div class="col-md-10">
-                                <input type="text" class="form-control col-md-4" data-plugin="tokenfield" id="services_blacklist" name="services_blacklist" value="{{old('services_blacklist')}}" placeholder="{{ trans('admin.coupon.services_placeholder') }}"/>
+                                <input class="form-control col-md-4" id="services_blacklist" name="services_blacklist" data-plugin="tokenfield" type="text"
+                                       value="{{ old('services_blacklist') }}" placeholder="{{ trans('admin.coupon.services_placeholder') }}" />
                                 <span class="text-help"> {{ trans('admin.coupon.services_blacklist_hint') }}</span>
                             </div>
                         </div>
                         <div class="form-group row">
-                            <label for="newbie" class="col-md-2 col-form-label">{{ trans('model.coupon.newbie') }}</label>
+                            <label class="col-md-2 col-form-label" for="newbie">{{ trans('model.coupon.newbie') }}</label>
                             <div class="col-md-10">
                                 <ul class="list-unstyled">
                                     <li class="list-group-item p-0">
                                         <div class="checkbox-custom checkbox-primary">
-                                            <input type="checkbox" id="coupon" name="coupon" {{ old('coupon') ? 'checked' : '' }}/>
+                                            <input id="coupon" name="coupon" type="checkbox" {{ old('coupon') ? 'checked' : '' }} />
                                             <label for="coupon">{{ trans('admin.coupon.newbie.first_discount') }}</label>
                                         </div>
                                     </li>
                                     <li class="list-group-item p-0">
                                         <div class="checkbox-custom checkbox-primary">
-                                            <input type="checkbox" id="order" name="order" {{ old('order') ? 'checked' : '' }}/>
+                                            <input id="order" name="order" type="checkbox" {{ old('order') ? 'checked' : '' }} />
                                             <label for="order">{{ trans('admin.coupon.newbie.first_order') }}</label>
                                         </div>
                                     </li>
@@ -185,7 +198,7 @@
                                             <div class="input-group-prepend">
                                                 <label class="input-group-text" for="days">{{ trans('admin.coupon.newbie.created_days') }}</label>
                                             </div>
-                                            <input type="number" class="form-control col-md-3" name="days" id="days" value="{{old('days')}}"/>
+                                            <input class="form-control col-md-3" id="days" name="days" type="number" value="{{ old('days') }}" />
                                             <div class="input-group-append">
                                                 <span class="input-group-text">{{ trans_choice('common.days.attribute', 0) }}</span>
                                             </div>
@@ -200,7 +213,7 @@
                     <div class="form-group row">
                         <label class="col-md-2 col-form-label" for="num">{{ trans('model.coupon.num') }}</label>
                         <div class="col-md-4">
-                            <input type="number" class="form-control" name="num" id="num" value="{{old('num')}}" required/>
+                            <input class="form-control" id="num" name="num" type="number" value="{{ old('num') }}" required />
                         </div>
                     </div>
                     <div class="form-group row">
@@ -211,16 +224,18 @@
                                     <i class="icon wb-calendar" aria-hidden="true"></i></span>
                             </div>
                             <label for="start_time"></label>
-                            <input type="text" class="form-control" name="start_time" id="start_time" value="{{old('start_time') ?? date("Y-m-d")}}" required/>
+                            <input class="form-control" id="start_time" name="start_time" type="text" value="{{ old('start_time') ?? date('Y-m-d') }}"
+                                   required />
                             <div class="input-group-prepend">
                                 <span class="input-group-text">{{ trans('common.to') }}</span>
                             </div>
                             <label for="end_time"></label>
-                            <input type="text" class="form-control" name="end_time" id="end_time" value="{{old('end_time') ?? date("Y-m-d",strtotime("+1 month"))}}" required/>
+                            <input class="form-control" id="end_time" name="end_time" type="text"
+                                   value="{{ old('end_time') ?? date('Y-m-d', strtotime('+1 month')) }}" required />
                         </div>
                     </div>
                     <div class="form-actions col-12 text-right">
-                        <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                     </div>
                 </form>
             </div>
@@ -237,35 +252,35 @@
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-tokenfield.js"></script>
     <script>
-        @if(old())
-        $(document).ready(function() {
-          $("input[name='type'][value='{{old('type')}}']").click();
-          $('#levels').selectpicker('val', @json(old('levels')));
-          $('#groups').selectpicker('val', @json(old('groups')));
-        });
+        @if (old())
+            $(document).ready(function() {
+                $("input[name='type'][value='{{ old('type') }}']").click();
+                $('#levels').selectpicker('val', @json(old('levels')));
+                $('#groups').selectpicker('val', @json(old('groups')));
+            });
         @endif
 
         $('.input-daterange>input').datepicker({
-          format: 'yyyy-mm-dd',
+            format: 'yyyy-mm-dd',
         });
 
         $('input[name=\'type\']').change(function() {
-          if ($(this).val() === '2') {
-            $('.discount').show();
-            $('.usage').show();
-            $('#amount').hide();
-            $('#value').attr('max', 99);
-          } else if ($(this).val() === '3') {
-            $('.discount').hide();
-            $('.usage').hide();
-            $('#amount').show();
-            $('#value').removeAttr('max');
-          } else {
-            $('.discount').hide();
-            $('.usage').show();
-            $('#amount').show();
-            $('#value').removeAttr('max');
-          }
+            if ($(this).val() === '2') {
+                $('.discount').show();
+                $('.usage').show();
+                $('#amount').hide();
+                $('#value').attr('max', 99);
+            } else if ($(this).val() === '3') {
+                $('.discount').hide();
+                $('.usage').hide();
+                $('#amount').show();
+                $('#value').removeAttr('max');
+            } else {
+                $('.discount').hide();
+                $('.usage').show();
+                $('#amount').show();
+                $('#value').removeAttr('max');
+            }
         });
     </script>
 @endsection

+ 127 - 134
resources/views/admin/coupon/index.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -10,12 +7,10 @@
                 @canany(['admin.coupon.export', 'admin.coupon.create'])
                     <div class="panel-actions btn-group">
                         @can('admin.coupon.export')
-                            <button class="btn btn-info" onclick="exportCoupon()"><i
-                                        class="icon wb-code"></i>{{ trans('admin.massive_export') }}</button>
+                            <button class="btn btn-info" onclick="exportCoupon()"><i class="icon wb-code"></i>{{ trans('admin.massive_export') }}</button>
                         @endcan
                         @can('admin.coupon.create')
-                            <a href="{{route('admin.coupon.create')}}" class="btn btn-primary"><i
-                                        class="icon wb-plus"></i> {{ trans('common.add') }}</a>
+                            <a class="btn btn-primary" href="{{ route('admin.coupon.create') }}"><i class="icon wb-plus"></i> {{ trans('common.add') }}</a>
                         @endcan
                     </div>
                 @endcanany
@@ -23,90 +18,89 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-4">
-                        <input type="text" class="form-control" name="sn" value="{{Request::query('sn')}}"
-                               placeholder="{{ trans('model.coupon.sn') }}" autocomplete="off"/>
+                        <input class="form-control" name="sn" type="text" value="{{ Request::query('sn') }}" placeholder="{{ trans('model.coupon.sn') }}"
+                               autocomplete="off" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-4">
-                        <select class="form-control" name="type" id="type">
-                            <option value="" hidden>{{ trans('model.common.type') }}</option>
+                        <select class="form-control" id="type" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.common.type') }}">
                             <option value="1">{{ trans('admin.coupon.type.voucher') }}</option>
                             <option value="2">{{ trans('admin.coupon.type.discount') }}</option>
                             <option value="3">{{ trans('admin.coupon.type.charge') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-3 col-sm-4">
-                        <select class="form-control" name="status" id="status">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="0">{{ trans('common.status.available') }}</option>
                             <option value="1">{{ trans('common.status.used') }}</option>
                             <option value="2">{{ trans('common.status.expire') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-3 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.coupon.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.coupon.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.coupon.name') }}</th>
-                        <th> {{ trans('model.coupon.sn') }}</th>
-                        <th> {{ trans('model.coupon.logo') }}</th>
-                        <th> {{ trans('model.common.type') }}</th>
-                        <th> {{ trans('model.coupon.priority') }}</th>
-                        <th> {{ trans('model.coupon.usable_times') }}</th>
-                        <th> {{ trans('admin.coupon.discount') }}</th>
-                        <th> {{ trans('common.available_date') }}</th>
-                        <th> {{ trans('common.status.attribute') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('model.coupon.name') }}</th>
+                            <th> {{ trans('model.coupon.sn') }}</th>
+                            <th> {{ trans('model.coupon.logo') }}</th>
+                            <th> {{ trans('model.common.type') }}</th>
+                            <th> {{ trans('model.coupon.priority') }}</th>
+                            <th> {{ trans('model.coupon.usable_times') }}</th>
+                            <th> {{ trans('admin.coupon.discount') }}</th>
+                            <th> {{ trans('common.available_date') }}</th>
+                            <th> {{ trans('common.status.attribute') }}</th>
+                            <th> {{ trans('common.action') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($couponList as $coupon)
-                        <tr>
-                            <td> {{$coupon->id}} </td>
-                            <td> {{$coupon->name}} </td>
-                            <td> {{$coupon->sn}} </td>
-                            <td> @if($coupon->logo)
-                                    <img src="{{asset($coupon->logo)}}" class="h-50"
-                                         alt="{{ trans('model.coupon.logo') }}"/>
-                                @endif </td>
-                            <td>
-                                {{ [trans('common.status.unknown'), trans('admin.coupon.type.voucher') , trans('admin.coupon.type.discount'), trans('admin.coupon.type.charge')][$coupon->type] }}
-                            </td>
-                            <td> {{$coupon->priority}} </td>
-                            <td> {{$coupon->type === 3 ? trans('admin.coupon.single_use') : ($coupon->usable_times ?? trans('common.unlimited'))}} </td>
-                            <td>
-                                {{ trans_choice('admin.coupon.value', $coupon->type, ['num' => $coupon->type === 2 ? $coupon->value : \App\Utils\Helpers::getPriceTag($coupon->value)]) }}
-                            </td>
-                            <td> {{$coupon->start_time}} ~ {{$coupon->end_time}} </td>
-                            <td>
-                                <span class="badge badge-lg @if($coupon->status) badge-default @else badge-success @endif">
-                                    {{ [trans('common.status.available'), trans('common.status.used'), trans('common.status.expire')][$coupon->status] }}
-                                </span>
-                            </td>
-                            <td>
-                                <div class="btn-group">
-                                    @can('admin.coupon.show')
-                                        <a class="btn btn-info" href="{{route('admin.coupon.show', $coupon)}}"
-                                           target="_blank">
-                                            <i class="icon wb-eye"></i>
-                                        </a>
-                                    @endcan
-                                    @if($coupon->status !== 1)
-                                        @can('admin.coupon.destroy')
-                                            <button class="btn btn-danger"
-                                                    onclick="delCoupon('{{$coupon->id}}','{{$coupon->name}}')">
-                                                <i class="icon wb-close"></i>
-                                            </button>
-                                        @endcan
+                        @foreach ($couponList as $coupon)
+                            <tr>
+                                <td> {{ $coupon->id }} </td>
+                                <td> {{ $coupon->name }} </td>
+                                <td> {{ $coupon->sn }} </td>
+                                <td>
+                                    @if ($coupon->logo)
+                                        <img class="h-50" src="{{ asset($coupon->logo) }}" alt="{{ trans('model.coupon.logo') }}" />
                                     @endif
-                                </div>
-                            </td>
-                        </tr>
-                    @endforeach
+                                </td>
+                                <td>
+                                    {{ [trans('common.status.unknown'), trans('admin.coupon.type.voucher'), trans('admin.coupon.type.discount'), trans('admin.coupon.type.charge')][$coupon->type] }}
+                                </td>
+                                <td> {{ $coupon->priority }} </td>
+                                <td> {{ $coupon->type === 3 ? trans('admin.coupon.single_use') : $coupon->usable_times ?? trans('common.unlimited') }} </td>
+                                <td>
+                                    {{ trans_choice('admin.coupon.value', $coupon->type, ['num' => $coupon->type === 2 ? $coupon->value : \App\Utils\Helpers::getPriceTag($coupon->value)]) }}
+                                </td>
+                                <td> {{ $coupon->start_time }} ~ {{ $coupon->end_time }} </td>
+                                <td>
+                                    <span class="badge badge-lg @if ($coupon->status) badge-default @else badge-success @endif">
+                                        {{ [trans('common.status.available'), trans('common.status.used'), trans('common.status.expire')][$coupon->status] }}
+                                    </span>
+                                </td>
+                                <td>
+                                    <div class="btn-group">
+                                        @can('admin.coupon.show')
+                                            <a class="btn btn-info" href="{{ route('admin.coupon.show', $coupon) }}" target="_blank">
+                                                <i class="icon wb-eye"></i>
+                                            </a>
+                                        @endcan
+                                        @if ($coupon->status !== 1)
+                                            @can('admin.coupon.destroy')
+                                                <button class="btn btn-danger" onclick="delCoupon('{{ $coupon->id }}','{{ $coupon->name }}')">
+                                                    <i class="icon wb-close"></i>
+                                                </button>
+                                            @endcan
+                                        @endif
+                                    </div>
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -117,7 +111,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$couponList->links()}}
+                            {{ $couponList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -125,71 +119,70 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#type').val({{Request::query('type')}});
-        $('#status').val({{Request::query('status')}});
-
-        $('select').on('change', function() {
-          this.form.submit();
+        $(document).ready(function() {
+            $('#type').selectpicker('val', @json(Request::query('type')));
+            $('#status').selectpicker('val', @json(Request::query('status')));
         });
-      });
 
-      @can('admin.coupon.export')
-      // 批量导出卡券
-      function exportCoupon() {
-        swal.fire({
-          title: '{{ trans('admin.coupon.export_title') }}',
-          text: '{{ trans('admin.confirm.export') }}?',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            window.location.href = '{{route('admin.coupon.export')}}';
-          }
-        });
-      }
-      @endcan
+        @can('admin.coupon.export')
+            // 批量导出卡券
+            function exportCoupon() {
+                swal.fire({
+                    title: '{{ trans('admin.coupon.export_title') }}',
+                    text: '{{ trans('admin.confirm.export') }}?',
+                    icon: 'question',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        window.location.href = '{{ route('admin.coupon.export') }}';
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.coupon.destroy')
-      // 删除卡券
-      function delCoupon(id, name) {
-        swal.fire({
-          title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.coupon.attribute')]) }}' + name +
-              '{{ trans('admin.confirm.delete.1') }}',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: '{{route('admin.coupon.destroy', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          }
-        });
-      }
+        @can('admin.coupon.destroy')
+            // 删除卡券
+            function delCoupon(id, name) {
+                swal.fire({
+                    title: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.coupon.attribute')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'question',
+                    allowEnterKey: false,
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.coupon.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
-@endsection
+@endpush

+ 49 - 62
resources/views/admin/coupon/show.blade.php

@@ -15,27 +15,27 @@
             <div class="panel-heading">
                 <h1 class="panel-title">{{ trans('admin.coupon.info_title') }}</h1>
                 <div class="panel-actions">
-                    <a href="{{route('admin.coupon.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.coupon.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             <div class="panel-body">
                 <div class="form-group row">
                     <label class="col-md-2 col-form-label" for="name">{{ trans('model.coupon.name') }}</label>
                     <div class="col-md-10">
-                        <input class="form-control text-fit" id="name" value="{{$coupon->name}}" disabled/>
+                        <input class="form-control text-fit" id="name" value="{{ $coupon->name }}" disabled />
                     </div>
                 </div>
                 <div class="form-group row">
                     <label class="col-md-2 col-form-label" for="sn">{{ trans('model.coupon.sn') }}</label>
                     <div class="col-md-10">
-                        <input type="text" class="form-control text-fit" id="sn" value="{{$coupon->sn}}" disabled/>
+                        <input class="form-control text-fit" id="sn" type="text" value="{{ $coupon->sn }}" disabled />
                     </div>
                 </div>
-                @if($coupon->logo)
+                @if ($coupon->logo)
                     <div class="form-group row">
                         <span class="col-md-2 col-form-label">{{ trans('model.coupon.logo') }}</span>
                         <div class="col-md-10">
-                            <img src="{{asset($coupon->logo)}}" class="h-100" alt="{{ trans('model.coupon.logo') }}"/>
+                            <img class="h-100" src="{{ asset($coupon->logo) }}" alt="{{ trans('model.coupon.logo') }}" />
                         </div>
                     </div>
                 @endif
@@ -43,9 +43,9 @@
                     <span class="col-md-2 col-form-label">{{ trans('model.common.type') }}</span>
                     <div class="col-md-10 align-items-center">
                         <div class="radio-custom radio-primary radio-inline">
-                            <input type="radio" id="voucher" checked/>
+                            <input id="voucher" type="radio" checked />
                             <label for="voucher">
-                                {{  [trans('common.status.unknown'), trans('admin.coupon.type.voucher') , trans('admin.coupon.type.discount'), trans('admin.coupon.type.charge')][$coupon->type] }}
+                                {{ [trans('common.status.unknown'), trans('admin.coupon.type.voucher'), trans('admin.coupon.type.discount'), trans('admin.coupon.type.charge')][$coupon->type] }}
                             </label>
                         </div>
                     </div>
@@ -62,7 +62,7 @@
                     <div class="form-group row">
                         <span class="col-md-2 col-form-label"> {{ trans('model.coupon.priority') }} </span>
                         <div class="col-md-10">
-                            <span class="form-control text-fit"> {{$coupon->priority}} </span>
+                            <span class="form-control text-fit"> {{ $coupon->priority }} </span>
                         </div>
                     </div>
                 @endisset
@@ -70,16 +70,15 @@
                     <div class="form-group row">
                         <span class="col-md-2 col-form-label">{{ trans('model.coupon.usable_times') }}</span>
                         <div class="col-md-10">
-                            <span class="form-control text-fit"><code>{{$coupon->usable_times}}</code> {{ trans('admin.times') }}</span>
+                            <span class="form-control text-fit"><code>{{ $coupon->usable_times }}</code> {{ trans('admin.times') }}</span>
                         </div>
                     </div>
                 @endisset
-                @if(!empty($coupon->limit))
+                @if (!empty($coupon->limit))
                     <hr>
                     @isset($coupon->limit['minimum'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="minimum">{{ trans('model.coupon.minimum') }}</label>
+                            <label class="col-md-2 col-form-label" for="minimum">{{ trans('model.coupon.minimum') }}</label>
                             <div class="col-md-10">
                                 <p class="form-control text-fit">{!! trans('admin.coupon.minimum_hint', ['num' => \App\Utils\Helpers::getPriceTag($coupon->limit['minimum'])]) !!}</p>
                             </div>
@@ -95,13 +94,12 @@
                     @endisset
                     @isset($coupon->limit['users']['levels'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="levels">{{ trans('model.coupon.levels') }}</label>
+                            <label class="col-md-2 col-form-label" for="levels">{{ trans('model.coupon.levels') }}</label>
                             <div class="col-md-10">
-                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary"
-                                        class="col-md-5 form-control show-tick" id="levels" multiple disabled>
-                                    @foreach($levels as $key => $level)
-                                        <option value="{{$key}}">{{$level}}</option>
+                                <select class="col-md-5 form-control show-tick" id="levels" data-plugin="selectpicker" data-style="btn-outline btn-primary" multiple
+                                        disabled>
+                                    @foreach ($levels as $key => $level)
+                                        <option value="{{ $key }}">{{ $level }}</option>
                                     @endforeach
                                 </select>
                                 <span class="text-help"> {{ trans('admin.coupon.levels_hint') }}</span>
@@ -110,13 +108,12 @@
                     @endisset
                     @isset($coupon->limit['users']['groups'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="groups">{{ trans('model.coupon.groups') }}</label>
+                            <label class="col-md-2 col-form-label" for="groups">{{ trans('model.coupon.groups') }}</label>
                             <div class="col-md-10">
-                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary"
-                                        class="col-md-5 form-control show-tick" id="groups" multiple disabled>
-                                    @foreach($userGroups as $key => $group)
-                                        <option value="{{$key}}">{{$group}}</option>
+                                <select class="col-md-5 form-control show-tick" id="groups" data-plugin="selectpicker" data-style="btn-outline btn-primary" multiple
+                                        disabled>
+                                    @foreach ($userGroups as $key => $group)
+                                        <option value="{{ $key }}">{{ $group }}</option>
                                     @endforeach
                                 </select>
                                 <span class="text-help"> {{ trans('admin.coupon.groups_hint') }}</span>
@@ -125,72 +122,62 @@
                     @endisset
                     @isset($coupon->limit['users']['white'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="users_whitelist">{{ trans('model.coupon.users_whitelist') }}</label>
+                            <label class="col-md-2 col-form-label" for="users_whitelist">{{ trans('model.coupon.users_whitelist') }}</label>
                             <div class="col-md-6">
-                                <input class="form-control" data-plugin="tokenfield" id="users_whitelist"
-                                       value="{{ implode(',', $coupon->limit['users']['white']) }}"
-                                       disabled/>
+                                <input class="form-control" id="users_whitelist" data-plugin="tokenfield" value="{{ implode(',', $coupon->limit['users']['white']) }}"
+                                       disabled />
                             </div>
                         </div>
                     @endisset
                     @isset($coupon->limit['users']['black'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="users_blacklist">{{ trans('model.coupon.users_blacklist') }}</label>
+                            <label class="col-md-2 col-form-label" for="users_blacklist">{{ trans('model.coupon.users_blacklist') }}</label>
                             <div class="col-md-6">
-                                <input class="form-control" data-plugin="tokenfield" id="users_blacklist"
-                                       value="{{ implode(',', $coupon->limit['users']['black']) }}"
-                                       disabled/>
+                                <input class="form-control" id="users_blacklist" data-plugin="tokenfield" value="{{ implode(',', $coupon->limit['users']['black']) }}"
+                                       disabled />
                             </div>
                         </div>
                     @endisset
                     @isset($coupon->limit['services']['white'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="services_whitelist">{{ trans('model.coupon.services_whitelist') }}</label>
+                            <label class="col-md-2 col-form-label" for="services_whitelist">{{ trans('model.coupon.services_whitelist') }}</label>
                             <div class="col-md-6">
-                                <input class="form-control" data-plugin="tokenfield" id="services_whitelist"
-                                       value="{{ implode(',', $coupon->limit['services']['white']) }}"
-                                       disabled/>
+                                <input class="form-control" id="services_whitelist" data-plugin="tokenfield"
+                                       value="{{ implode(',', $coupon->limit['services']['white']) }}" disabled />
                             </div>
                         </div>
                     @endisset
                     @isset($coupon->limit['services']['black'])
                         <div class="form-group row">
-                            <label class="col-md-2 col-form-label"
-                                   for="services_blacklist">{{ trans('model.coupon.services_blacklist') }}</label>
+                            <label class="col-md-2 col-form-label" for="services_blacklist">{{ trans('model.coupon.services_blacklist') }}</label>
                             <div class="col-md-6">
-                                <input class="form-control" data-plugin="tokenfield" id="services_blacklist"
-                                       value="{{ implode(',', $coupon->limit['services']['black']) }}"
-                                       disabled/>
+                                <input class="form-control" id="services_blacklist" data-plugin="tokenfield"
+                                       value="{{ implode(',', $coupon->limit['services']['black']) }}" disabled />
                             </div>
                         </div>
                     @endisset
                     @isset($coupon->limit['users']['newbie'])
                         <div class="form-group row">
-                            <label for="newbie"
-                                   class="col-md-2 col-form-label">{{ trans('model.coupon.newbie') }}</label>
+                            <label class="col-md-2 col-form-label" for="newbie">{{ trans('model.coupon.newbie') }}</label>
                             <div class="col-md-10">
                                 <ul class="list-unstyled">
                                     <li class="list-group-item p-0">
                                         <div class="checkbox-custom checkbox-primary">
-                                            <input type="checkbox" id="coupon"
-                                                   {{ isset($coupon->limit['users']['newbie']['coupon']) ? 'checked' : '' }} disabled/>
+                                            <input id="coupon" type="checkbox" {{ isset($coupon->limit['users']['newbie']['coupon']) ? 'checked' : '' }}
+                                                   disabled />
                                             <label for="coupon">{{ trans('admin.coupon.newbie.first_discount') }}</label>
                                         </div>
                                     </li>
                                     <li class="list-group-item p-0">
                                         <div class="checkbox-custom checkbox-primary">
-                                            <input type="checkbox" id="order"
-                                                   {{ isset($coupon->limit['users']['newbie']['order']) ? 'checked' : '' }} disabled/>
+                                            <input id="order" type="checkbox" {{ isset($coupon->limit['users']['newbie']['order']) ? 'checked' : '' }}
+                                                   disabled />
                                             <label for="order">{{ trans('admin.coupon.newbie.first_order') }}</label>
                                         </div>
                                     </li>
                                     @isset($coupon->limit['users']['newbie']['days'])
                                         <li class="list-group-item p-0">
-                                            <span class="form-control text-fit">{!! trans('admin.coupon.created_days_hint', ['days' => $coupon->limit['users']['newbie']['days']])
-                                            !!}</span>
+                                            <span class="form-control text-fit">{!! trans('admin.coupon.created_days_hint', ['days' => $coupon->limit['users']['newbie']['days']]) !!}</span>
                                         </li>
                                     @endisset
                                 </ul>
@@ -205,11 +192,11 @@
                         <div class="input-group-prepend">
                             <span class="input-group-text"><i class="icon wb-calendar" aria-hidden="true"></i></span>
                         </div>
-                        <span class="form-control"> {{$coupon->start_time}} </span>
+                        <span class="form-control"> {{ $coupon->start_time }} </span>
                         <div class="input-group-prepend">
                             <span class="input-group-text">{{ trans('common.to') }}</span>
                         </div>
-                        <span class="form-control"> {{$coupon->end_time}} </span>
+                        <span class="form-control"> {{ $coupon->end_time }} </span>
                     </div>
                 </div>
             </div>
@@ -222,14 +209,14 @@
     <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-tokenfield.js"></script>
     <script>
-      $(document).ready(function() {
-          @isset($coupon->limit['users']['levels'])
-          $('#levels').selectpicker('val', @json($coupon->limit['users']['levels']));
-          @endisset
+        $(document).ready(function() {
+            @isset($coupon->limit['users']['levels'])
+                $('#levels').selectpicker('val', @json($coupon->limit['users']['levels']));
+            @endisset
 
-          @isset($coupon->limit['users']['groups'])
-          $('#groups').selectpicker('val', @json($coupon->limit['users']['groups']));
-          @endisset
-      });
+            @isset($coupon->limit['users']['groups'])
+                $('#groups').selectpicker('val', @json($coupon->limit['users']['groups']));
+            @endisset
+        });
     </script>
 @endsection

+ 40 - 44
resources/views/admin/logs/callback.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -13,52 +10,54 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="out_trade_no" value="{{Request::query('out_trade_no')}}" placeholder="本地订单号" autocomplete="off"/>
+                        <input class="form-control" name="out_trade_no" type="text" value="{{ Request::query('out_trade_no') }}" placeholder="本地订单号"
+                               autocomplete="off" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="trade_no" value="{{Request::query('trade_no')}}" placeholder="外部订单号" autocomplete="off"/>
+                        <input class="form-control" name="trade_no" type="text" value="{{ Request::query('trade_no') }}" placeholder="外部订单号"
+                               autocomplete="off" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="status" id="status" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="1">{{ trans('common.success') }}</option>
                             <option value="0">{{ trans('common.failed') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.payment.callback')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.payment.callback') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> 支付方式</th>
-                        <th> 平台订单号</th>
-                        <th> 本地订单号</th>
-                        <th> 交易金额</th>
-                        <th> {{trans('common.status.attribute')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($callbackLogs as $log)
                         <tr>
-                            <td> {{$log->id}} </td>
-                            <td> {{$log->type_label}} </td>
-                            <td> {{$log->trade_no}} </td>
-                            <td>
-                                @can('admin.order')
-                                    <a href="{{route('admin.order', ['sn' => $log->out_trade_no])}}" target="_blank"> {{$log->out_trade_no}} </a>
-                                @else
-                                    {{$log->out_trade_no}}
-                                @endcan
-                            </td>
-                            <td> {{$log->amount_tag}}</td>
-                            <td> {!! $log->trade_status_label !!} </td>
-                            <td> {{$log->created_at}} </td>
+                            <th> #</th>
+                            <th> 支付方式</th>
+                            <th> 平台订单号</th>
+                            <th> 本地订单号</th>
+                            <th> 交易金额</th>
+                            <th> {{ trans('common.status.attribute') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($callbackLogs as $log)
+                            <tr>
+                                <td> {{ $log->id }} </td>
+                                <td> {{ $log->type_label }} </td>
+                                <td> {{ $log->trade_no }} </td>
+                                <td>
+                                    @can('admin.order')
+                                        <a href="{{ route('admin.order', ['sn' => $log->out_trade_no]) }}" target="_blank"> {{ $log->out_trade_no }} </a>
+                                    @else
+                                        {{ $log->out_trade_no }}
+                                    @endcan
+                                </td>
+                                <td> {{ $log->amount_tag }}</td>
+                                <td> {!! $log->trade_status_label !!} </td>
+                                <td> {{ $log->created_at }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -69,21 +68,18 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$callbackLogs->links()}}
+                            {{ $callbackLogs->links() }}
                         </nav>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::query('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').selectpicker('val', @json(Request::query('status')));
+        });
     </script>
-@endsection
+@endpush

+ 43 - 47
resources/views/admin/logs/notification.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -11,53 +8,54 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-4">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" name="type" id="type" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('model.common.type') }}</option>
-                            @foreach(config('common.notification.labels') as $key => $value)
-                                <option value="{{$key}}">{{$value}}</option>
+                        <select class="form-control" id="type" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.common.type') }}">
+                            @foreach (config('common.notification.labels') as $key => $value)
+                                <option value="{{ $key }}">{{ $value }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-lg-1 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.notify')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.notify') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.common.type') }}</th>
-                        <th> {{ trans('model.notification.address') }}</th>
-                        <th> {{ trans('validation.attributes.title') }}</th>
-                        <th> {{ trans('validation.attributes.content') }}</th>
-                        <th> {{ trans('model.notification.created_at') }}</th>
-                        <th> {{ trans('model.notification.status') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($notificationLogs as $log)
                         <tr>
-                            <td> {{$log->id}} </td>
-                            <td> {{$log->type_label}} </td>
-                            <td> {{$log->address}} </td>
-                            <td> {{$log->title}} </td>
-                            <td class="text-break"> {{$log->content}} </td>
-                            <td> {{$log->created_at}} </td>
-                            <td>
-                                @if($log->status < 0)
-                                    <p class="badge badge-danger text-break font-size-14"> {{$log->error}} </p>
-                                @elseif($log->status > 0)
-                                    <labe class="badge badge-success">{{ trans('common.success') }}</labe>
-                                @else
-                                    <span class="badge badge-default"> {{ trans('common.status.waiting_tobe_send') }} </span>
-                                @endif
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.common.type') }}</th>
+                            <th> {{ trans('model.notification.address') }}</th>
+                            <th> {{ trans('validation.attributes.title') }}</th>
+                            <th> {{ trans('validation.attributes.content') }}</th>
+                            <th> {{ trans('model.notification.created_at') }}</th>
+                            <th> {{ trans('model.notification.status') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($notificationLogs as $log)
+                            <tr>
+                                <td> {{ $log->id }} </td>
+                                <td> {{ $log->type_label }} </td>
+                                <td> {{ $log->address }} </td>
+                                <td> {{ $log->title }} </td>
+                                <td class="text-break"> {{ $log->content }} </td>
+                                <td> {{ $log->created_at }} </td>
+                                <td>
+                                    @if ($log->status < 0)
+                                        <p class="badge badge-danger text-break font-size-14"> {{ $log->error }} </p>
+                                    @elseif($log->status > 0)
+                                        <labe class="badge badge-success">{{ trans('common.success') }}</labe>
+                                    @else
+                                        <span class="badge badge-default"> {{ trans('common.status.waiting_tobe_send') }} </span>
+                                    @endif
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -68,7 +66,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$notificationLogs->links()}}
+                            {{ $notificationLogs->links() }}
                         </nav>
                     </div>
                 </div>
@@ -76,12 +74,10 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#type').val({{Request::query('type')}});
-      });
+        $(document).ready(function() {
+            $('#type').selectpicker('val', @json(Request::query('type')));
+        });
     </script>
-@endsection
+@endpush

+ 48 - 54
resources/views/admin/logs/onlineIPMonitor.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -13,66 +10,65 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-2">
-                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}"
-                               placeholder="{{ trans('model.user.id') }}"/>
+                        <input class="form-control" name="id" type="number" value="{{ Request::query('id') }}" placeholder="{{ trans('model.user.id') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-5">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}"
-                               placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-5">
-                        <input type="text" class="form-control" name="ip" value="{{Request::query('ip')}}"
-                               placeholder="IP"/>
+                        <input class="form-control" name="ip" type="text" value="{{ Request::query('ip') }}" placeholder="IP" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-3">
-                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}"
-                               placeholder="{{ trans('model.user.port') }}"/>
+                        <input class="form-control" name="port" type="number" value="{{ Request::query('port') }}"
+                               placeholder="{{ trans('model.user.port') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-5">
-                        <select name="node_id" id="node_id" class="form-control" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('model.node.attribute') }}</option>
-                            @foreach($nodes as $node)
-                                <option value="{{$node->id}}">{{$node->name}}</option>
+                        <select class="form-control" id="node_id" name="node_id" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.node.attribute') }}">
+                            @foreach ($nodes as $node)
+                                <option value="{{ $node->id }}">{{ $node->name }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.online')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.online') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.ip.network_type') }}</th>
-                        <th> {{ trans('model.node.attribute') }}</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> IP</th>
-                        <th> {{ trans('model.ip.info') }}</th>
-                        <th> {{ trans('validation.attributes.time') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($onlineIPLogs as $log)
                         <tr>
-                            <td>{{$log->id}}</td>
-                            <td>{{$log->type}}</td>
-                            <td>{{$log->node->name ?? '【'.trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]).'】'}}</td>
-                            <td>{{$log->user->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('model.user.attribute')]).'】'.'$log->user_id'}} </td>
-                            <td>
-                                @if (str_contains($log->ip, ','))
-                                    @foreach (explode(',', $log->ip) as $ip)
-                                        <a href="https://db-ip.com/{{$ip}}" target="_blank">{{$ip}}</a>
-                                    @endforeach
-                                @else
-                                    <a href="https://db-ip.com/{{$log->ip}}" target="_blank">{{$log->ip}}</a>
-                                @endif
-                            </td>
-                            <td>{{$log->ipInfo?? ''}}</td>
-                            <td>{{date('Y-m-d H:i:s',$log->created_at)}}</td>
+                            <th> #</th>
+                            <th> {{ trans('model.ip.network_type') }}</th>
+                            <th> {{ trans('model.node.attribute') }}</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> IP</th>
+                            <th> {{ trans('model.ip.info') }}</th>
+                            <th> {{ trans('validation.attributes.time') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($onlineIPLogs as $log)
+                            <tr>
+                                <td>{{ $log->id }}</td>
+                                <td>{{ $log->type }}</td>
+                                <td>{{ $log->node->name ?? '【' . trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]) . '】' }}</td>
+                                <td>{{ $log->user->username ?? '【' . trans('common.deleted_item', ['attribute' => trans('model.user.attribute')]) . '】' . '$log->user_id' }}
+                                </td>
+                                <td>
+                                    @if (str_contains($log->ip, ','))
+                                        @foreach (explode(',', $log->ip) as $ip)
+                                            <a href="https://db-ip.com/{{ $ip }}" target="_blank">{{ $ip }}</a>
+                                        @endforeach
+                                    @else
+                                        <a href="https://db-ip.com/{{ $log->ip }}" target="_blank">{{ $log->ip }}</a>
+                                    @endif
+                                </td>
+                                <td>{{ $log->ipInfo ?? '' }}</td>
+                                <td>{{ date('Y-m-d H:i:s', $log->created_at) }}</td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -83,7 +79,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$onlineIPLogs->links()}}
+                            {{ $onlineIPLogs->links() }}
                         </nav>
                     </div>
                 </div>
@@ -91,12 +87,10 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#node_id').val({{Request::query('node_id')}});
-      });
+        $(document).ready(function() {
+            $('#node_id').selectpicker('val', @json(Request::query('node_id')));
+        });
     </script>
-@endsection
+@endpush

+ 122 - 119
resources/views/admin/logs/order.blade.php

@@ -1,7 +1,5 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-    <link href="/assets/global/vendor/bootstrap-select/bootstrap-select.min.css" rel="stylesheet">
+@extends('admin.table_layouts')
+@push('css')
     <link href="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet">
     <style>
         .table a {
@@ -9,7 +7,7 @@
             text-decoration: none;
         }
     </style>
-@endsection
+@endpush
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -19,40 +17,43 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="number" class="form-control" name="sn" value="{{Request::query('sn')}}" placeholder="{{ trans('model.order.id') }}"/>
+                        <input class="form-control" name="sn" type="number" value="{{ Request::query('sn') }}" placeholder="{{ trans('model.order.id') }}" />
                     </div>
                     <div class="form-group col-lg-6 col-sm-12">
                         <div class="input-group input-daterange" data-plugin="datepicker">
                             <div class="input-group-prepend">
                                 <span class="input-group-text"><i class="icon wb-calendar" aria-hidden="true"></i></span>
                             </div>
-                            <input type="text" class="form-control" name="start" value="{{Request::query('start')}}" autocomplete="off"/>
+                            <input class="form-control" name="start" type="text" value="{{ Request::query('start') }}" autocomplete="off" />
                             <div class="input-group-prepend">
                                 <span class="input-group-text">{{ trans('common.to') }}</span>
                             </div>
-                            <input type="text" class="form-control" name="end" value="{{Request::query('end')}}" autocomplete="off"/>
+                            <input class="form-control" name="end" type="text" value="{{ Request::query('end') }}" autocomplete="off" />
                         </div>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select data-plugin="selectpicker" class="form-control show-tick" name="is_expire" id="is_expire" data-style="btn-outline btn-primary" title="{{ trans('admin.logs.order.is_expired') }}">
+                        <select class="form-control show-tick" id="is_expire" name="is_expire" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('admin.logs.order.is_expired') }}">
                             <option value="0"> {{ trans('admin.no') }}</option>
                             <option value="1"> {{ trans('admin.yes') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select data-plugin="selectpicker" class="form-control show-tick" name="is_coupon" id="is_coupon" data-style="btn-outline btn-primary"
+                        <select class="form-control show-tick" id="is_coupon" name="is_coupon" data-plugin="selectpicker" data-style="btn-outline btn-primary"
                                 title="{{ trans('admin.logs.order.is_coupon') }}">
                             <option value="0"> {{ trans('admin.no') }}</option>
                             <option value="1"> {{ trans('admin.yes') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <select data-plugin="selectpicker" class="form-control show-tick" name="pay_way" id="pay_way" data-style="btn-outline byn-primary" title="{{ trans('model.order.pay_way') }}">
-                            @foreach(config('common.payment.labels') as $key => $value)
-                                <option value="{{$key}}">{{$key.' - '.$value}}</option>
+                        <select class="form-control show-tick" id="pay_way" name="pay_way" data-plugin="selectpicker" data-style="btn-outline byn-primary"
+                                title="{{ trans('model.order.pay_way') }}">
+                            @foreach (config('common.payment.labels') as $key => $value)
+                                <option value="{{ $key }}">{{ $key . ' - ' . $value }}</option>
                             @endforeach
                         </select>
                     </div>
@@ -69,86 +70,87 @@
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.order')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.order') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> @sortablelink('id', '#')</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> @sortablelink('sn', trans('model.order.id'))</th>
-                        <th> {{ trans('model.goods.attribute') }}</th>
-                        <th> {{ trans('model.coupon.attribute') }}</th>
-                        <th> {{ trans('model.order.original_price') }}</th>
-                        <th> {{ trans('model.order.price') }}</th>
-                        <th> {{ trans('model.order.pay_way') }}</th>
-                        <th> {{ trans('model.order.status') }}</th>
-                        <th> @sortablelink('expired_at', trans('common.expired_at'))</th>
-                        <th> @sortablelink('created_at', trans('common.created_at'))</th>
-                        @can(['admin.order.edit'])
-                            <th> {{ trans('common.action') }}</th>
-                        @endcan
-                    </tr>
+                        <tr>
+                            <th> @sortablelink('id', '#')</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> @sortablelink('sn', trans('model.order.id'))</th>
+                            <th> {{ trans('model.goods.attribute') }}</th>
+                            <th> {{ trans('model.coupon.attribute') }}</th>
+                            <th> {{ trans('model.order.original_price') }}</th>
+                            <th> {{ trans('model.order.price') }}</th>
+                            <th> {{ trans('model.order.pay_way') }}</th>
+                            <th> {{ trans('model.order.status') }}</th>
+                            <th> @sortablelink('expired_at', trans('common.expired_at'))</th>
+                            <th> @sortablelink('created_at', trans('common.created_at'))</th>
+                            @can(['admin.order.edit'])
+                                <th> {{ trans('common.action') }}</th>
+                            @endcan
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($orders as $order)
-                        <tr>
-                            <td> {{$order->id}} </td>
-                            <td>
-                                @if(empty($order->user) )
-                                    【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
-                                @else
-                                    @can('admin.user.index')
-                                        <a href="{{route('admin.user.index', ['id'=>$order->user->id])}}" target="_blank">{{$order->user->username}} </a>
+                        @foreach ($orders as $order)
+                            <tr>
+                                <td> {{ $order->id }} </td>
+                                <td>
+                                    @if (empty($order->user))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
                                     @else
-                                        {{$order->user->username}}
-                                    @endcan
-                                @endif
-                            </td>
-                            <td> {{$order->sn}}</td>
-                            <td> {{$order->goods->name  ?? trans('user.recharge_credit')}} </td>
-                            <td> {{$order->coupon ? $order->coupon->name . ' - ' . $order->coupon->sn : ''}} </td>
-                            <td> {{$order->origin_amount_tag}} </td>
-                            <td> {{$order->amount_tag}} </td>
-                            <td>
-                                {{$order->pay_way_label}}
-                            </td>
-                            <td>
-                                {!! $order->status_label !!}
-                            </td>
-                            <td> {{$order->is_expire ? trans('common.status.expire') : $order->expired_at}} </td>
-                            <td> {{$order->created_at}} </td>
-                            @can(['admin.order.edit'])
+                                        @can('admin.user.index')
+                                            <a href="{{ route('admin.user.index', ['id' => $order->user->id]) }}" target="_blank">{{ $order->user->username }} </a>
+                                        @else
+                                            {{ $order->user->username }}
+                                        @endcan
+                                    @endif
+                                </td>
+                                <td> {{ $order->sn }}</td>
+                                <td> {{ $order->goods->name ?? trans('user.recharge_credit') }} </td>
+                                <td> {{ $order->coupon ? $order->coupon->name . ' - ' . $order->coupon->sn : '' }} </td>
+                                <td> {{ $order->origin_amount_tag }} </td>
+                                <td> {{ $order->amount_tag }} </td>
                                 <td>
-                                    <button type="button" class="btn btn-primary dropdown-toggle" data-boundary="viewport" data-toggle="dropdown" aria-expanded="false">
-                                        <i class="icon wb-wrench" aria-hidden="true"></i>
-                                    </button>
-                                    <div class="dropdown-menu" role="menu">
-                                        @if ($order->status !== -1)
-                                            <a class="dropdown-item" href="javascript:changeStatus('{{$order->id}}', -1)" role="menuitem">
-                                                <i class="icon wb-close" aria-hidden="true"></i>
-                                                {{ trans('admin.set_to', ['attribute' => $order->statusTags(-1, 0, false)]) }}
-                                            </a>
-                                        @endif
-                                        @if ($order->status !== 2)
-                                            <a class="dropdown-item" href="javascript:changeStatus('{{$order->id}}', 2)" role="menuitem">
-                                                <i class="icon wb-check" aria-hidden="true"></i>
-                                                {{ trans('admin.set_to', ['attribute' => $order->statusTags(2, 0, false)]) }}
-                                            </a>
-                                        @endif
-                                        @if ($order->status !== 3)
-                                            <a class="dropdown-item" href="javascript:changeStatus('{{$order->id}}', 3)" role="menuitem">
-                                                <i class="icon wb-check-circle" aria-hidden="true"></i>
-                                                {{ trans('admin.set_to', ['attribute' => $order->statusTags(3, 0, false)]) }}
-                                            </a>
-                                        @endif
-                                    </div>
+                                    {{ $order->pay_way_label }}
                                 </td>
-                            @endcan
-                        </tr>
-                    @endforeach
+                                <td>
+                                    {!! $order->status_label !!}
+                                </td>
+                                <td> {{ $order->is_expire ? trans('common.status.expire') : $order->expired_at }} </td>
+                                <td> {{ $order->created_at }} </td>
+                                @can(['admin.order.edit'])
+                                    <td>
+                                        <button class="btn btn-primary dropdown-toggle" data-boundary="viewport" data-toggle="dropdown" type="button"
+                                                aria-expanded="false">
+                                            <i class="icon wb-wrench" aria-hidden="true"></i>
+                                        </button>
+                                        <div class="dropdown-menu" role="menu">
+                                            @if ($order->status !== -1)
+                                                <a class="dropdown-item" href="javascript:changeStatus('{{ $order->id }}', -1)" role="menuitem">
+                                                    <i class="icon wb-close" aria-hidden="true"></i>
+                                                    {{ trans('admin.set_to', ['attribute' => $order->statusTags(-1, 0, false)]) }}
+                                                </a>
+                                            @endif
+                                            @if ($order->status !== 2)
+                                                <a class="dropdown-item" href="javascript:changeStatus('{{ $order->id }}', 2)" role="menuitem">
+                                                    <i class="icon wb-check" aria-hidden="true"></i>
+                                                    {{ trans('admin.set_to', ['attribute' => $order->statusTags(2, 0, false)]) }}
+                                                </a>
+                                            @endif
+                                            @if ($order->status !== 3)
+                                                <a class="dropdown-item" href="javascript:changeStatus('{{ $order->id }}', 3)" role="menuitem">
+                                                    <i class="icon wb-check-circle" aria-hidden="true"></i>
+                                                    {{ trans('admin.set_to', ['attribute' => $order->statusTags(3, 0, false)]) }}
+                                                </a>
+                                            @endif
+                                        </div>
+                                    </td>
+                                @endcan
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -159,52 +161,53 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$orders->links()}}
+                            {{ $orders->links() }}
                         </nav>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js"></script>
+@push('javascript')
     <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
-    <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#is_coupon').selectpicker('val', @json(Request::query('is_coupon')));
-        $('#is_expire').selectpicker('val', @json(Request::query('is_expire')));
-        $('#pay_way').selectpicker('val', @json(Request::query('pay_way')));
-        $('#status').selectpicker('val', @json(Request::query('status')));
-        $('select').on('change', function() {
-          this.form.submit();
+        $(document).ready(function() {
+            $('#is_coupon').selectpicker('val', @json(Request::query('is_coupon')));
+            $('#is_expire').selectpicker('val', @json(Request::query('is_expire')));
+            $('#pay_way').selectpicker('val', @json(Request::query('pay_way')));
+            $('#status').selectpicker('val', @json(Request::query('status')));
         });
-      });
-
-      // 有效期
-      $('.input-daterange').datepicker({format: 'yyyy-mm-dd'});
 
-      @can('admin.order.edit')
-      // 重置流量
-      function changeStatus(id, status) {
-        $.post('{{route('admin.order.edit')}}', {_token: '{{csrf_token()}}', oid: id, status: status}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({
-              title: ret.message,
-              icon: 'success',
-              timer: 1000,
-              showConfirmButton: false,
-            }).then(() => window.location.reload());
-          } else {
-            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-          }
+        // 有效期
+        $('.input-daterange').datepicker({
+            format: 'yyyy-mm-dd'
         });
-      }
+
+        @can('admin.order.edit')
+            // 重置流量
+            function changeStatus(id, status) {
+                $.post('{{ route('admin.order.edit') }}', {
+                    _token: '{{ csrf_token() }}',
+                    oid: id,
+                    status: status
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.reload());
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        }).then(() => window.location.reload());
+                    }
+                });
+            }
         @endcan
     </script>
-@endsection
+@endpush

+ 58 - 59
resources/views/admin/logs/traffic.blade.php

@@ -1,8 +1,7 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
+@extends('admin.table_layouts')
+@push('css')
     <link href="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet">
-@endsection
+@endpush
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -12,19 +11,22 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-4">
-                        <input type="number" class="form-control" name="user_id" value="{{Request::query('user_id')}}" placeholder="{{ trans('model.user.id') }}"/>
+                        <input class="form-control" name="user_id" type="number" value="{{ Request::query('user_id') }}"
+                               placeholder="{{ trans('model.user.id') }}" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-8">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="{{ trans('model.user.port') }}"/>
+                        <input class="form-control" name="port" type="number" value="{{ Request::query('port') }}"
+                               placeholder="{{ trans('model.user.port') }}" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-8">
-                        <select class="form-control" name="node_id" id="node_id" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('admin.logs.user_traffic.choose_node') }}</option>
-                            @foreach($nodes as $node)
-                                <option value="{{$node->id}}">{{$node->name}}</option>
+                        <select class="form-control" id="node_id" name="node_id" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('admin.logs.user_traffic.choose_node') }}">
+                            @foreach ($nodes as $node)
+                                <option value="{{ $node->id }}">{{ $node->name }}</option>
                             @endforeach
                         </select>
                     </div>
@@ -35,54 +37,54 @@
                                     <i class="icon wb-calendar" aria-hidden="true"></i>
                                 </span>
                             </div>
-                            <input type="text" class="form-control" name="start" value="{{Request::query('start')}}" autocomplete="off"/>
+                            <input class="form-control" name="start" type="text" value="{{ Request::query('start') }}" autocomplete="off" />
                             <div class="input-group-prepend">
                                 <span class="input-group-text">{{ trans('common.to') }}</span>
                             </div>
-                            <input type="text" class="form-control" name="end" value="{{Request::query('end')}}" autocomplete="off"/>
+                            <input class="form-control" name="end" type="text" value="{{ Request::query('end') }}" autocomplete="off" />
                         </div>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.traffic')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.traffic') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> {{ trans('model.node.attribute') }}</th>
-                        <th> {{ trans('model.node.data_rate') }}</th>
-                        <th> {{ trans('model.user_traffic.upload') }}</th>
-                        <th> {{ trans('model.user_traffic.download') }}</th>
-                        <th> {{ trans('model.user_traffic.total') }}</th>
-                        <th> {{ trans('model.user_traffic.log_time') }}</th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> {{ trans('model.node.attribute') }}</th>
+                            <th> {{ trans('model.node.data_rate') }}</th>
+                            <th> {{ trans('model.user_traffic.upload') }}</th>
+                            <th> {{ trans('model.user_traffic.download') }}</th>
+                            <th> {{ trans('model.user_traffic.total') }}</th>
+                            <th> {{ trans('model.user_traffic.log_time') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($dataFlowLogs as $log)
-                        <tr>
-                            <td> {{$log->id}} </td>
-                            <td>
-                                @if(empty($log->user))
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    @can('admin.user.index')
-                                        <a href="{{route('admin.user.index', ['id' => $log->user->id])}}" target="_blank"> {{$log->user->username}} </a>
+                        @foreach ($dataFlowLogs as $log)
+                            <tr>
+                                <td> {{ $log->id }} </td>
+                                <td>
+                                    @if (empty($log->user))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
                                     @else
-                                        {{$log->user->username}}
-                                    @endcan
-                                @endif
-                            </td>
-                            <td> {{$log->node->name ?? '【'.trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]).'】'}} </td>
-                            <td> {{$log->rate}} </td>
-                            <td> {{$log->u}} </td>
-                            <td> {{$log->d}} </td>
-                            <td><span class="badge badge-danger"> {{$log->traffic}} </span></td>
-                            <td> {{$log->log_time}} </td>
-                        </tr>
-                    @endforeach
+                                        @can('admin.user.index')
+                                            <a href="{{ route('admin.user.index', ['id' => $log->user->id]) }}" target="_blank"> {{ $log->user->username }} </a>
+                                        @else
+                                            {{ $log->user->username }}
+                                        @endcan
+                                    @endif
+                                </td>
+                                <td> {{ $log->node->name ?? '【' . trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]) . '】' }} </td>
+                                <td> {{ $log->rate }} </td>
+                                <td> {{ $log->u }} </td>
+                                <td> {{ $log->d }} </td>
+                                <td><span class="badge badge-danger"> {{ $log->traffic }} </span></td>
+                                <td> {{ $log->log_time }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -90,31 +92,28 @@
                 <div class="row">
                     <div class="col-sm-6">
                         {!! trans('admin.logs.counts', ['num' => $dataFlowLogs->total()]) !!} |
-                        <code>{{$totalTraffic}}</code>
+                        <code>{{ $totalTraffic }}</code>
                     </div>
                     <div class="col-sm-6">
                         <nav class="Page navigation float-right">
-                            {{$dataFlowLogs->links()}}
+                            {{ $dataFlowLogs->links() }}
                         </nav>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $('.input-daterange').datepicker({
-        format: 'yyyy-mm-dd',
-      });
+        $('.input-daterange').datepicker({
+            format: 'yyyy-mm-dd',
+        });
 
-      $(document).ready(function() {
-        $('#node_id').val({{Request::query('node_id')}});
-      });
+        $(document).ready(function() {
+            $('#node_id').selectpicker('val', @json(Request::query('node_id')));
+        });
     </script>
-@endsection
+@endpush

+ 35 - 33
resources/views/admin/logs/userBanHistory.blade.php

@@ -11,47 +11,49 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.ban')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.ban') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> {{ trans('admin.logs.ban.time') }}</th>
-                        <th> {{ trans('admin.logs.ban.reason') }}</th>
-                        <th> {{ trans('admin.logs.ban.ban_time') }}</th>
-                        <th> {{ trans('admin.logs.ban.last_connect_at') }}</th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> {{ trans('admin.logs.ban.time') }}</th>
+                            <th> {{ trans('admin.logs.ban.reason') }}</th>
+                            <th> {{ trans('admin.logs.ban.ban_time') }}</th>
+                            <th> {{ trans('admin.logs.ban.last_connect_at') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($userBanLogs as $log)
-                        <tr>
-                            <td>
-                                {{$log->id}}
-                            </td>
-                            <td>
-                                @if ($log->user)
-                                    @can('admin.user.index')
-                                        <a href="{{route('admin.user.index', ['username'=>$log->user->username])}}" target="_blank"> {{$log->user->username}}</a>
+                        @foreach ($userBanLogs as $log)
+                            <tr>
+                                <td>
+                                    {{ $log->id }}
+                                </td>
+                                <td>
+                                    @if ($log->user)
+                                        @can('admin.user.index')
+                                            <a href="{{ route('admin.user.index', ['username' => $log->user->username]) }}" target="_blank">
+                                                {{ $log->user->username }}</a>
+                                        @else
+                                            {{ $log->user->username }}
+                                        @endcan
                                     @else
-                                        {{$log->user->username}}
-                                    @endcan
-                                @else
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @endif
-                            </td>
-                            <td> {{$log->time}} {{ trans('admin.minute') }}</td>
-                            <td> {{$log->description}} </td>
-                            <td> {{$log->created_at}} </td>
-                            <td> {{date('Y-m-d H:i:s', $log->user->t)}} </td>
-                        </tr>
-                    @endforeach
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
+                                    @endif
+                                </td>
+                                <td> {{ $log->time }} {{ trans('admin.minute') }}</td>
+                                <td> {{ $log->description }} </td>
+                                <td> {{ $log->created_at }} </td>
+                                <td> {{ date('Y-m-d H:i:s', $log->user->t) }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -62,7 +64,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$userBanLogs->links()}}
+                            {{ $userBanLogs->links() }}
                         </nav>
                     </div>
                 </div>

+ 33 - 32
resources/views/admin/logs/userCreditHistory.blade.php

@@ -11,45 +11,46 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.credit')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.credit') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> {{ trans('model.order.id') }}</th>
-                        <th> {{ trans('model.user_credit.before') }}</th>
-                        <th> {{ trans('model.user_credit.amount') }}</th>
-                        <th> {{ trans('model.user_credit.after') }}</th>
-                        <th> {{ trans('model.common.description') }}</th>
-                        <th> {{ trans('model.user_credit.created_at') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($userCreditLogs as $log)
                         <tr>
-                            <td> {{$log->id}} </td>
-                            <td>
-                                @if(empty($log->user))
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    <a href="{{route('admin.log.credit', ['username'=>$log->user->username])}}"> {{$log->user->username}} </a>
-                                @endif
-                            </td>
-                            <td> {{$log->order_id}} </td>
-                            <td> {{$log->before}} </td>
-                            <td> {{$log->amount}} </td>
-                            <td> {{$log->after}} </td>
-                            <td> {{$log->description}} </td>
-                            <td> {{$log->created_at}} </td>
+                            <th> #</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> {{ trans('model.order.id') }}</th>
+                            <th> {{ trans('model.user_credit.before') }}</th>
+                            <th> {{ trans('model.user_credit.amount') }}</th>
+                            <th> {{ trans('model.user_credit.after') }}</th>
+                            <th> {{ trans('model.common.description') }}</th>
+                            <th> {{ trans('model.user_credit.created_at') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($userCreditLogs as $log)
+                            <tr>
+                                <td> {{ $log->id }} </td>
+                                <td>
+                                    @if (empty($log->user))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
+                                    @else
+                                        <a href="{{ route('admin.log.credit', ['username' => $log->user->username]) }}"> {{ $log->user->username }} </a>
+                                    @endif
+                                </td>
+                                <td> {{ $log->order_id }} </td>
+                                <td> {{ $log->before }} </td>
+                                <td> {{ $log->amount }} </td>
+                                <td> {{ $log->after }} </td>
+                                <td> {{ $log->description }} </td>
+                                <td> {{ $log->created_at }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -60,7 +61,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$userCreditLogs->links()}}
+                            {{ $userCreditLogs->links() }}
                         </nav>
                     </div>
                 </div>

+ 66 - 67
resources/views/admin/logs/userMonitor.blade.php

@@ -7,18 +7,18 @@
             </div>
             <div class="alert alert-info alert-dismissible">
                 <button class="close" data-dismiss="alert" aria-label="{{ trans('common.close') }}">
-                    <span aria-hidden="true">&times;</span><span class="sr-only">{{trans('common.close')}}</span>
+                    <span aria-hidden="true">&times;</span><span class="sr-only">{{ trans('common.close') }}</span>
                 </button>
-                <h4 class="block">{{$username}}</h4>
+                <h4 class="block">{{ $username }}</h4>
                 {!! trans('admin.monitor.hint') !!}
             </div>
             <div class="panel-body">
                 <div class="row">
                     <div class="col-md-6">
-                        <canvas id="dailyChart" aria-label="{{ trans('admin.monitor.daily_chart') }}" role="img"></canvas>
+                        <canvas id="dailyChart" role="img" aria-label="{{ trans('admin.monitor.daily_chart') }}"></canvas>
                     </div>
                     <div class="col-md-6">
-                        <canvas id="monthlyChart" aria-label="{{ trans('admin.monitor.monthly_chart') }}" role="img"></canvas>
+                        <canvas id="monthlyChart" role="img" aria-label="{{ trans('admin.monitor.monthly_chart') }}"></canvas>
                     </div>
                 </div>
             </div>
@@ -28,74 +28,73 @@
 @section('javascript')
     <script src="/assets/global/vendor/chart-js/chart.min.js"></script>
     <script>
-      function common_options(tail) {
-        return {
-          responsive: true,
-          scales: {
-            x: {
-              ticks: {
-                callback: function(value) {
-                  return this.getLabelForValue(value) + ' ' + tail;
-                },
-              },
-              grid: {
-                display: false,
-              },
-            },
-            y: {
-              ticks: {
-                callback: function(value) {
-                  return this.getLabelForValue(value) + ' GB';
-                },
-              },
-              grid: {
-                display: false,
-              },
-              min: 0,
-            },
+        function common_options(tail) {
+            return {
+                responsive: true,
+                scales: {
+                    x: {
+                        ticks: {
+                            callback: function(value) {
+                                return this.getLabelForValue(value) + ' ' + tail;
+                            },
+                        },
+                        grid: {
+                            display: false,
+                        },
+                    },
+                    y: {
+                        ticks: {
+                            callback: function(value) {
+                                return this.getLabelForValue(value) + ' GB';
+                            },
+                        },
+                        grid: {
+                            display: false,
+                        },
+                        min: 0,
+                    },
 
-          },
-          plugins: {
-            legend: false,
-            tooltip: {
-              mode: 'index',
-              intersect: false,
-              callbacks: {
-                title: function(context) {
-                  return context[0].label + ' ' + tail;
                 },
-                label: function(context) {
-                  return context.parsed.y + ' GB';
+                plugins: {
+                    legend: false,
+                    tooltip: {
+                        mode: 'index',
+                        intersect: false,
+                        callbacks: {
+                            title: function(context) {
+                                return context[0].label + ' ' + tail;
+                            },
+                            label: function(context) {
+                                return context.parsed.y + ' GB';
+                            },
+                        },
+                    },
                 },
-              },
-            },
-          },
-        };
-      }
+            };
+        }
 
-      function datasets(label, data) {
-        return {
-          labels: label,
-          datasets: [
-            {
-              backgroundColor: 'rgba(184, 215, 255)',
-              borderColor: 'rgba(184, 215, 255)',
-              data: data,
-              tension: 0.4,
-            }],
-        };
-      }
+        function datasets(label, data) {
+            return {
+                labels: label,
+                datasets: [{
+                    backgroundColor: 'rgba(184, 215, 255)',
+                    borderColor: 'rgba(184, 215, 255)',
+                    data: data,
+                    tension: 0.4,
+                }],
+            };
+        }
 
-      new Chart(document.getElementById('dailyChart'), {
-        type: 'line',
-        data: datasets(@json($dayHours), @json($trafficHourly)),
-        options: common_options(@json(trans_choice('common.hour', 2))),
-      });
+        new Chart(document.getElementById('dailyChart'), {
+            type: 'line',
+            data: datasets(@json($dayHours), @json($trafficHourly)),
+            options: common_options(@json(trans_choice('common.hour', 2))),
+        });
 
-      new Chart(document.getElementById('monthlyChart'), {
-        type: 'line',
-        data: datasets(@json($monthDays), @json($trafficDaily)),
-        options: common_options(@json(trans_choice('common.days.attribute', 2))),
-      });
+        new Chart(document.getElementById('monthlyChart'), {
+            type: 'line',
+            data: datasets(@json($monthDays), @json($trafficDaily)),
+            options: common_options(@json(trans_choice('common.days.attribute', 2))),
+        });
     </script>
 @endsection

+ 69 - 65
resources/views/admin/logs/userOnlineIP.blade.php

@@ -13,86 +13,90 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-1 col-sm-4">
-                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="{{ trans('model.user.id') }}"/>
+                        <input class="form-control" name="id" type="number" value="{{ Request::query('id') }}" placeholder="{{ trans('model.user.id') }}" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-8">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="text" class="form-control" name="wechat" value="{{Request::query('wechat')}}" placeholder="{{ trans('model.user.wechat') }}"/>
+                        <input class="form-control" name="wechat" type="text" value="{{ Request::query('wechat') }}"
+                               placeholder="{{ trans('model.user.wechat') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6">
-                        <input type="number" class="form-control" name="qq" value="{{Request::query('qq')}}" placeholder="{{ trans('model.user.qq') }}"/>
+                        <input class="form-control" name="qq" type="number" value="{{ Request::query('qq') }}" placeholder="{{ trans('model.user.qq') }}" />
                     </div>
                     <div class="form-group col-lg-1 col-sm-6">
-                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="{{ trans('model.user.port') }}"/>
+                        <input class="form-control" name="port" type="number" value="{{ Request::query('port') }}"
+                               placeholder="{{ trans('model.user.port') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.ip')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.ip') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> {{ trans('model.user.port') }}</th>
-                        <th> {{ trans('model.user.account_status') }}</th>
-                        <th> {{ trans('model.user.proxy_status') }}</th>
-                        <th> {{ trans('admin.logs.user_ip.connect') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($userList as $user)
                         <tr>
-                            <td> {{$user->id}} </td>
-                            <td> {{$user->username}} </td>
-                            <td> {{$user->port}} </td>
-                            <td>
-                                @if ($user->status > 0)
-                                    <span class="badge badge-lg badge-success">{{ trans('common.status.normal') }}</span>
-                                @elseif ($user->status < 0)
-                                    <span class="badge badge-lg badge-danger">{{ trans('common.status.banned') }}</span>
-                                @else
-                                    <span class="badge badge-lg badge-default">{{ trans('common.status.inactive') }}</span>
-                                @endif
-                            </td>
-                            <td>
-                                @if ($user->enable)
-                                    <span class="badge badge-lg badge-success">{{ trans('common.status.enabled') }}</span>
-                                @else
-                                    <span class="badge badge-lg badge-danger">{{ trans('common.status.banned') }}</span>
-                                @endif
-                            </td>
-                            <td>
-                                @if($user->onlineIPList->isNotEmpty())
-                                    <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
-                                        <thead>
-                                        <tr>
-                                            <th> {{ trans('model.node.attribute') }}</th>
-                                            <th> {{ trans('model.ip.network_type') }}</th>
-                                            <th> IP</th>
-                                            <th> {{ trans('validation.attributes.time') }}</th>
-                                        </tr>
-                                        </thead>
-                                        <tbody>
-                                        @foreach($user->onlineIPList as $log)
-                                            <tr>
-                                                <td>{{$log->node->name ?? '【'.trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]).'】'}}</td>
-                                                <td>{{$log->type}}</td>
-                                                <td>
-                                                    <a href="https://db-ip.com/{{$log->ip}}" target="_blank">{{$log->ip}}</a>
-                                                </td>
-                                                <td>{{date('Y-m-d H:i:s', $log->created_at)}}</td>
-                                            </tr>
-                                        @endforeach
-                                        </tbody>
-                                    </table>
-                                @endif
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> {{ trans('model.user.port') }}</th>
+                            <th> {{ trans('model.user.account_status') }}</th>
+                            <th> {{ trans('model.user.proxy_status') }}</th>
+                            <th> {{ trans('admin.logs.user_ip.connect') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($userList as $user)
+                            <tr>
+                                <td> {{ $user->id }} </td>
+                                <td> {{ $user->username }} </td>
+                                <td> {{ $user->port }} </td>
+                                <td>
+                                    @if ($user->status > 0)
+                                        <span class="badge badge-lg badge-success">{{ trans('common.status.normal') }}</span>
+                                    @elseif ($user->status < 0)
+                                        <span class="badge badge-lg badge-danger">{{ trans('common.status.banned') }}</span>
+                                    @else
+                                        <span class="badge badge-lg badge-default">{{ trans('common.status.inactive') }}</span>
+                                    @endif
+                                </td>
+                                <td>
+                                    @if ($user->enable)
+                                        <span class="badge badge-lg badge-success">{{ trans('common.status.enabled') }}</span>
+                                    @else
+                                        <span class="badge badge-lg badge-danger">{{ trans('common.status.banned') }}</span>
+                                    @endif
+                                </td>
+                                <td>
+                                    @if ($user->onlineIPList->isNotEmpty())
+                                        <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
+                                            <thead>
+                                                <tr>
+                                                    <th> {{ trans('model.node.attribute') }}</th>
+                                                    <th> {{ trans('model.ip.network_type') }}</th>
+                                                    <th> IP</th>
+                                                    <th> {{ trans('validation.attributes.time') }}</th>
+                                                </tr>
+                                            </thead>
+                                            <tbody>
+                                                @foreach ($user->onlineIPList as $log)
+                                                    <tr>
+                                                        <td>{{ $log->node->name ?? '【' . trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]) . '】' }}
+                                                        </td>
+                                                        <td>{{ $log->type }}</td>
+                                                        <td>
+                                                            <a href="https://db-ip.com/{{ $log->ip }}" target="_blank">{{ $log->ip }}</a>
+                                                        </td>
+                                                        <td>{{ date('Y-m-d H:i:s', $log->created_at) }}</td>
+                                                    </tr>
+                                                @endforeach
+                                            </tbody>
+                                        </table>
+                                    @endif
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -103,7 +107,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$userList->links()}}
+                            {{ $userList->links() }}
                         </nav>
                     </div>
                 </div>

+ 40 - 39
resources/views/admin/logs/userTraffic.blade.php

@@ -11,55 +11,56 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-4 col-sm-6">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('common.account') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('common.account') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.log.flow')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.log.flow') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> {{ trans('model.order.attribute') }}</th>
-                        <th> {{ trans('model.user_data_modify.before') }}</th>
-                        <th> {{ trans('model.user_data_modify.after') }}</th>
-                        <th> {{ trans('model.common.description') }}</th>
-                        <th> {{ trans('model.user_data_modify.created_at') }}</th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> {{ trans('model.order.attribute') }}</th>
+                            <th> {{ trans('model.user_data_modify.before') }}</th>
+                            <th> {{ trans('model.user_data_modify.after') }}</th>
+                            <th> {{ trans('model.common.description') }}</th>
+                            <th> {{ trans('model.user_data_modify.created_at') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($userTrafficLogs as $log)
-                        <tr>
-                            <td> {{$log->id}} </td>
-                            <td>
-                                @if(empty($log->user))
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    <a href="{{route('admin.log.flow', ['username' => $log->user->username])}}"> {{$log->user->username}} </a>
-                                @endif
-                            </td>
-                            <td>
-                                @if ($log->order_id)
-                                    @if($log->order)
-                                        @can('admin.order')
-                                            <a href="{{route('admin.order', ['id' => $log->order_id])}}"></a>
-                                        @else
-                                            {{$log->order->goods->name}}
-                                        @endcan
+                        @foreach ($userTrafficLogs as $log)
+                            <tr>
+                                <td> {{ $log->id }} </td>
+                                <td>
+                                    @if (empty($log->user))
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
                                     @else
-                                        【{{ trans('common.deleted_item', ['attribute' => trans('model.order.attribute')]) }}】
+                                        <a href="{{ route('admin.log.flow', ['username' => $log->user->username]) }}"> {{ $log->user->username }} </a>
                                     @endif
-                                @endif
-                            </td>
-                            <td> {{ $log->before }} </td>
-                            <td> {{ $log->after }} </td>
-                            <td> {{ $log->description }} </td>
-                            <td> {{ $log->created_at }} </td>
-                        </tr>
-                    @endforeach
+                                </td>
+                                <td>
+                                    @if ($log->order_id)
+                                        @if ($log->order)
+                                            @can('admin.order')
+                                                <a href="{{ route('admin.order', ['id' => $log->order_id]) }}"></a>
+                                            @else
+                                                {{ $log->order->goods->name }}
+                                            @endcan
+                                        @else
+                                            【{{ trans('common.deleted_item', ['attribute' => trans('model.order.attribute')]) }}】
+                                        @endif
+                                    @endif
+                                </td>
+                                <td> {{ $log->before }} </td>
+                                <td> {{ $log->after }} </td>
+                                <td> {{ $log->description }} </td>
+                                <td> {{ $log->created_at }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>

+ 33 - 38
resources/views/admin/marketing/emailList.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -15,40 +12,40 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <select class="form-control" name="status" id="status" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="0">{{ trans('common.to_be_send') }}</option>
                             <option value="-1">{{ trans('common.failed') }}</option>
                             <option value="1">{{ trans('common.success') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-3 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.marketing.email')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.marketing.email') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('validation.attributes.title') }}</th>
-                        <th> {{ trans('validation.attributes.content') }}</th>
-                        <th> {{ trans('admin.marketing.send_status') }}</th>
-                        <th> {{ trans('admin.marketing.send_time') }}</th>
-                        <th> {{ trans('admin.marketing.error_message') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($emails as $email)
                         <tr>
-                            <td> {{$email->id}} </td>
-                            <td> {{$email->title}} </td>
-                            <td> {{$email->content}} </td>
-                            <td> {{$email->status_label}} </td>
-                            <td> {{$email->created_at}} </td>
-                            <td> {{$email->error}} </td>
+                            <th> #</th>
+                            <th> {{ trans('validation.attributes.title') }}</th>
+                            <th> {{ trans('validation.attributes.content') }}</th>
+                            <th> {{ trans('admin.marketing.send_status') }}</th>
+                            <th> {{ trans('admin.marketing.send_time') }}</th>
+                            <th> {{ trans('admin.marketing.error_message') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($emails as $email)
+                            <tr>
+                                <td> {{ $email->id }} </td>
+                                <td> {{ $email->title }} </td>
+                                <td> {{ $email->content }} </td>
+                                <td> {{ $email->status_label }} </td>
+                                <td> {{ $email->created_at }} </td>
+                                <td> {{ $email->error }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -59,7 +56,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$emails->links()}}
+                            {{ $emails->links() }}
                         </nav>
                     </div>
                 </div>
@@ -67,17 +64,15 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::query('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').selectpicker('val', @json(Request::query('status')));
+        });
 
-      // 发送邮件
-      function send() {
-        swal.fire(@json(trans('common.sorry')), '{{ trans('common.developing') }}', 'info');
-      }
+        // 发送邮件
+        function send() {
+            swal.fire(@json(trans('common.sorry')), '{{ trans('common.developing') }}', 'info');
+        }
     </script>
-@endsection
+@endpush

+ 82 - 83
resources/views/admin/marketing/pushList.blade.php

@@ -1,8 +1,7 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
+@extends('admin.table_layouts')
+@push('css')
     <link href="/assets/global/vendor/bootstrap-markdown/bootstrap-markdown.min.css" rel="stylesheet">
-@endsection
+@endpush
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -10,7 +9,7 @@
                 <h3 class="panel-title">{{ trans('admin.marketing.push.title') }}</h3>
                 @can('admin.marketing.add')
                     <div class="panel-actions">
-                        <button type="button" class="btn btn-primary disabled" data-toggle="modal" data-target="#send_modal">
+                        <button class="btn btn-primary disabled" data-toggle="modal" data-target="#send_modal" type="button">
                             <i class="icon wb-plus"></i>{{ trans('admin.marketing.push.send') }}</button>
                     </div>
                 @endcan
@@ -18,45 +17,45 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <select class="form-control" name="status" id="status">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="0">{{ trans('common.to_be_send') }}</option>
                             <option value="-1">{{ trans('common.failed') }}</option>
                             <option value="1">{{ trans('common.success') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.marketing.push')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.marketing.push') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
-                {{--                <div class="alert alert-info alert-dismissible" role="alert">--}}
-                {{--                    <button type="button" class="close" data-dismiss="alert" aria-label="{{ trans('common.close') }}">--}}
-                {{--                        <span aria-hidden="true">×</span></button>--}}
-                {{--                    仅会推送给关注了您的消息通道的用户 @can('admin.system.index')<a href="{{route('admin.system.index')}}" class="alert-link" target="_blank">设置PushBear</a> @else 设置PushBear @endcan--}}
-                {{--                </div>--}}
+                {{--                <div class="alert alert-info alert-dismissible" role="alert"> --}}
+                {{--                    <button type="button" class="close" data-dismiss="alert" aria-label="{{ trans('common.close') }}"> --}}
+                {{--                        <span aria-hidden="true">×</span></button> --}}
+                {{--                    仅会推送给关注了您的消息通道的用户 @can('admin.system.index')<a href="{{route('admin.system.index')}}" class="alert-link" target="_blank">设置PushBear</a> @else 设置PushBear @endcan --}}
+                {{--                </div> --}}
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('validation.attributes.title') }}</th>
-                        <th> {{ trans('validation.attributes.content') }}</th>
-                        <th> {{ trans('admin.marketing.send_status') }}</th>
-                        <th> {{ trans('admin.marketing.send_time') }}</th>
-                        <th> {{ trans('admin.marketing.error_message') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($pushes as $push)
                         <tr>
-                            <td> {{$push->id}} </td>
-                            <td> {{$push->title}} </td>
-                            <td> {{$push->content}} </td>
-                            <td> {{$push->status_label}} </td>
-                            <td> {{$push->created_at}} </td>
-                            <td> {{$push->error}} </td>
+                            <th> #</th>
+                            <th> {{ trans('validation.attributes.title') }}</th>
+                            <th> {{ trans('validation.attributes.content') }}</th>
+                            <th> {{ trans('admin.marketing.send_status') }}</th>
+                            <th> {{ trans('admin.marketing.send_time') }}</th>
+                            <th> {{ trans('admin.marketing.error_message') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($pushes as $push)
+                            <tr>
+                                <td> {{ $push->id }} </td>
+                                <td> {{ $push->title }} </td>
+                                <td> {{ $push->content }} </td>
+                                <td> {{ $push->status_label }} </td>
+                                <td> {{ $push->created_at }} </td>
+                                <td> {{ $push->error }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -67,7 +66,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$pushes->links()}}
+                            {{ $pushes->links() }}
                         </nav>
                     </div>
                 </div>
@@ -77,33 +76,32 @@
 
     @can('admin.marketing.add')
         <!-- 推送消息 -->
-        <div id="send_modal" class="modal fade" tabindex="-1" data-focus-on="input:first" data-backdrop="static"
-             data-keyboard="false">
+        <div class="modal fade" id="send_modal" data-focus-on="input:first" data-backdrop="static" data-keyboard="false" tabindex="-1">
             <div class="modal-dialog modal-lg modal-center">
                 <div class="modal-content">
                     <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                        <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                             <span aria-hidden="true">×</span>
                         </button>
                         <h4 class="modal-title">{{ trans('admin.marketing.push.send') }}</h4>
                     </div>
                     <div class="modal-body">
-                        <div class="alert alert-danger" style="display: none;" id="msg"></div>
-                        <form action="#" method="post" class="form-horizontal">
+                        <div class="alert alert-danger" id="msg" style="display: none;"></div>
+                        <form class="form-horizontal" action="#" method="post">
                             <div class="form-body">
                                 <div class="form-group">
                                     <div class="row">
-                                        <label for="title" class="col-md-2 control-label"> {{ trans('validation.attributes.title') }} </label>
+                                        <label class="col-md-2 control-label" for="title"> {{ trans('validation.attributes.title') }} </label>
                                         <div class="col-md-6">
-                                            <input type="text" class="form-control" name="title" id="title"/>
+                                            <input class="form-control" id="title" name="title" type="text" />
                                         </div>
                                     </div>
                                 </div>
                                 <div class="form-group">
                                     <div class="row">
-                                        <label for="content" class="col-md-2 control-label"> {{ trans('validation.attributes.content') }} </label>
+                                        <label class="col-md-2 control-label" for="content"> {{ trans('validation.attributes.content') }} </label>
                                         <div class="col-md-9">
-                                            <textarea class="form-control" rows="10" name="content" id="content" data-provide="markdown" data-iconlibrary="fa"></textarea>
+                                            <textarea class="form-control" id="content" name="content" data-provide="markdown" data-iconlibrary="fa" rows="10"></textarea>
                                         </div>
                                     </div>
                                 </div>
@@ -112,60 +110,61 @@
                     </div>
                     <div class="modal-footer">
                         <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.cancel') }}</button>
-                        <button type="button" class="btn btn-primary disabled" onclick="return send();">{{ trans('common.send') }}</button>
+                        <button class="btn btn-primary disabled" type="button" onclick="return send();">{{ trans('common.send') }}</button>
                     </div>
                 </div>
             </div>
         </div>
     @endcan
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script src="/assets/global/vendor/bootstrap-markdown/bootstrap-markdown.min.js"></script>
     <script src="/assets/global/vendor/marked/marked.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::query('status')}});
-      });
+        $(document).ready(function() {
+            $('#status').selectpicker('val', @json(Request::query('status')));
+        });
 
-      @can('admin.marketing.add')
-      // 发送通道消息
-      function send() {
-        const title = $('#title').val();
+        @can('admin.marketing.add')
+            // 发送通道消息
+            function send() {
+                const title = $('#title').val();
 
-        if (title.trim() === '') {
-          $('#msg').show().html('{{ trans('validation.filled', ['attribute' => trans('validation.attributes.title')]) }}');
-          title.focus();
-          return false;
-        }
+                if (title.trim() === '') {
+                    $('#msg').show().html('{{ trans('validation.filled', ['attribute' => trans('validation.attributes.title')]) }}');
+                    title.focus();
+                    return false;
+                }
 
-        $.ajax({
-          url: '{{route('admin.marketing.add')}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', title: title, content: $('#content').val()},
-          beforeSend: function() {
-            $('#msg').show().html('{{ trans('admin.creating') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#msg').show().html(ret.message);
-              return false;
+                $.ajax({
+                    url: '{{ route('admin.marketing.add') }}',
+                    method: 'POST',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        title: title,
+                        content: $('#content').val()
+                    },
+                    beforeSend: function() {
+                        $('#msg').show().html('{{ trans('admin.creating') }}');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#msg').show().html(ret.message);
+                            return false;
+                        }
+                        $('#send_modal').modal('hide');
+                    },
+                    error: function() {
+                        $('#msg').show().html('{{ trans('common.request_failed') }}');
+                    },
+                    complete: function() {},
+                });
             }
-            $('#send_modal').modal('hide');
-          },
-          error: function() {
-            $('#msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-          },
-        });
-      }
 
-      // 关闭modal触发
-      $('#send_modal').on('hide.bs.modal', function() {
-        window.location.reload();
-      });
+            // 关闭modal触发
+            $('#send_modal').on('hide.bs.modal', function() {
+                window.location.reload();
+            });
         @endcan
     </script>
-@endsection
+@endpush

+ 165 - 149
resources/views/admin/node/auth.blade.php

@@ -18,44 +18,44 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> {{ trans('model.node.id') }}</th>
-                        <th> {{ trans('model.common.type') }}</th>
-                        <th> {{ trans('model.node.name') }}</th>
-                        <th> {{ trans('model.node.domain') }}</th>
-                        <th> {!! trans('model.node_auth.key') !!}</th>
-                        <th> {{ trans('model.node_auth.secret') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
+                        <tr>
+                            <th> {{ trans('model.node.id') }}</th>
+                            <th> {{ trans('model.common.type') }}</th>
+                            <th> {{ trans('model.node.name') }}</th>
+                            <th> {{ trans('model.node.domain') }}</th>
+                            <th> {!! trans('model.node_auth.key') !!}</th>
+                            <th> {{ trans('model.node_auth.secret') }}</th>
+                            <th> {{ trans('common.action') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach ($authorizations as $auth)
-                        <tr>
-                            <td> {{$auth->node_id}} </td>
-                            <td> {{$auth->node->type_label}} </td>
-                            <td> {{Str::limit($auth->node->name, 20)}} </td>
-                            <td> {{$auth->node->server ?? $auth->node->ip ?? $auth->node->ipv6}} </td>
-                            <td><span class="badge badge-lg badge-info"> {{$auth->key}} </span></td>
-                            <td><span class="badge badge-lg badge-info"> {{$auth->secret}} </span></td>
-                            <td>
-                                <div class="btn-group">
-                                    <button data-target="#install_{{$auth->node->type}}_{{$auth->id}}" data-toggle="modal" class="btn btn-primary">
-                                        <i class="icon wb-code" aria-hidden="true"></i> {{ trans('admin.node.auth.deploy.attribute') }}
-                                    </button>
-                                    @can('admin.node.auth.update')
-                                        <button onclick="refreshAuth('{{$auth->id}}')" class="btn btn-danger">
-                                            <i class="icon wb-reload" aria-hidden="true"></i> {{ trans('admin.node.auth.reset_auth') }}
+                        @foreach ($authorizations as $auth)
+                            <tr>
+                                <td> {{ $auth->node_id }} </td>
+                                <td> {{ $auth->node->type_label }} </td>
+                                <td> {{ Str::limit($auth->node->name, 20) }} </td>
+                                <td> {{ $auth->node->server ?? ($auth->node->ip ?? $auth->node->ipv6) }} </td>
+                                <td><span class="badge badge-lg badge-info"> {{ $auth->key }} </span></td>
+                                <td><span class="badge badge-lg badge-info"> {{ $auth->secret }} </span></td>
+                                <td>
+                                    <div class="btn-group">
+                                        <button class="btn btn-primary" data-target="#install_{{ $auth->node->type }}_{{ $auth->id }}" data-toggle="modal">
+                                            <i class="icon wb-code" aria-hidden="true"></i> {{ trans('admin.node.auth.deploy.attribute') }}
                                         </button>
-                                    @endcan
-                                    @can('admin.node.auth.destroy')
-                                        <button onclick="deleteAuth('{{$auth->id}}')" class="btn btn-primary">
-                                            <i class="icon wb-trash" aria-hidden="true"></i> {{ trans('common.delete') }}
-                                        </button>
-                                    @endcan
-                                </div>
-                            </td>
-                        </tr>
-                    @endforeach
+                                        @can('admin.node.auth.update')
+                                            <button class="btn btn-danger" onclick="refreshAuth('{{ $auth->id }}')">
+                                                <i class="icon wb-reload" aria-hidden="true"></i> {{ trans('admin.node.auth.reset_auth') }}
+                                            </button>
+                                        @endcan
+                                        @can('admin.node.auth.destroy')
+                                            <button class="btn btn-primary" onclick="deleteAuth('{{ $auth->id }}')">
+                                                <i class="icon wb-trash" aria-hidden="true"></i> {{ trans('common.delete') }}
+                                            </button>
+                                        @endcan
+                                    </div>
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -74,12 +74,12 @@
         </div>
     </div>
 
-    @foreach($authorizations as $auth)
-        <div id="install_{{$auth->node->type}}_{{$auth->id}}" class="modal fade" tabindex="-1" data-focus-on="input:first" data-keyboard="false">
+    @foreach ($authorizations as $auth)
+        <div class="modal fade" id="install_{{ $auth->node->type }}_{{ $auth->id }}" data-focus-on="input:first" data-keyboard="false" tabindex="-1">
             <div class="modal-dialog modal-simple modal-center modal-lg">
                 <div class="modal-content">
                     <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                        <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                             <span aria-hidden="true">×</span>
                         </button>
                         <h4 class="modal-title">
@@ -87,14 +87,15 @@
                         </h4>
                     </div>
                     <div class="modal-body">
-                        @if($auth->node->type === 2)
+                        @if ($auth->node->type === 2)
                             <div class="alert alert-info text-break">
                                 <div class="text-center red-700 mb-5">VNET-V2Ray</div>
-                                (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
+                                (yum install curl 2> /dev/null || apt install curl 2> /dev/null)
+                                \<br>
                                 && curl -L -s https://bit.ly/3oO3HZy \<br>
-                                | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>
-                                NODE_ID={{$auth->node->id}} \<br>
-                                NODE_KEY={{$auth->key}} \<br>
+                                | WEB_API="{{ sysConfig('web_api_url') ?: sysConfig('website_url') }}" \<br>
+                                NODE_ID={{ $auth->node->id }} \<br>
+                                NODE_KEY={{ $auth->key }} \<br>
                                 bash
                                 <br>
                                 <br>
@@ -119,9 +120,9 @@
                                 <div class="text-center red-700 mb-5">V2Ray-Poseidon</div>
                                 (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
                                 && curl -L -s https://bit.ly/2HswWko \<br>
-                                | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>
-                                NODE_ID={{$auth->node->id}} \<br>
-                                NODE_KEY={{$auth->key}} \<br>
+                                | WEB_API="{{ sysConfig('web_api_url') ?: sysConfig('website_url') }}" \<br>
+                                NODE_ID={{ $auth->node->id }} \<br>
+                                NODE_KEY={{ $auth->key }} \<br>
                                 bash
                                 <br>
                                 <br>
@@ -142,7 +143,7 @@
                                 {{ trans('admin.node.auth.deploy.real_time_logs') }}: journalctl -u v2ray -f
                             </div>
                         @elseif($auth->node->type === 3)
-                            @if(!$auth->node->server)
+                            @if (!$auth->node->server)
                                 <h3>
                                     {!! trans('admin.node.auth.deploy.trojan_hint', ['url' => route('admin.node.edit', $auth->node)]) !!}
                                 </h3>
@@ -151,10 +152,10 @@
                                     <div class="text-center red-700 mb-5">Trojan-Poseidon</div>
                                     (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
                                     && curl -L -s https://mrw.so/6cMfGy \<br>
-                                    | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>
-                                    NODE_ID={{$auth->node->id}} \<br>
-                                    NODE_KEY={{$auth->key}} \<br>
-                                    NODE_HOST={{$auth->node->server}} \<br>
+                                    | WEB_API="{{ sysConfig('web_api_url') ?: sysConfig('website_url') }}" \<br>
+                                    NODE_ID={{ $auth->node->id }} \<br>
+                                    NODE_KEY={{ $auth->key }} \<br>
+                                    NODE_HOST={{ $auth->node->server }} \<br>
                                     bash
                                     <br>
                                     <br>
@@ -182,9 +183,9 @@
                                 <div class="text-center red-700 mb-5">VNET</div>
                                 (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
                                 && curl -L -s https://bit.ly/3828OP1 \<br>
-                                | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>
-                                NODE_ID={{$auth->node->id}} \<br>
-                                NODE_KEY={{$auth->key}} \<br>
+                                | WEB_API="{{ sysConfig('web_api_url') ?: sysConfig('website_url') }}" \<br>
+                                NODE_ID={{ $auth->node->id }} \<br>
+                                NODE_KEY={{ $auth->key }} \<br>
                                 bash
                                 <br>
                                 <br>
@@ -219,104 +220,119 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      // 生成授权KEY
-      @can('admin.node.auth.store')
-      function addAuth() {
-        swal.fire({
-          title: '{{ trans('admin.hint') }}',
-          text: '{{ trans('admin.node.auth.generating_all') }}',
-          icon: 'info',
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('admin.node.auth.store')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
+        // 生成授权KEY
+        @can('admin.node.auth.store')
+            function addAuth() {
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            });
-          }
-        });
-      }
-      @endcan
+                    title: '{{ trans('admin.hint') }}',
+                    text: '{{ trans('admin.node.auth.generating_all') }}',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.post('{{ route('admin.node.auth.store') }}', {
+                            _token: '{{ csrf_token() }}'
+                        }, function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                }).then(() => window.location.reload());
+                            }
+                        });
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.node.auth.destroy')
-      // 删除授权
-      function deleteAuth(id) {
-        swal.fire({
-          title: '{{ trans('admin.hint') }}',
-          text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node_auth.attribute')]) }}' + id +
-              '{{ trans('admin.confirm.delete.1') }}',
-          icon: 'info',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: '{{route('admin.node.auth.destroy', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          }
-        });
-      }
-      @endcan
+        @can('admin.node.auth.destroy')
+            // 删除授权
+            function deleteAuth(id) {
+                swal.fire({
+                    title: '{{ trans('admin.hint') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node_auth.attribute')]) }}' + id +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.node.auth.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.node.auth.update')
-      // 重置授权认证KEY
-      function refreshAuth(id) {
-        swal.fire({
-          title: '{{ trans('admin.hint') }}',
-          text: '{{ trans('admin.confirm.continues') }}',
-          icon: 'info',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'PUT',
-              url: '{{route('admin.node.auth.update', '')}}/' + id,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          }
-        });
-      }
+        @can('admin.node.auth.update')
+            // 重置授权认证KEY
+            function refreshAuth(id) {
+                swal.fire({
+                    title: '{{ trans('admin.hint') }}',
+                    text: '{{ trans('admin.confirm.continues') }}',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'PUT',
+                            url: '{{ route('admin.node.auth.update', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
 @endsection

+ 75 - 70
resources/views/admin/node/cert/index.blade.php

@@ -9,7 +9,7 @@
                 <h2 class="panel-title">{!! trans('admin.node.cert.title') !!}</h2>
                 @can('admin.node.cert.create')
                     <div class="panel-actions">
-                        <a href="{{route('admin.node.cert.create')}}" class="btn btn-primary">
+                        <a class="btn btn-primary" href="{{ route('admin.node.cert.create') }}">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -18,45 +18,45 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.node_cert.domain') }}</th>
-                        <th> {{ trans('model.node_cert.key') }}</th>
-                        <th> {{ trans('model.node_cert.pem') }}</th>
-                        <th> {{ trans('model.node_cert.issuer') }}</th>
-                        <th> {{ trans('model.node_cert.signed_date') }}</th>
-                        <th> {{ trans('model.node_cert.expired_date') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($certs as $cert)
                         <tr>
-                            <td> {{$cert->id}} </td>
-                            <td> {{$cert->domain}} </td>
-                            <td> {{$cert->key ? '✔️' : '❌'}} </td>
-                            <td> {{$cert->pem ? '✔️' : '❌'}} </td>
-                            <td> {{$cert->issuer}} </td>
-                            <td> {{$cert->from}} </td>
-                            <td> {{$cert->to}} </td>
-                            <td>
-                                @canany(['admin.node.cert.edit', 'admin.node.cert.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.node.cert.edit')
-                                            <a href="{{route('admin.node.cert.edit', $cert)}}" class="btn btn-primary">
-                                                <i class="icon wb-edit" aria-hidden="true"></i>
-                                            </a>
-                                        @endcan
-                                        @can('admin.node.cert.destroy')
-                                            <button onclick="delCertificate('{{$cert->id}}')" class="btn btn-danger">
-                                                <i class="icon wb-trash" aria-hidden="true"></i>
-                                            </button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.node_cert.domain') }}</th>
+                            <th> {{ trans('model.node_cert.key') }}</th>
+                            <th> {{ trans('model.node_cert.pem') }}</th>
+                            <th> {{ trans('model.node_cert.issuer') }}</th>
+                            <th> {{ trans('model.node_cert.signed_date') }}</th>
+                            <th> {{ trans('model.node_cert.expired_date') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($certs as $cert)
+                            <tr>
+                                <td> {{ $cert->id }} </td>
+                                <td> {{ $cert->domain }} </td>
+                                <td> {{ $cert->key ? '✔️' : '❌' }} </td>
+                                <td> {{ $cert->pem ? '✔️' : '❌' }} </td>
+                                <td> {{ $cert->issuer }} </td>
+                                <td> {{ $cert->from }} </td>
+                                <td> {{ $cert->to }} </td>
+                                <td>
+                                    @canany(['admin.node.cert.edit', 'admin.node.cert.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.node.cert.edit')
+                                                <a class="btn btn-primary" href="{{ route('admin.node.cert.edit', $cert) }}">
+                                                    <i class="icon wb-edit" aria-hidden="true"></i>
+                                                </a>
+                                            @endcan
+                                            @can('admin.node.cert.destroy')
+                                                <button class="btn btn-danger" onclick="delCertificate('{{ $cert->id }}')">
+                                                    <i class="icon wb-trash" aria-hidden="true"></i>
+                                                </button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -67,7 +67,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$certs->links()}}
+                            {{ $certs->links() }}
                         </nav>
                     </div>
                 </div>
@@ -80,39 +80,44 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.node.cert.destroy')
         <script>
-          // 删除授权
-          function delCertificate(id) {
-            swal.fire({
-              title: '{{ trans('admin.hint') }}',
-              text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node_cert.attribute')]) }}' + id +
-                  '{{ trans('admin.confirm.delete.1') }}',
-              icon: 'info',
-              showCancelButton: true,
-              cancelButtonText: '{{ trans('common.close') }}',
-              confirmButtonText: '{{ trans('common.confirm') }}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: '{{route('admin.node.cert.destroy', '')}}/' + id,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({
-                        title: ret.message,
-                        icon: 'success',
-                        timer: 1000,
-                        showConfirmButton: false,
-                      }).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除授权
+            function delCertificate(id) {
+                swal.fire({
+                    title: '{{ trans('admin.hint') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.node_cert.attribute')]) }}' + id +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: '{{ route('admin.node.cert.destroy', '') }}/' + id,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 24 - 25
resources/views/admin/node/cert/info.blade.php

@@ -7,44 +7,43 @@
                     {{ isset($cert) ? trans('admin.action.edit_item', ['attribute' => trans('model.node_cert.attribute')]) : trans('admin.action.add_item', ['attribute' => trans('model.node_cert.attribute')]) }}
                 </h2>
                 <div class="panel-actions">
-                    <a href="{{route('admin.node.cert.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.node.cert.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="@isset($cert) {{route('admin.node.cert.update', $cert)}} @else {{route('admin.node.cert.store')}} @endisset"
-                      method="POST" enctype="multipart/form-data" class="form-horizontal">
+                <form class="form-horizontal"
+                      action="@isset($cert) {{ route('admin.node.cert.update', $cert) }} @else {{ route('admin.node.cert.store') }} @endisset"
+                      method="POST" enctype="multipart/form-data">
                     @isset($cert)
                         @method('PUT')
                     @endisset
                     @csrf
                     <div class="form-group row">
-                        <label for="domain" class="col-md-3 col-form-label">{{ trans('model.node_cert.domain') }}</label>
+                        <label class="col-md-3 col-form-label" for="domain">{{ trans('model.node_cert.domain') }}</label>
                         <div class="col-md-9">
-                            <input type="text" class="form-control" name="domain" id="domain" required>
+                            <input class="form-control" id="domain" name="domain" type="text" required>
                         </div>
                     </div>
                     <div class="form-group row">
-                        <label for="key" class="col-md-3 col-form-label">{{ trans('model.node_cert.key') }}</label>
+                        <label class="col-md-3 col-form-label" for="key">{{ trans('model.node_cert.key') }}</label>
                         <div class="col-md-9">
-                            <textarea type="text" rows="10" class="form-control" name="key" id="key"
-                                      placeholder="{{ trans('admin.node.cert.key_placeholder') }}"></textarea>
+                            <textarea class="form-control" id="key" name="key" type="text" rows="10" placeholder="{{ trans('admin.node.cert.key_placeholder') }}"></textarea>
                         </div>
                     </div>
                     <div class="form-group row">
-                        <label for="pem" class="col-md-3 col-form-label">{{ trans('model.node_cert.pem') }}</label>
+                        <label class="col-md-3 col-form-label" for="pem">{{ trans('model.node_cert.pem') }}</label>
                         <div class="col-md-9">
-                            <textarea type="text" rows="10" class="form-control" name="pem" id="pem"
-                                      placeholder="{{ trans('admin.node.cert.pem_placeholder') }}"></textarea>
+                            <textarea class="form-control" id="pem" name="pem" type="text" rows="10" placeholder="{{ trans('admin.node.cert.pem_placeholder') }}"></textarea>
                         </div>
                     </div>
                     <div class="form-actions">
-                        <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                     </div>
                 </form>
             </div>
@@ -53,15 +52,15 @@
 @endsection
 @section('javascript')
     <script>
-      $(document).ready(function() {
-        $('#domain').val(@json(old('domain')));
-        $('#key').val(@json(old('key')));
-        $('#pem').val(@json(old('pem')));
-          @isset($cert)
-          $('#domain').val(@json(old('domain') ?? $cert->domain));
-        $('#key').val(@json(old('key') ?? $cert->key));
-        $('#pem').val(@json(old('pem') ?? $cert->pem));
-          @endisset
-      });
+        $(document).ready(function() {
+            $('#domain').val(@json(old('domain')));
+            $('#key').val(@json(old('key')));
+            $('#pem').val(@json(old('pem')));
+            @isset($cert)
+                $('#domain').val(@json(old('domain') ?? $cert->domain));
+                $('#key').val(@json(old('key') ?? $cert->key));
+                $('#pem').val(@json(old('pem') ?? $cert->pem));
+            @endisset
+        });
     </script>
 @endsection

+ 455 - 432
resources/views/admin/node/info.blade.php

@@ -19,7 +19,7 @@
             <div class="alert alert-info" role="alert">
                 <button class="close" data-dismiss="alert" aria-label="{{ trans('common.close') }}">
                     <span aria-hidden="true">&times;</span>
-                    <span class="sr-only">{{trans('common.close')}}</span>
+                    <span class="sr-only">{{ trans('common.close') }}</span>
                 </button>
                 {!! trans('admin.node.info.hint') !!}
             </div>
@@ -31,110 +31,114 @@
                                 <h4 class="example-title">{{ trans('admin.node.info.basic') }}</h4>
                                 <div class="example">
                                     <div class="form-group row">
-                                        <label for="is_ddns" class="col-md-3 col-form-label">{{ trans('model.node.ddns') }}</label>
+                                        <label class="col-md-3 col-form-label" for="is_ddns">{{ trans('model.node.ddns') }}</label>
                                         <div class="col-md-9">
-                                            <input type="checkbox" id="is_ddns" name="is_ddns" data-plugin="switchery" onchange="switchSetting('is_ddns')">
+                                            <input id="is_ddns" name="is_ddns" data-plugin="switchery" type="checkbox" onchange="switchSetting('is_ddns')">
                                         </div>
                                         <div class="text-help offset-md-3">
                                             {!! trans('admin.node.info.ddns_hint') !!}
                                         </div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="name" class="col-md-3 col-form-label"> {{ trans('model.node.name') }} </label>
-                                        <input type="text" class="form-control col-md-4" name="name" id="name" required>
+                                        <label class="col-md-3 col-form-label" for="name"> {{ trans('model.node.name') }} </label>
+                                        <input class="form-control col-md-4" id="name" name="name" type="text" required>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="server" class="col-md-3 col-form-label"> {{ trans('model.node.domain') }} </label>
-                                        <input type="text" class="form-control col-md-4" name="server" id="server" placeholder="{{ trans('admin.node.info.domain_placeholder') }}">
+                                        <label class="col-md-3 col-form-label" for="server"> {{ trans('model.node.domain') }} </label>
+                                        <input class="form-control col-md-4" id="server" name="server" type="text"
+                                               placeholder="{{ trans('admin.node.info.domain_placeholder') }}">
                                         <span class="text-help offset-md-3">{{ trans('admin.node.info.domain_hint') }}</span>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="ip" class="col-md-3 col-form-label"> {{ trans('model.node.ipv4') }} </label>
-                                        <input type="text" class="form-control col-md-4" name="ip" id="ip" placeholder="{{ trans('admin.node.info.ipv4_placeholder') }}" required>
+                                        <label class="col-md-3 col-form-label" for="ip"> {{ trans('model.node.ipv4') }} </label>
+                                        <input class="form-control col-md-4" id="ip" name="ip" type="text"
+                                               placeholder="{{ trans('admin.node.info.ipv4_placeholder') }}" required>
                                         <span class="text-help offset-md-3">{{ trans('admin.node.info.ipv4_hint') }}</span>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="ipv6" class="col-md-3 col-form-label"> {{ trans('model.node.ipv6') }} </label>
-                                        <input type="text" class="form-control col-md-4" name="ipv6" id="ipv6" placeholder="{{ trans('admin.node.info.ipv6_placeholder') }}">
+                                        <label class="col-md-3 col-form-label" for="ipv6"> {{ trans('model.node.ipv6') }} </label>
+                                        <input class="form-control col-md-4" id="ipv6" name="ipv6" type="text"
+                                               placeholder="{{ trans('admin.node.info.ipv6_placeholder') }}">
                                         <span class="text-help offset-md-3">{{ trans('admin.node.info.ipv6_hint') }}</span>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="push_port" class="col-md-3 col-form-label"> {{ trans('model.node.push_port') }} </label>
-                                        <input type="number" class="form-control col-md-4" name="push_port" value="1080" id="push_port">
+                                        <label class="col-md-3 col-form-label" for="push_port"> {{ trans('model.node.push_port') }} </label>
+                                        <input class="form-control col-md-4" id="push_port" name="push_port" type="number" value="1080">
                                         <span class="text-help offset-md-3">{{ trans('admin.node.info.push_port_hint') }}</span>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="traffic_rate" class="col-md-3 col-form-label"> {{ trans('model.node.data_rate') }} </label>
-                                        <input type="number" class="form-control col-md-4" name="traffic_rate" value="1.0" id="traffic_rate" step="0.01" required>
+                                        <label class="col-md-3 col-form-label" for="traffic_rate"> {{ trans('model.node.data_rate') }} </label>
+                                        <input class="form-control col-md-4" id="traffic_rate" name="traffic_rate" type="number" value="1.0" step="0.01"
+                                               required>
                                         <div class="text-help offset-md-3">{{ trans('admin.node.info.data_rate_hint') }}</div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="level" class="col-md-3 col-form-label">{{ trans('model.common.level') }}</label>
-                                        <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control show-tick" id="level" name="level">
-                                            @foreach($levels as $level)
-                                                <option value="{{$level->level}}">{{$level->name}}</option>
+                                        <label class="col-md-3 col-form-label" for="level">{{ trans('model.common.level') }}</label>
+                                        <select class="col-md-5 form-control show-tick" id="level" name="level" data-plugin="selectpicker"
+                                                data-style="btn-outline btn-primary">
+                                            @foreach ($levels as $level)
+                                                <option value="{{ $level->level }}">{{ $level->name }}</option>
                                             @endforeach
                                         </select>
                                         <div class="text-help offset-md-3"> {{ trans('admin.node.info.level_hint') }}</div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="ruleGroup" class="col-md-3 col-form-label">{{ trans('model.node.rule_group') }}</label>
-                                        <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control show-tick"
-                                                id="ruleGroup" name="ruleGroup">
-                                            <option value="">{{ trans('common.none') }}</option>
-                                            @foreach($ruleGroups as $ruleGroup)
-                                                <option value="{{$ruleGroup->id}}">{{$ruleGroup->name}}</option>
+                                        <label class="col-md-3 col-form-label" for="ruleGroup">{{ trans('model.node.rule_group') }}</label>
+                                        <select class="col-md-5 form-control show-tick" id="ruleGroup" name="ruleGroup" data-plugin="selectpicker"
+                                                data-style="btn-outline btn-primary" title="{{ trans('common.none') }}">
+                                            @foreach ($ruleGroups as $ruleGroup)
+                                                <option value="{{ $ruleGroup->id }}">{{ $ruleGroup->name }}</option>
                                             @endforeach
                                         </select>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="speed_limit" class="col-md-3 col-form-label">{{ trans('model.node.traffic_limit') }}</label>
+                                        <label class="col-md-3 col-form-label" for="speed_limit">{{ trans('model.node.traffic_limit') }}</label>
                                         <div class="col-md-4 input-group p-0">
-                                            <input type="number" class="form-control" id="speed_limit" name="speed_limit" value="1000" required>
+                                            <input class="form-control" id="speed_limit" name="speed_limit" type="number" value="1000" required>
                                             <span class="input-group-text">Mbps</span>
                                         </div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="client_limit" class="col-md-3 col-form-label">{{ trans('model.node.client_limit') }}</label>
-                                        <input type="number" class="form-control col-md-4" id="client_limit" name="client_limit" value="1000" required>
+                                        <label class="col-md-3 col-form-label" for="client_limit">{{ trans('model.node.client_limit') }}</label>
+                                        <input class="form-control col-md-4" id="client_limit" name="client_limit" type="number" value="1000" required>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="labels" class="col-md-3 col-form-label">{{ trans('model.node.label') }}</label>
-                                        <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control show-tick" id="labels" name="labels"
-                                                multiple>
-                                            @foreach($labels as $label)
-                                                <option value="{{$label->id}}">{{$label->name}}</option>
+                                        <label class="col-md-3 col-form-label" for="labels">{{ trans('model.node.label') }}</label>
+                                        <select class="col-md-5 form-control show-tick" id="labels" name="labels" data-plugin="selectpicker"
+                                                data-style="btn-outline btn-primary" multiple>
+                                            @foreach ($labels as $label)
+                                                <option value="{{ $label->id }}">{{ $label->name }}</option>
                                             @endforeach
                                         </select>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="country_code" class="col-md-3 col-form-label"> {{ trans('model.node.country') }} </label>
-                                        <select data-plugin="selectpicker" data-style="btn-outline btn-primary"
-                                                class="col-md-5 form-control" name="country_code" id="country_code">
-                                            @foreach($countries as $country)
-                                                <option value="{{$country->code}}">{{ $country->code.' - '.$country->name }}</option>
+                                        <label class="col-md-3 col-form-label" for="country_code"> {{ trans('model.node.country') }} </label>
+                                        <select class="col-md-5 form-control" id="country_code" name="country_code" data-plugin="selectpicker"
+                                                data-style="btn-outline btn-primary">
+                                            @foreach ($countries as $country)
+                                                <option value="{{ $country->code }}">{{ $country->code . ' - ' . $country->name }}</option>
                                             @endforeach
                                         </select>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="description" class="col-md-3 col-form-label"> {{ trans('model.common.description') }} </label>
-                                        <input type="text" class="form-control col-md-6" name="description" id="description">
+                                        <label class="col-md-3 col-form-label" for="description"> {{ trans('model.common.description') }} </label>
+                                        <input class="form-control col-md-6" id="description" name="description" type="text">
                                     </div>
                                     <div class="form-group row">
-                                        <label for="sort" class="col-md-3 col-form-label">{{ trans('model.common.sort') }}</label>
-                                        <input type="text" class="form-control col-md-4" name="sort" id="sort" value="1" required/>
+                                        <label class="col-md-3 col-form-label" for="sort">{{ trans('model.common.sort') }}</label>
+                                        <input class="form-control col-md-4" id="sort" name="sort" type="text" value="1" required />
                                         <div class="text-help offset-md-3"> {{ trans('admin.sort_asc') }}</div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="is_udp" class="col-md-3 col-form-label">{{ trans('model.node.udp') }}</label>
+                                        <label class="col-md-3 col-form-label" for="is_udp">{{ trans('model.node.udp') }}</label>
                                         <div class="col-md-9">
-                                            <input type="checkbox" id="is_udp" name="is_udp" data-plugin="switchery">
+                                            <input id="is_udp" name="is_udp" data-plugin="switchery" type="checkbox">
                                         </div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="status" class="col-md-3 col-form-label">{{ trans('common.status.attribute') }}</label>
+                                        <label class="col-md-3 col-form-label" for="status">{{ trans('common.status.attribute') }}</label>
                                         <div class="col-md-9">
-                                            <input type="checkbox" id="status" name="status" data-plugin="switchery">
+                                            <input id="status" name="status" data-plugin="switchery" type="checkbox">
                                         </div>
                                     </div>
                                 </div>
@@ -145,29 +149,29 @@
                                 <h4 class="example-title">{{ trans('admin.node.info.extend') }}</h4>
                                 <div class="example">
                                     <div class="form-group row">
-                                        <label for="is_display" class="col-md-3 col-form-label">{{ trans('model.node.display') }}</label>
+                                        <label class="col-md-3 col-form-label" for="is_display">{{ trans('model.node.display') }}</label>
                                         <ul class="col-md-9 list-unstyled list-inline">
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="invisible" name="is_display" value="0" checked/>
+                                                    <input id="invisible" name="is_display" type="radio" value="0" checked />
                                                     <label for="invisible">{{ trans('admin.node.info.display.invisible') }}</label>
                                                 </div>
                                             </li>
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="page_only" name="is_display" value="1"/>
+                                                    <input id="page_only" name="is_display" type="radio" value="1" />
                                                     <label for="page_only">{{ trans('admin.node.info.display.node') }}</label>
                                                 </div>
                                             </li>
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="sub_only" name="is_display" value="2"/>
+                                                    <input id="sub_only" name="is_display" type="radio" value="2" />
                                                     <label for="sub_only">{{ trans('admin.node.info.display.sub') }}</label>
                                                 </div>
                                             </li>
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="visible" name="is_display" value="3" checked/>
+                                                    <input id="visible" name="is_display" type="radio" value="3" checked />
                                                     <label for="visible">{{ trans('admin.node.info.display.all') }}</label>
                                                 </div>
                                             </li>
@@ -175,29 +179,29 @@
                                         <div class="text-help offset-md-3"> {{ trans('admin.node.info.display.hint') }}</div>
                                     </div>
                                     <div class="form-group row">
-                                        <label for="detection_type" class="col-md-3 col-form-label">{{ trans('model.node.detection') }}</label>
+                                        <label class="col-md-3 col-form-label" for="detection_type">{{ trans('model.node.detection') }}</label>
                                         <ul class="col-md-9 list-unstyled list-inline">
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="detect_disable" name="detection_type" value="0" checked/>
+                                                    <input id="detect_disable" name="detection_type" type="radio" value="0" checked />
                                                     <label for="detect_disable">{{ trans('common.close') }}</label>
                                                 </div>
                                             </li>
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="detect_tcp" name="detection_type" value="1"/>
+                                                    <input id="detect_tcp" name="detection_type" type="radio" value="1" />
                                                     <label for="detect_tcp">{{ trans('admin.node.info.detection.tcp') }}</label>
                                                 </div>
                                             </li>
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="detect_icmp" name="detection_type" value="2"/>
+                                                    <input id="detect_icmp" name="detection_type" type="radio" value="2" />
                                                     <label for="detect_icmp">{{ trans('admin.node.info.detection.icmp') }}</label>
                                                 </div>
                                             </li>
                                             <li class="list-inline-item">
                                                 <div class="radio-custom radio-primary">
-                                                    <input type="radio" id="detect_all" name="detection_type" value="3"/>
+                                                    <input id="detect_all" name="detection_type" type="radio" value="3" />
                                                     <label for="detect_all">{{ trans('admin.node.info.detection.all') }}</label>
                                                 </div>
                                             </li>
@@ -206,91 +210,94 @@
                                     </div>
                                     <!-- 中转 设置部分 -->
                                     <div class="form-group row">
-                                        <label for="relay_node_id" class="col-md-3 col-form-label">{{ trans('model.node.transfer') }}</label>
-                                        <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control show-tick"
-                                                id="relay_node_id" name="relay_node_id">
-                                            <option value="">{{ trans('common.none') }}</option>
-                                            @foreach($nodes as $name => $id)
-                                                <option value="{{$id}}">{{$id}} - {{$name}}</option>
+                                        <label class="col-md-3 col-form-label" for="relay_node_id">{{ trans('model.node.transfer') }}</label>
+                                        <select class="col-md-5 form-control show-tick" id="relay_node_id" name="relay_node_id" data-plugin="selectpicker"
+                                                data-style="btn-outline btn-primary" title="{{ trans('common.none') }}">
+                                            @foreach ($nodes as $name => $id)
+                                                <option value="{{ $id }}">{{ $id }} - {{ $name }}</option>
                                             @endforeach
                                         </select>
                                     </div>
-                                    <hr/>
+                                    <hr />
                                     <!-- 代理 设置部分 -->
                                     <div class="proxy-config">
                                         <div class="form-group row">
-                                            <label for="type" class="col-md-3 col-form-label">{{ trans('model.common.type') }}</label>
+                                            <label class="col-md-3 col-form-label" for="type">{{ trans('model.common.type') }}</label>
                                             <ul class="col-md-9 list-unstyled list-inline">
                                                 <li class="list-inline-item">
                                                     <div class="radio-custom radio-primary">
-                                                        <input type="radio" id="shadowsocks" name="type" value="0">
+                                                        <input id="shadowsocks" name="type" type="radio" value="0">
                                                         <label for="shadowsocks">Shadowsocks</label>
                                                     </div>
                                                 </li>
                                                 <li class="list-inline-item">
                                                     <div class="radio-custom radio-primary">
-                                                        <input type="radio" id="shadowsocksR" name="type" value="1">
+                                                        <input id="shadowsocksR" name="type" type="radio" value="1">
                                                         <label for="shadowsocksR">ShadowsocksR</label>
                                                     </div>
                                                 </li>
                                                 <li class="list-inline-item">
                                                     <div class="radio-custom radio-primary">
-                                                        <input type="radio" id="v2ray" name="type" value="2">
+                                                        <input id="v2ray" name="type" type="radio" value="2">
                                                         <label for="v2ray">V2Ray</label>
                                                     </div>
                                                 </li>
                                                 <li class="list-inline-item">
                                                     <div class="radio-custom radio-primary">
-                                                        <input type="radio" id="trojan" name="type" value="3">
+                                                        <input id="trojan" name="type" type="radio" value="3">
                                                         <label for="trojan">Trojan</label>
                                                     </div>
                                                 </li>
                                                 <li class="list-inline-item">
                                                     <div class="radio-custom radio-primary">
-                                                        <input type="radio" id="vnet" name="type" value="4">
+                                                        <input id="vnet" name="type" type="radio" value="4">
                                                         <label for="vnet">VNET</label>
                                                     </div>
                                                 </li>
                                             </ul>
                                         </div>
-                                        <hr/>
+                                        <hr />
                                         <!-- SS/SSR 设置部分 -->
                                         <div class="ss-setting">
                                             <div class="form-group row">
-                                                <label for="method" class="col-md-3 col-form-label">{{ trans('model.node.method') }}</label>
-                                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control" name="method" id="method">
+                                                <label class="col-md-3 col-form-label" for="method">{{ trans('model.node.method') }}</label>
+                                                <select class="col-md-5 form-control" id="method" name="method" data-plugin="selectpicker"
+                                                        data-style="btn-outline btn-primary">
                                                     @foreach (Helpers::methodList() as $method)
-                                                        <option value="{{$method->name}}" @if(!isset($node) && $method->is_default) selected @endif>{{$method->name}}</option>
+                                                        <option value="{{ $method->name }}" @if (!isset($node) && $method->is_default) selected @endif>{{ $method->name }}
+                                                        </option>
                                                     @endforeach
                                                 </select>
                                             </div>
                                             <div class="ssr-setting">
                                                 <div class="form-group row">
-                                                    <label for="protocol" class="col-md-3 col-form-label">{{ trans('model.node.protocol') }}</label>
-                                                    <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control" name="protocol"
-                                                            id="protocol">
+                                                    <label class="col-md-3 col-form-label" for="protocol">{{ trans('model.node.protocol') }}</label>
+                                                    <select class="col-md-5 form-control" id="protocol" name="protocol" data-plugin="selectpicker"
+                                                            data-style="btn-outline btn-primary">
                                                         @foreach (Helpers::protocolList() as $protocol)
-                                                            <option value="{{$protocol->name}}"
-                                                                    @if(!isset($node) && $protocol->is_default) selected @endif>{{$protocol->name}}</option>
+                                                            <option value="{{ $protocol->name }}" @if (!isset($node) && $protocol->is_default) selected @endif>
+                                                                {{ $protocol->name }}</option>
                                                         @endforeach
                                                     </select>
                                                 </div>
                                                 <div class="form-group row">
-                                                    <label for="protocol_param" class="col-md-3 col-form-label"> {{ trans('model.node.protocol_param') }} </label>
-                                                    <input type="text" class="form-control col-md-4" name="protocol_param" id="protocol_param">
+                                                    <label class="col-md-3 col-form-label" for="protocol_param"> {{ trans('model.node.protocol_param') }}
+                                                    </label>
+                                                    <input class="form-control col-md-4" id="protocol_param" name="protocol_param" type="text">
                                                 </div>
                                                 <div class="form-group row">
-                                                    <label for="obfs" class="col-md-3 col-form-label">{{ trans('model.node.obfs') }}</label>
-                                                    <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control" name="obfs" id="obfs">
+                                                    <label class="col-md-3 col-form-label" for="obfs">{{ trans('model.node.obfs') }}</label>
+                                                    <select class="col-md-5 form-control" id="obfs" name="obfs" data-plugin="selectpicker"
+                                                            data-style="btn-outline btn-primary">
                                                         @foreach (Helpers::obfsList() as $obfs)
-                                                            <option value="{{$obfs->name}}" @if(!isset($node) && $obfs->is_default) selected @endif>{{$obfs->name}}</option>
+                                                            <option value="{{ $obfs->name }}" @if (!isset($node) && $obfs->is_default) selected @endif>
+                                                                {{ $obfs->name }}</option>
                                                         @endforeach
                                                     </select>
                                                 </div>
                                                 <div class="form-group row obfs_param">
-                                                    <label for="obfs_param" class="col-md-3 col-form-label"> {{ trans('model.node.obfs_param') }} </label>
-                                                    <textarea class="form-control col-md-8" rows="5" name="obfs_param" id="obfs_param"
-                                                              placeholder="{!! trans('admin.node.info.obfs_param_hint') !!}"></textarea>
+                                                    <label class="col-md-3 col-form-label" for="obfs_param"> {{ trans('model.node.obfs_param') }} </label>
+                                                    <textarea class="form-control col-md-8" id="obfs_param" name="obfs_param" rows="5" placeholder="{!! trans('admin.node.info.obfs_param_hint') !!}"></textarea>
                                                 </div>
                                                 <div class="form-group row">
                                                     <label class="col-md-3 col-form-label">{{ trans('admin.node.proxy_info') }}</label>
@@ -299,11 +306,12 @@
                                                     </div>
                                                 </div>
                                             </div>
-                                            <hr/>
+                                            <hr />
                                             <div class="form-group row">
-                                                <label for="single" class="col-md-3 col-form-label">{{ trans('model.node.single') }}</label>
+                                                <label class="col-md-3 col-form-label" for="single">{{ trans('model.node.single') }}</label>
                                                 <div class="col-md-9">
-                                                    <input type="checkbox" id="single" name="single" data-plugin="switchery" onchange="switchSetting('single')">
+                                                    <input id="single" name="single" data-plugin="switchery" type="checkbox"
+                                                           onchange="switchSetting('single')">
                                                 </div>
                                                 <div class="text-help offset-md-3">
                                                     {!! trans('admin.node.info.additional_ports_hint') !!}
@@ -311,13 +319,14 @@
                                             </div>
                                             <div class="single-setting">
                                                 <div class="form-group row">
-                                                    <label for="single_port" class="col-md-3 col-form-label">{{ trans('model.node.service_port') }}</label>
-                                                    <input type="number" class="form-control col-md-4" name="port" id="single_port" value="443" hidden/>
+                                                    <label class="col-md-3 col-form-label" for="single_port">{{ trans('model.node.service_port') }}</label>
+                                                    <input class="form-control col-md-4" id="single_port" name="port" type="number" value="443"
+                                                           hidden />
                                                     <span class="text-help offset-md-3"> {!! trans('admin.node.info.single_hint') !!}</span>
                                                 </div>
                                                 <div class="form-group row ssr-setting">
-                                                    <label for="passwd" class="col-md-3 col-form-label">{{ trans('model.node.single_passwd') }}</label>
-                                                    <input type="text" class="form-control col-md-4" name="passwd" id="passwd"
+                                                    <label class="col-md-3 col-form-label" for="passwd">{{ trans('model.node.single_passwd') }}</label>
+                                                    <input class="form-control col-md-4" id="passwd" name="passwd" type="text"
                                                            placeholder="{{ trans('validation.attributes.password') }}">
                                                 </div>
                                             </div>
@@ -325,16 +334,17 @@
                                         <!-- V2ray 设置部分 -->
                                         <div class="v2ray-setting">
                                             <div class="form-group row">
-                                                <label for="v2_alter_id" class="col-md-3 col-form-label">{{ trans('model.node.v2_alter_id') }}</label>
-                                                <input type="text" class="form-control col-md-4" name="v2_alter_id" value="16" id="v2_alter_id"/>
+                                                <label class="col-md-3 col-form-label" for="v2_alter_id">{{ trans('model.node.v2_alter_id') }}</label>
+                                                <input class="form-control col-md-4" id="v2_alter_id" name="v2_alter_id" type="text" value="16" />
                                             </div>
                                             <div class="form-group row">
-                                                <label for="v2_port" class="col-md-3 col-form-label">{{ trans('model.node.service_port') }}</label>
-                                                <input type="number" class="form-control col-md-4" name="port" id="v2_port" value="10053" hidden/>
+                                                <label class="col-md-3 col-form-label" for="v2_port">{{ trans('model.node.service_port') }}</label>
+                                                <input class="form-control col-md-4" id="v2_port" name="port" type="number" value="10053" hidden />
                                             </div>
                                             <div class="form-group row">
-                                                <label for="v2_method" class="col-md-3 col-form-label">{{ trans('model.node.method') }}</label>
-                                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control" id="v2_method">
+                                                <label class="col-md-3 col-form-label" for="v2_method">{{ trans('model.node.method') }}</label>
+                                                <select class="col-md-5 form-control" id="v2_method" data-plugin="selectpicker"
+                                                        data-style="btn-outline btn-primary">
                                                     <option value="none">none</option>
                                                     <option value="auto">auto</option>
                                                     <option value="aes-128-cfb">aes-128-cfb</option>
@@ -344,8 +354,9 @@
                                                 <div class="text-help offset-md-3"> {{ trans('admin.node.info.v2_method_hint') }}</div>
                                             </div>
                                             <div class="form-group row">
-                                                <label for="v2_net" class="col-md-3 col-form-label">{{ trans('model.node.v2_net') }}</label>
-                                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control" id="v2_net">
+                                                <label class="col-md-3 col-form-label" for="v2_net">{{ trans('model.node.v2_net') }}</label>
+                                                <select class="col-md-5 form-control" id="v2_net" data-plugin="selectpicker"
+                                                        data-style="btn-outline btn-primary">
                                                     <option value="tcp">TCP</option>
                                                     <option value="http">HTTP/2</option>
                                                     <option value="ws">WebSocket</option>
@@ -356,8 +367,9 @@
                                                 <div class="text-help offset-md-3"> {{ trans('admin.node.info.v2_net_hint') }}</div>
                                             </div>
                                             <div class="form-group row v2_type">
-                                                <label for="v2_type" class="col-md-3 col-form-label">{{ trans('model.node.v2_cover') }}</label>
-                                                <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="col-md-5 form-control" id="v2_type">
+                                                <label class="col-md-3 col-form-label" for="v2_type">{{ trans('model.node.v2_cover') }}</label>
+                                                <select class="col-md-5 form-control" id="v2_type" data-plugin="selectpicker"
+                                                        data-style="btn-outline btn-primary">
                                                     <option value="none">{{ trans('admin.node.info.v2_cover.none') }}</option>
                                                     <option value="http">{{ trans('admin.node.info.v2_cover.http') }}</option>
                                                     <optgroup id="type_option" label="">
@@ -370,33 +382,35 @@
                                                 </select>
                                             </div>
                                             <div class="form-group row v2_host">
-                                                <label for="v2_host" class="col-md-3 col-form-label">{{ trans('model.node.v2_host') }}</label>
+                                                <label class="col-md-3 col-form-label" for="v2_host">{{ trans('model.node.v2_host') }}</label>
                                                 <div class="col-md-4 pl-0">
-                                                    <input type="text" class="form-control" name="v2_other" id="v2_host">
+                                                    <input class="form-control" id="v2_host" name="v2_other" type="text">
                                                 </div>
                                                 <div class="text-help offset-md-3">
                                                     {{ trans('admin.node.info.v2_host_hint') }}
                                                 </div>
                                             </div>
                                             <div class="form-group row">
-                                                <label for="v2_path" class="col-md-3 col-form-label">{{ trans('model.node.v2_path') }}</label>
-                                                <input type="text" class="form-control col-md-4" name="v2_path" id="v2_path">
+                                                <label class="col-md-3 col-form-label" for="v2_path">{{ trans('model.node.v2_path') }}</label>
+                                                <input class="form-control col-md-4" id="v2_path" name="v2_path" type="text">
                                             </div>
                                             <div class="form-group row">
-                                                <label for="v2_sni" class="col-md-3 col-form-label">{{ trans('model.node.v2_sni') }}</label>
-                                                <input type="text" class="form-control col-md-4" name="v2_sni" id="v2_sni">
+                                                <label class="col-md-3 col-form-label" for="v2_sni">{{ trans('model.node.v2_sni') }}</label>
+                                                <input class="form-control col-md-4" id="v2_sni" name="v2_sni" type="text">
                                             </div>
                                             <div class="form-group row">
-                                                <label for="v2_tls" class="col-md-3 col-form-label">{{ trans('model.node.v2_tls') }}</label>
+                                                <label class="col-md-3 col-form-label" for="v2_tls">{{ trans('model.node.v2_tls') }}</label>
                                                 <div class="col-md-9">
-                                                    <input type="checkbox" id="v2_tls" name="v2_tls" data-plugin="switchery" onchange="switchSetting('v2_tls')">
+                                                    <input id="v2_tls" name="v2_tls" data-plugin="switchery" type="checkbox"
+                                                           onchange="switchSetting('v2_tls')">
                                                 </div>
                                             </div>
                                             <div class="form-group row">
-                                                <label for="tls_provider" class="col-md-3 col-form-label">{{ trans('model.node.v2_tls_provider') }}</label>
-                                                <input type="text" class="form-control col-md-9" name="tls_provider" id="tls_provider"/>
+                                                <label class="col-md-3 col-form-label" for="tls_provider">{{ trans('model.node.v2_tls_provider') }}</label>
+                                                <input class="form-control col-md-9" id="tls_provider" name="tls_provider" type="text" />
                                                 <div class="text-help offset-md-3"> {{ trans('admin.node.info.v2_tls_provider_hint') }}
-                                                    <a href="https://proxypanel.gitbook.io/wiki/webapi/webapi-basic-setting#vnet-v2-ray-hou-duan" target="_blank">VNET-V2Ray</a>、
+                                                    <a href="https://proxypanel.gitbook.io/wiki/webapi/webapi-basic-setting#vnet-v2-ray-hou-duan"
+                                                       target="_blank">VNET-V2Ray</a>、
                                                     <a href="https://proxypanel.gitbook.io/wiki/webapi/webapi-basic-setting#v-2-ray-poseidon-hou-duan"
                                                        target="_blank">V2Ray-Poseidon</a>
                                                 </div>
@@ -405,23 +419,23 @@
                                         <!-- Trojan 设置部分 -->
                                         <div class="trojan-setting">
                                             <div class="form-group row">
-                                                <label for="trojan_port" class="col-md-3 col-form-label">{{ trans('model.node.service_port') }}</label>
-                                                <input type="number" class="form-control col-md-4" name="port" id="trojan_port" value="443" hidden/>
+                                                <label class="col-md-3 col-form-label" for="trojan_port">{{ trans('model.node.service_port') }}</label>
+                                                <input class="form-control col-md-4" id="trojan_port" name="port" type="number" value="443" hidden />
                                             </div>
                                         </div>
                                     </div>
                                     <div class="relay-config">
                                         <div class="form-group row">
-                                            <label for="relay_port" class="col-md-3 col-form-label">{{ trans('model.node.relay_port') }}</label>
-                                            <input type="number" class="form-control col-md-4" name="port" id="relay_port" value="443" hidden/>
+                                            <label class="col-md-3 col-form-label" for="relay_port">{{ trans('model.node.relay_port') }}</label>
+                                            <input class="form-control col-md-4" id="relay_port" name="port" type="number" value="443" hidden />
                                         </div>
                                     </div>
                                 </div>
                             </div>
                             <div class="col-md-12 form-actions">
                                 <div class="float-right">
-                                    <a href="{{route('admin.node.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
-                                    <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                                    <a class="btn btn-danger" href="{{ route('admin.node.index') }}">{{ trans('common.back') }}</a>
+                                    <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                                 </div>
                             </div>
                         </div>
@@ -437,336 +451,345 @@
     <script src="/assets/global/vendor/switchery/switchery.min.js"></script>
     <script src="/assets/global/js/Plugin/switchery.js"></script>
     <script>
-      const string = "{{strtolower(Str::random())}}";
-      $(document).ready(function() {
-        $('.relay-config').hide();
-        let v2_path = $('#v2_path');
-          @isset($node)
-          @if($node->is_ddns)
-          $('#is_ddns').click();
-          @endif
-          @if($node->is_udp)
-          $('#is_udp').click();
-          @endif
-          @if($node->status)
-          $('#status').click();
-          @endif
-          $("input[name='is_display'][value='{{$node->is_display}}']").click();
-        $("input[name='detection_type'][value='{{$node->detection_type}}']").click();
-        $("input[name='type'][value='{{$node->type}}']").click();
-        $('#name').val('{{$node->name}}');
-        $('#server').val('{{$node->server}}');
-        $('#ip').val('{{$node->ip}}');
-        $('#ipv6').val('{{$node->ipv6}}');
-        $('#push_port').val('{{$node->push_port}}');
-        $('#traffic_rate').val('{{$node->traffic_rate}}');
-        $('#level').selectpicker('val', '{{$node->level}}');
-        $('#ruleGroup').selectpicker('val', '{{$node->rule_group_id}}');
-        $('#speed_limit').val('{{$node->speed_limit}}');
-        $('#client_limit').val('{{$node->client_limit}}');
-        $('#labels').selectpicker('val', {{$node->labels->pluck('id')}});
-        $('#country_code').selectpicker('val', '{{$node->country_code}}');
-        $('#relay_node_id').selectpicker('val', '{{$node->relay_node_id}}');
-        $('#description').val('{{$node->description}}');
-        $('#sort').val('{{$node->sort}}');
+        const string = "{{ strtolower(Str::random()) }}";
+        $(document).ready(function() {
+            $('.relay-config').hide();
+            let v2_path = $('#v2_path');
+            @isset($node)
+                @if ($node->is_ddns)
+                    $('#is_ddns').click();
+                @endif
+                @if ($node->is_udp)
+                    $('#is_udp').click();
+                @endif
+                @if ($node->status)
+                    $('#status').click();
+                @endif
+                $("input[name='is_display'][value='{{ $node->is_display }}']").click();
+                $("input[name='detection_type'][value='{{ $node->detection_type }}']").click();
+                $("input[name='type'][value='{{ $node->type }}']").click();
+                $('#name').val('{{ $node->name }}');
+                $('#server').val('{{ $node->server }}');
+                $('#ip').val('{{ $node->ip }}');
+                $('#ipv6').val('{{ $node->ipv6 }}');
+                $('#push_port').val('{{ $node->push_port }}');
+                $('#traffic_rate').val('{{ $node->traffic_rate }}');
+                $('#level').selectpicker('val', '{{ $node->level }}');
+                $('#ruleGroup').selectpicker('val', '{{ $node->rule_group_id }}');
+                $('#speed_limit').val('{{ $node->speed_limit }}');
+                $('#client_limit').val('{{ $node->client_limit }}');
+                $('#labels').selectpicker('val', {{ $node->labels->pluck('id') }});
+                $('#country_code').selectpicker('val', '{{ $node->country_code }}');
+                $('#relay_node_id').selectpicker('val', '{{ $node->relay_node_id }}');
+                $('#description').val('{{ $node->description }}');
+                $('#sort').val('{{ $node->sort }}');
 
-          @if(isset($node->relay_node_id))
-          $('#relay_port').val('{{$node->port}}');
-          @else
-          @switch($node->type)
-          @case(1)
-          @case(4)
-          $('#protocol').selectpicker('val', '{{$node->profile['protocol'] ?? null}}');
-        $('#protocol_param').val('{{$node->profile['protocol_param'] ?? null}}');
-        $('#obfs').selectpicker('val', '{{$node->profile['obfs'] ?? null}}');
-        $('#obfs_param').val('{{$node->profile['obfs_param'] ?? null}}');
-          @if(!empty($node->profile['passwd']) && $node->port)
-          $('#single').click();
-        $('#passwd').val('{{$node->profile['passwd']}}');
-          @endif
-          @case(0)
-          $('#method').selectpicker('val', '{{$node->profile['method'] ?? null}}');
-          @break
+                @if (isset($node->relay_node_id))
+                    $('#relay_port').val('{{ $node->port }}');
+                @else
+                    @switch($node->type)
+                        @case(1)
+                        @case(4)
+                        $('#protocol').selectpicker('val', '{{ $node->profile['protocol'] ?? null }}');
+                        $('#protocol_param').val('{{ $node->profile['protocol_param'] ?? null }}');
+                        $('#obfs').selectpicker('val', '{{ $node->profile['obfs'] ?? null }}');
+                        $('#obfs_param').val('{{ $node->profile['obfs_param'] ?? null }}');
+                        @if (!empty($node->profile['passwd']) && $node->port)
+                            $('#single').click();
+                            $('#passwd').val('{{ $node->profile['passwd'] }}');
+                        @endif
+                        @case(0)
+                        $('#method').selectpicker('val', '{{ $node->profile['method'] ?? null }}');
+                        @break
 
-          @case(2)
-        //V2Ray
-        $('#v2_alter_id').val('{{$node->profile['v2_alter_id'] ?? null}}');
-        $('#v2_method').selectpicker('val', '{{$node->profile['method'] ?? null}}');
-        $('#v2_net').selectpicker('val', '{{$node->profile['v2_net'] ?? null}}');
-        $('#v2_type').selectpicker('val', '{{$node->profile['v2_type'] ?? null}}');
-        $('#v2_host').val('{{$node->profile['v2_host'] ?? null}}');
-        $('#v2_port').val('{{$node->port}}');
-        $('#v2_sni').val('{{$node->profile['v2_sni'] ?? null}}');
-        v2_path.val('{{$node->profile['v2_path'] ?? null}}');
-          @if($node->profile['v2_tls'] ?? false)
-          $('#v2_tls').click();
-          @endif
-          $('#tls_provider').val('{!! $node->tls_provider !!}');
+                        @case(2)
+                        //V2Ray
+                        $('#v2_alter_id').val('{{ $node->profile['v2_alter_id'] ?? null }}');
+                        $('#v2_method').selectpicker('val', '{{ $node->profile['method'] ?? null }}');
+                        $('#v2_net').selectpicker('val', '{{ $node->profile['v2_net'] ?? null }}');
+                        $('#v2_type').selectpicker('val', '{{ $node->profile['v2_type'] ?? null }}');
+                        $('#v2_host').val('{{ $node->profile['v2_host'] ?? null }}');
+                        $('#v2_port').val('{{ $node->port }}');
+                        $('#v2_sni').val('{{ $node->profile['v2_sni'] ?? null }}');
+                        v2_path.val('{{ $node->profile['v2_path'] ?? null }}');
+                        @if ($node->profile['v2_tls'] ?? false)
+                            $('#v2_tls').click();
+                        @endif
+                        $('#tls_provider').val('{!! $node->tls_provider !!}');
+                        @break
 
-          @break
-          @case(3)
-          $('#trojan_port').val('{{$node->port}}');
-          @break
-          @default
-          @endswitch
-          $('input[name = port]').val('{{$node->port}}');
-          @endif
+                        @case(3)
+                        $('#trojan_port').val('{{ $node->port }}');
+                        @break
 
-          @else
-          switchSetting('single');
-        switchSetting('is_ddns');
-        $('input[name=\'type\'][value=\'0\']').click();
-        $('#status').click();
-        $('#is_udp').click();
-        v2_path.val('/' + string);
-          @endisset
-          if ($('#obfs').val() === 'plain') {
-            $('.obfs_param').hide();
-          }
-      });
+                        @default
+                    @endswitch
+                    $('input[name = port]').val('{{ $node->port }}');
+                @endif
+            @else
+                switchSetting('single');
+                switchSetting('is_ddns');
+                $('input[name=\'type\'][value=\'0\']').click();
+                $('#status').click();
+                $('#is_udp').click();
+                v2_path.val('/' + string);
+            @endisset
+            if ($('#obfs').val() === 'plain') {
+                $('.obfs_param').hide();
+            }
+        });
 
-      function Submit() { // ajax同步提交
-        $.ajax({
-          method: @isset($node) 'PUT' @else 'POST' @endisset,
-          url: '{{isset($node)? route('admin.node.update', $node) : route('admin.node.store')}}',
-          dataType: 'json',
-          data: {
-            _token: '{{csrf_token()}}',
-            is_ddns: document.getElementById('is_ddns').checked ? 1 : 0,
-            name: $('#name').val(),
-            server: $('#server').val(),
-            ip: $('#ip').val(),
-            ipv6: $('#ipv6').val(),
-            push_port: $('#push_port').val(),
-            traffic_rate: $('#traffic_rate').val(),
-            level: $('#level').val(),
-            rule_group_id: $('#ruleGroup').val(),
-            speed_limit: $('#speed_limit').val(),
-            client_limit: $('#client_limit').val(),
-            labels: $('#labels').val(),
-            country_code: $('#country_code option:selected').val(),
-            description: $('#description').val(),
-            sort: $('#sort').val(),
-            is_udp: document.getElementById('is_udp').checked ? 1 : 0,
-            status: document.getElementById('status').checked ? 1 : 0,
-            type: $('input[name=\'type\']:checked').val(),
-            method: $('#method').val(),
-            protocol: $('#protocol').val(),
-            protocol_param: $('#protocol_param').val(),
-            obfs: $('#obfs').val(),
-            obfs_param: $('#obfs_param').val(),
-            is_display: $('input[name=\'is_display\']:checked').val(),
-            detection_type: $('input[name=\'detection_type\']:checked').val(),
-            single: document.getElementById('single').checked ? 1 : 0,
-            port: $('input[name="port"]:not([hidden])').val(),
-            passwd: $('#passwd').val(),
-            v2_alter_id: $('#v2_alter_id').val(),
-            v2_method: $('#v2_method').val(),
-            v2_net: $('#v2_net').val(),
-            v2_type: $('#v2_type').val(),
-            v2_host: $('#v2_host').val(),
-            v2_path: $('#v2_path').val(),
-            v2_sni: $('#v2_sni').val(),
-            v2_tls: document.getElementById('v2_tls').checked ? 1 : 0,
-            tls_provider: $('#tls_provider').val(),
-            relay_node_id: $('#relay_node_id option:selected').val(),
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.href = '{{route('admin.node.index').(Request::getQueryString()?('?'.Request::getQueryString()):'') }}');
-            } else {
-              swal.fire({title: '[错误 | Error]', text: ret.message, icon: 'error'});
+        function Submit() { // ajax同步提交
+            $.ajax({
+                method: @isset($node)
+                    'PUT'
+                @else
+                    'POST'
+                @endisset ,
+                url: '{{ isset($node) ? route('admin.node.update', $node) : route('admin.node.store') }}',
+                dataType: 'json',
+                data: {
+                    _token: '{{ csrf_token() }}',
+                    is_ddns: document.getElementById('is_ddns').checked ? 1 : 0,
+                    name: $('#name').val(),
+                    server: $('#server').val(),
+                    ip: $('#ip').val(),
+                    ipv6: $('#ipv6').val(),
+                    push_port: $('#push_port').val(),
+                    traffic_rate: $('#traffic_rate').val(),
+                    level: $('#level').val(),
+                    rule_group_id: $('#ruleGroup').val(),
+                    speed_limit: $('#speed_limit').val(),
+                    client_limit: $('#client_limit').val(),
+                    labels: $('#labels').val(),
+                    country_code: $('#country_code option:selected').val(),
+                    description: $('#description').val(),
+                    sort: $('#sort').val(),
+                    is_udp: document.getElementById('is_udp').checked ? 1 : 0,
+                    status: document.getElementById('status').checked ? 1 : 0,
+                    type: $('input[name=\'type\']:checked').val(),
+                    method: $('#method').val(),
+                    protocol: $('#protocol').val(),
+                    protocol_param: $('#protocol_param').val(),
+                    obfs: $('#obfs').val(),
+                    obfs_param: $('#obfs_param').val(),
+                    is_display: $('input[name=\'is_display\']:checked').val(),
+                    detection_type: $('input[name=\'detection_type\']:checked').val(),
+                    single: document.getElementById('single').checked ? 1 : 0,
+                    port: $('input[name="port"]:not([hidden])').val(),
+                    passwd: $('#passwd').val(),
+                    v2_alter_id: $('#v2_alter_id').val(),
+                    v2_method: $('#v2_method').val(),
+                    v2_net: $('#v2_net').val(),
+                    v2_type: $('#v2_type').val(),
+                    v2_host: $('#v2_host').val(),
+                    v2_path: $('#v2_path').val(),
+                    v2_sni: $('#v2_sni').val(),
+                    v2_tls: document.getElementById('v2_tls').checked ? 1 : 0,
+                    tls_provider: $('#tls_provider').val(),
+                    relay_node_id: $('#relay_node_id option:selected').val(),
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.href =
+                            '{{ route('admin.node.index') . (Request::getQueryString() ? '?' . Request::getQueryString() : '') }}');
+                    } else {
+                        swal.fire({
+                            title: '[错误 | Error]',
+                            text: ret.message,
+                            icon: 'error'
+                        });
+                    }
+                },
+                error: function(data) {
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        $.each(errors.errors, function(index, value) {
+                            str += '<li>' + value + '</li>';
+                        });
+                        swal.fire({
+                            title: '{{ trans('admin.hint') }}',
+                            html: str,
+                            icon: 'error',
+                            confirmButtonText: '{{ trans('common.confirm') }}',
+                        });
+                    }
+                },
+            });
+
+            return false;
+        }
+
+        function switchSetting(id) {
+            let check = document.getElementById(id).checked ? 1 : 0;
+            switch (id) {
+                case 'single': // 设置单端口多用户
+                    if (check) {
+                        $('.single-setting').show();
+                        $('#single_port').removeAttr('hidden').attr('required', true);
+                    } else {
+                        $('#single_port').removeAttr('required').attr('hidden', true);
+                        $('#passwd').val('');
+                        $('.single-setting').hide();
+                    }
+                    break;
+
+                case 'is_ddns': // 设置是否使用DDNS
+                    if (check) {
+                        $('#ip').val('').attr('readonly', true);
+                        $('#ipv6').val('').attr('readonly', true);
+                        $('#server').attr('required', true);
+                    } else {
+                        $('#ip').removeAttr('readonly');
+                        $('#ipv6').removeAttr('readonly');
+                        $('#server').removeAttr('required');
+                    }
+                    break;
+                default:
+                    break;
             }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({
-                title: '{{ trans('admin.hint') }}',
-                html: str,
-                icon: 'error',
-                confirmButtonText: '{{ trans('common.confirm') }}',
-              });
+        }
+
+        // 设置服务类型
+        $('input:radio[name=\'type\']').on('change', function() {
+            const type = parseInt($(this).val());
+            const $ss_setting = $('.ss-setting');
+            const $ssr_setting = $('.ssr-setting');
+            const $v2ray_setting = $('.v2ray-setting');
+            const $trojan_setting = $('.trojan-setting');
+            $ssr_setting.hide();
+            $ss_setting.hide();
+            $v2ray_setting.hide();
+            $trojan_setting.hide();
+            $('#v2_port').removeAttr('required').attr('hidden', true);
+            $('#trojan_port').removeAttr('required');
+            switch (type) {
+                case 0:
+                    $ss_setting.show();
+                    break;
+                case 2:
+                    $v2ray_setting.show();
+                    $('#v2_port').removeAttr('hidden').attr('required', true);
+                    $('#v2_net').selectpicker('val', 'tcp');
+                    break;
+                case 3:
+                    $trojan_setting.show();
+                    $('#trojan_port').removeAttr('hidden').attr('required', true);
+                    break;
+                case 1:
+                case 4:
+                    $ss_setting.show();
+                    $ssr_setting.show();
+                    break;
+                default:
             }
-          },
         });
 
-        return false;
-      }
-
-      function switchSetting(id) {
-        let check = document.getElementById(id).checked ? 1 : 0;
-        switch (id) {
-          case 'single': // 设置单端口多用户
-            if (check) {
-              $('.single-setting').show();
-              $('#single_port').removeAttr('hidden').attr('required', true);
+        $('#obfs').on('changed.bs.select', function() {
+            const obfs_param = $('.obfs_param');
+            if ($('#obfs').val() === 'plain') {
+                $('#obfs_param').val('');
+                obfs_param.hide();
             } else {
-              $('#single_port').removeAttr('required').attr('hidden', true);
-              $('#passwd').val('');
-              $('.single-setting').hide();
+                obfs_param.show();
             }
-            break;
+        });
 
-          case 'is_ddns': // 设置是否使用DDNS
-            if (check) {
-              $('#ip').val('').attr('readonly', true);
-              $('#ipv6').val('').attr('readonly', true);
-              $('#server').attr('required', true);
+        $('#relay_node_id').on('changed.bs.select', function() {
+            const relay = $('.relay-config');
+            const config = $('.proxy-config');
+            if ($('#relay_node_id').val() === '') {
+                relay.hide();
+                $('#relay_port').removeAttr('required').attr('hidden', true);
+                config.show();
             } else {
-              $('#ip').removeAttr('readonly');
-              $('#ipv6').removeAttr('readonly');
-              $('#server').removeAttr('required');
+                relay.show();
+                config.hide();
+                $('#relay_port').removeAttr('hidden').attr('required', true);
             }
-            break;
-          default:
-            break;
-        }
-      }
-
-      // 设置服务类型
-      $('input:radio[name=\'type\']').on('change', function() {
-        const type = parseInt($(this).val());
-        const $ss_setting = $('.ss-setting');
-        const $ssr_setting = $('.ssr-setting');
-        const $v2ray_setting = $('.v2ray-setting');
-        const $trojan_setting = $('.trojan-setting');
-        $ssr_setting.hide();
-        $ss_setting.hide();
-        $v2ray_setting.hide();
-        $trojan_setting.hide();
-        $('#v2_port').removeAttr('required').attr('hidden', true);
-        $('#trojan_port').removeAttr('required');
-        switch (type) {
-          case 0:
-            $ss_setting.show();
-            break;
-          case 2:
-            $v2ray_setting.show();
-            $('#v2_port').removeAttr('hidden').attr('required', true);
-            $('#v2_net').selectpicker('val', 'tcp');
-            break;
-          case 3:
-            $trojan_setting.show();
-            $('#trojan_port').removeAttr('hidden').attr('required', true);
-            break;
-          case 1:
-          case 4:
-            $ss_setting.show();
-            $ssr_setting.show();
-            break;
-          default:
-        }
-      });
+        });
 
-      $('#obfs').on('changed.bs.select', function() {
-        const obfs_param = $('.obfs_param');
-        if ($('#obfs').val() === 'plain') {
-          $('#obfs_param').val('');
-          obfs_param.hide();
-        } else {
-          obfs_param.show();
-        }
-      });
+        // 设置V2Ray详细设置
+        $('#v2_net').on('changed.bs.select', function() {
+            const type = $('.v2_type');
+            const type_option = $('#type_option');
+            const host = $('.v2_host');
+            const path = $('#v2_path');
+            const v2_other = $('[name="v2_other"]');
+            type.show();
+            host.show();
+            v2_other.show();
+            path.val('/' + string);
+            switch ($(this).val()) {
+                case 'kcp':
+                    type_option.attr('disabled', false);
+                    break;
+                case 'ws':
+                    type.hide();
+                    break;
+                case 'http':
+                    type.hide();
+                    break;
+                case 'domainsocket':
+                    type.hide();
+                    host.hide();
+                    break;
+                case 'quic':
+                    type_option.attr('disabled', false);
+                    path.val(string);
+                    break;
+                case 'tcp':
+                default:
+                    type_option.attr('disabled', true);
+                    break;
+            }
+            $('#v2_type').selectpicker('refresh');
+        });
 
-      $('#relay_node_id').on('changed.bs.select', function() {
-        const relay = $('.relay-config');
-        const config = $('.proxy-config');
-        if ($('#relay_node_id').val() === '') {
-          relay.hide();
-          $('#relay_port').removeAttr('required').attr('hidden', true);
-          config.show();
-        } else {
-          relay.show();
-          config.hide();
-          $('#relay_port').removeAttr('hidden').attr('required', true);
-        }
-      });
+        // 服务条款
+        function showTnc() {
+            const content =
+                '<ol>' +
+                '<li>请勿直接复制黏贴以下配置,SSR(R)会报错的</li>' +
+                '<li>确保服务器时间为CST</li>' +
+                '</ol>' +
+                '&emsp;&emsp;"additional_ports" : {<br />' +
+                '&emsp;&emsp;&emsp;"443": {<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"passwd": "ProxyPanel",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"method": "none",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"protocol": "auth_chain_a",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"protocol_param": "#",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"obfs": "plain",<br />' +
+                '&emsp;&emsp;&emsp;&emsp;"obfs_param": "fe2.update.microsoft.com"<br />' +
+                '&emsp;&emsp;&emsp;}<br />' +
+                '&emsp;&emsp;},';
 
-      // 设置V2Ray详细设置
-      $('#v2_net').on('changed.bs.select', function() {
-        const type = $('.v2_type');
-        const type_option = $('#type_option');
-        const host = $('.v2_host');
-        const path = $('#v2_path');
-        const v2_other = $('[name="v2_other"]');
-        type.show();
-        host.show();
-        v2_other.show();
-        path.val('/' + string);
-        switch ($(this).val()) {
-          case 'kcp':
-            type_option.attr('disabled', false);
-            break;
-          case 'ws':
-            type.hide();
-            break;
-          case 'http':
-            type.hide();
-            break;
-          case 'domainsocket':
-            type.hide();
-            host.hide();
-            break;
-          case 'quic':
-            type_option.attr('disabled', false);
-            path.val(string);
-            break;
-          case 'tcp':
-          default:
-            type_option.attr('disabled', true);
-            break;
+            swal.fire({
+                title: '[节点 user-config.json 配置示例]',
+                html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
+                    content + '</div>',
+                icon: 'info',
+            });
         }
-        $('#v2_type').selectpicker('refresh');
-      });
-
-      // 服务条款
-      function showTnc() {
-        const content =
-            '<ol>' +
-            '<li>请勿直接复制黏贴以下配置,SSR(R)会报错的</li>' +
-            '<li>确保服务器时间为CST</li>' +
-            '</ol>' +
-            '&emsp;&emsp;"additional_ports" : {<br />' +
-            '&emsp;&emsp;&emsp;"443": {<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"passwd": "ProxyPanel",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"method": "none",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"protocol": "auth_chain_a",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"protocol_param": "#",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"obfs": "plain",<br />' +
-            '&emsp;&emsp;&emsp;&emsp;"obfs_param": "fe2.update.microsoft.com"<br />' +
-            '&emsp;&emsp;&emsp;}<br />' +
-            '&emsp;&emsp;},';
-
-        swal.fire({
-          title: '[节点 user-config.json 配置示例]',
-          html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
-              content + '</div>',
-          icon: 'info',
-        });
-      }
 
-      // 模式提示
-      function showPortsOnlyConfig() {
-        const content = '严格模式:"additional_ports_only": "true"'
-            + '<br><br>'
-            + '兼容模式:"additional_ports_only": "false"';
+        // 模式提示
+        function showPortsOnlyConfig() {
+            const content = '严格模式:"additional_ports_only": "true"' +
+                '<br><br>' +
+                '兼容模式:"additional_ports_only": "false"';
 
-        swal.fire({
-          title: '[节点 user-config.json 配置示例]',
-          html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
-              content + '</div>',
-          icon: 'info',
-        });
-      }
+            swal.fire({
+                title: '[节点 user-config.json 配置示例]',
+                html: '<div class="p-10 bg-grey-900 text-white font-weight-300 text-left" style="line-height: 22px;">' +
+                    content + '</div>',
+                icon: 'info',
+            });
+        }
     </script>
 @endsection

+ 67 - 68
resources/views/admin/node/monitor.blade.php

@@ -7,20 +7,20 @@
             </div>
             <div class="alert alert-info alert-dismissible">
                 <button class="close" data-dismiss="alert" aria-label="{{ trans('common.close') }}">
-                    <span aria-hidden="true">&times;</span><span class="sr-only">{{trans('common.close')}}</span>
+                    <span aria-hidden="true">&times;</span><span class="sr-only">{{ trans('common.close') }}</span>
                 </button>
-                <h4 class="block">{{$nodeName}}
-                    <small class="pl-10">{{$nodeServer}}</small>
+                <h4 class="block">{{ $nodeName }}
+                    <small class="pl-10">{{ $nodeServer }}</small>
                 </h4>
                 {!! trans('admin.monitor.hint') !!}
             </div>
             <div class="panel-body">
                 <div class="row">
                     <div class="col-md-6">
-                        <canvas id="dailyChart" aria-label="{{ trans('admin.monitor.daily_chart') }}" role="img"></canvas>
+                        <canvas id="dailyChart" role="img" aria-label="{{ trans('admin.monitor.daily_chart') }}"></canvas>
                     </div>
                     <div class="col-md-6">
-                        <canvas id="monthlyChart" aria-label="{{ trans('admin.monitor.monthly_chart') }}" role="img"></canvas>
+                        <canvas id="monthlyChart" role="img" aria-label="{{ trans('admin.monitor.monthly_chart') }}"></canvas>
                     </div>
                 </div>
             </div>
@@ -30,74 +30,73 @@
 @section('javascript')
     <script src="/assets/global/vendor/chart-js/chart.min.js"></script>
     <script>
-      function common_options(tail) {
-        return {
-          responsive: true,
-          scales: {
-            x: {
-              ticks: {
-                callback: function(value) {
-                  return this.getLabelForValue(value) + ' ' + tail;
-                },
-              },
-              grid: {
-                display: false,
-              },
-            },
-            y: {
-              ticks: {
-                callback: function(value) {
-                  return this.getLabelForValue(value) + ' GB';
-                },
-              },
-              grid: {
-                display: false,
-              },
-              min: 0,
-            },
+        function common_options(tail) {
+            return {
+                responsive: true,
+                scales: {
+                    x: {
+                        ticks: {
+                            callback: function(value) {
+                                return this.getLabelForValue(value) + ' ' + tail;
+                            },
+                        },
+                        grid: {
+                            display: false,
+                        },
+                    },
+                    y: {
+                        ticks: {
+                            callback: function(value) {
+                                return this.getLabelForValue(value) + ' GB';
+                            },
+                        },
+                        grid: {
+                            display: false,
+                        },
+                        min: 0,
+                    },
 
-          },
-          plugins: {
-            legend: false,
-            tooltip: {
-              mode: 'index',
-              intersect: false,
-              callbacks: {
-                title: function(context) {
-                  return context[0].label + ' ' + tail;
                 },
-                label: function(context) {
-                  return context.parsed.y + ' GB';
+                plugins: {
+                    legend: false,
+                    tooltip: {
+                        mode: 'index',
+                        intersect: false,
+                        callbacks: {
+                            title: function(context) {
+                                return context[0].label + ' ' + tail;
+                            },
+                            label: function(context) {
+                                return context.parsed.y + ' GB';
+                            },
+                        },
+                    },
                 },
-              },
-            },
-          },
-        };
-      }
+            };
+        }
 
-      function datasets(label, data) {
-        return {
-          labels: label,
-          datasets: [
-            {
-              backgroundColor: 'rgba(184, 215, 255)',
-              borderColor: 'rgba(184, 215, 255)',
-              data: data,
-              tension: 0.4,
-            }],
-        };
-      }
+        function datasets(label, data) {
+            return {
+                labels: label,
+                datasets: [{
+                    backgroundColor: 'rgba(184, 215, 255)',
+                    borderColor: 'rgba(184, 215, 255)',
+                    data: data,
+                    tension: 0.4,
+                }],
+            };
+        }
 
-      new Chart(document.getElementById('dailyChart'), {
-        type: 'line',
-        data: datasets(@json($dayHours), @json($trafficHourly)),
-        options: common_options(@json(trans_choice('common.hour', 2))),
-      });
+        new Chart(document.getElementById('dailyChart'), {
+            type: 'line',
+            data: datasets(@json($dayHours), @json($trafficHourly)),
+            options: common_options(@json(trans_choice('common.hour', 2))),
+        });
 
-      new Chart(document.getElementById('monthlyChart'), {
-        type: 'line',
-        data: datasets(@json($monthDays), @json($trafficDaily)),
-        options: common_options(@json(trans_choice('common.days.attribute', 2))),
-      });
+        new Chart(document.getElementById('monthlyChart'), {
+            type: 'line',
+            data: datasets(@json($monthDays), @json($trafficDaily)),
+            options: common_options(@json(trans_choice('common.days.attribute', 2))),
+        });
     </script>
 @endsection

+ 71 - 65
resources/views/admin/permission/index.blade.php

@@ -9,7 +9,7 @@
                 <h2 class="panel-title">{{ trans('admin.permission.title') }}</h2>
                 @can('admin.permission.create')
                     <div class="panel-actions">
-                        <a href="{{route('admin.permission.create')}}" class="btn btn-outline-primary">
+                        <a class="btn btn-outline-primary" href="{{ route('admin.permission.create') }}">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -18,49 +18,50 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-5 col-sm-6">
-                        <input type="text" class="form-control" name="description" value="{{Request::query('description')}}"
-                               placeholder="{{ trans('model.permission.description') }}"/>
+                        <input class="form-control" name="description" type="text" value="{{ Request::query('description') }}"
+                               placeholder="{{ trans('model.permission.description') }}" />
                     </div>
                     <div class="form-group col-lg-5 col-sm-6">
-                        <input type="text" class="form-control" name="name" value="{{Request::query('name')}}" placeholder="{{ trans('model.permission.name') }}"/>
+                        <input class="form-control" name="name" type="text" value="{{ Request::query('name') }}"
+                               placeholder="{{ trans('model.permission.name') }}" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.permission.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.permission.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.permission.description') }}</th>
-                        <th> {{ trans('model.permission.name') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($permissions as $permission)
                         <tr>
-                            <td>{{$permission->id}}</td>
-                            <td>{{$permission->description}}</td>
-                            <td>{{$permission->name}}</td>
-                            <td>
-                                @canany(['admin.permission.edit', 'admin.permission.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.permission.edit')
-                                            <a class="btn btn-sm btn-outline-primary" href="{{route('admin.permission.edit', $permission)}}">
-                                                <i class="icon wb-edit"></i></a>
-                                        @endcan
-                                        @can('admin.permission.destroy')
-                                            <button class="btn btn-sm btn-outline-danger"
-                                                    onclick="delPermission('{{route('admin.permission.destroy', $permission)}}','{{$permission->name}}')">
-                                                <i class="icon wb-trash"></i></button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.permission.description') }}</th>
+                            <th> {{ trans('model.permission.name') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($permissions as $permission)
+                            <tr>
+                                <td>{{ $permission->id }}</td>
+                                <td>{{ $permission->description }}</td>
+                                <td>{{ $permission->name }}</td>
+                                <td>
+                                    @canany(['admin.permission.edit', 'admin.permission.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.permission.edit')
+                                                <a class="btn btn-sm btn-outline-primary" href="{{ route('admin.permission.edit', $permission) }}">
+                                                    <i class="icon wb-edit"></i></a>
+                                            @endcan
+                                            @can('admin.permission.destroy')
+                                                <button class="btn btn-sm btn-outline-danger"
+                                                        onclick="delPermission('{{ route('admin.permission.destroy', $permission) }}','{{ $permission->name }}')">
+                                                    <i class="icon wb-trash"></i></button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -71,7 +72,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$permissions->links()}}
+                            {{ $permissions->links() }}
                         </nav>
                     </div>
                 </div>
@@ -84,38 +85,43 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.permission.destroy')
         <script>
-          function delPermission(url, name) {
-            swal.fire({
-              title: '{{trans('common.warning')}}',
-              text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.permission.attribute')]) }}' +
-                  name + '{{ trans('admin.confirm.delete.1') }}',
-              icon: 'warning',
-              showCancelButton: true,
-              cancelButtonText: '{{ trans('common.close') }}',
-              confirmButtonText: '{{ trans('common.confirm') }}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({
-                        title: ret.message,
-                        icon: 'success',
-                        timer: 1000,
-                        showConfirmButton: false,
-                      }).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            function delPermission(url, name) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.permission.attribute')]) }}' +
+                        name + '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 22 - 20
resources/views/admin/permission/info.blade.php

@@ -4,22 +4,24 @@
         <div class="panel">
             <div class="panel-heading">
                 <h2 class="panel-title">
-                    {{ isset($permission) ? trans('admin.action.edit_item', ['attribute' => trans('model.permission.attribute')]) : trans('admin.action.add_item', ['attribute'
-                    => trans('model.permission.attribute')]) }}
+                    {{ isset($permission)
+                        ? trans('admin.action.edit_item', ['attribute' => trans('model.permission.attribute')])
+                        : trans('admin.action.add_item', ['attribute' => trans('model.permission.attribute')]) }}
                 </h2>
                 <div class="panel-actions">
-                    <a href="{{route('admin.permission.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.permission.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="@isset($permission){{route('admin.permission.update',$permission)}}@else{{route('admin.permission.store')}}@endisset"
-                      method="POST" enctype="multipart/form-data" class="form-horizontal">
+                <form class="form-horizontal"
+                      action="@isset($permission){{ route('admin.permission.update', $permission) }}@else{{ route('admin.permission.store') }}@endisset"
+                      method="POST" enctype="multipart/form-data">
                     @isset($permission)
                         @method('PUT')
                     @endisset
@@ -27,20 +29,20 @@
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="description">{{ trans('model.permission.description') }}</label>
                         <div class="col-md-7 col-sm-8">
-                            <input type="text" class="form-control" name="description" id="description" required/>
+                            <input class="form-control" id="description" name="description" type="text" required />
                             <span class="text-help"> {{ trans('admin.permission.description_hint') }} </span>
                         </div>
                     </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="name">{{ trans('model.permission.name') }}</label>
                         <div class="col-md-7 col-sm-8">
-                            <input type="text" class="form-control" name="name" id="name" required/>
+                            <input class="form-control" id="name" name="name" type="text" required />
                             <span class="text-help"> {{ trans('admin.permission.name_hint') }} </span>
                         </div>
                     </div>
 
                     <div class="form-actions text-right">
-                        <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                     </div>
                 </form>
             </div>
@@ -49,14 +51,14 @@
 @endsection
 @section('javascript')
     <script>
-      $(document).ready(function() {
-          @isset($permission)
-          $('#description').val(@json(old('description') ?? $permission->description));
-        $('#name').val(@json(old('name') ?? $permission->name));
-          @else
-          $('#description').val(@json(old('description')));
-        $('#name').val(@json(old('name')));
-          @endisset
-      });
+        $(document).ready(function() {
+            @isset($permission)
+                $('#description').val(@json(old('description') ?? $permission->description));
+                $('#name').val(@json(old('name') ?? $permission->name));
+            @else
+                $('#description').val(@json(old('description')));
+                $('#name').val(@json(old('name')));
+            @endisset
+        });
     </script>
 @endsection

+ 73 - 67
resources/views/admin/role/index.blade.php

@@ -9,7 +9,7 @@
                 <h2 class="panel-title">{{ trans('admin.role.title') }}</h2>
                 @can('admin.role.create')
                     <div class="panel-actions">
-                        <a href="{{route('admin.role.create')}}" class="btn btn-outline-primary">
+                        <a class="btn btn-outline-primary" href="{{ route('admin.role.create') }}">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -18,43 +18,44 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.role.name') }}</th>
-                        <th> {{ trans('model.role.permissions') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($roles as $role)
                         <tr>
-                            <td>{{$role->id}}</td>
-                            <td>{{$role->description}}</td>
-                            <td>
-                                @if ($role->name === 'Super Admin')
-                                    <span class="badge badge-info">{{ trans('admin.role.permissions_all') }}</span>
-                                @else
-                                    @foreach($role->permissions()->pluck('description') as $description)
-                                        <span class="badge badge-info">{{ $description }}</span>
-                                    @endforeach
-                                @endif
-                            </td>
-                            <td>
-                                @canany(['admin.role.edit', 'admin.role.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.role.edit')
-                                            <a class="btn btn-sm btn-outline-primary" href="{{route('admin.role.edit', $role)}}">
-                                                <i class="icon wb-edit"></i></a>
-                                        @endcan
-                                        @can('admin.role.destroy')
-                                            <button class="btn btn-sm btn-outline-danger" onclick="delRole('{{route('admin.role.destroy', $role)}}','{{$role->name}}')">
-                                                <i class="icon wb-trash"></i></button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.role.name') }}</th>
+                            <th> {{ trans('model.role.permissions') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($roles as $role)
+                            <tr>
+                                <td>{{ $role->id }}</td>
+                                <td>{{ $role->description }}</td>
+                                <td>
+                                    @if ($role->name === 'Super Admin')
+                                        <span class="badge badge-info">{{ trans('admin.role.permissions_all') }}</span>
+                                    @else
+                                        @foreach ($role->permissions()->pluck('description') as $description)
+                                            <span class="badge badge-info">{{ $description }}</span>
+                                        @endforeach
+                                    @endif
+                                </td>
+                                <td>
+                                    @canany(['admin.role.edit', 'admin.role.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.role.edit')
+                                                <a class="btn btn-sm btn-outline-primary" href="{{ route('admin.role.edit', $role) }}">
+                                                    <i class="icon wb-edit"></i></a>
+                                            @endcan
+                                            @can('admin.role.destroy')
+                                                <button class="btn btn-sm btn-outline-danger"
+                                                        onclick="delRole('{{ route('admin.role.destroy', $role) }}','{{ $role->name }}')">
+                                                    <i class="icon wb-trash"></i></button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -65,7 +66,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$roles->links()}}
+                            {{ $roles->links() }}
                         </nav>
                     </div>
                 </div>
@@ -78,38 +79,43 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.role.destroy')
         <script>
-          function delRole(url, name) {
-            swal.fire({
-              title: '{{ trans('common.warning') }}',
-              text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.role.attribute')]) }}' + name +
-                  '{{ trans('admin.confirm.delete.1') }}',
-              icon: 'warning',
-              showCancelButton: true,
-              cancelButtonText: '{{ trans('common.close') }}',
-              confirmButtonText: '{{ trans('common.confirm') }}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({
-                        title: ret.message,
-                        icon: 'success',
-                        timer: 1000,
-                        showConfirmButton: false,
-                      }).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            function delRole(url, name) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.role.attribute')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 56 - 54
resources/views/admin/role/info.blade.php

@@ -12,22 +12,24 @@
         <div class="panel">
             <div class="panel-heading">
                 <h2 class="panel-title">
-                    {{ isset($role) ? trans('admin.action.edit_item', ['attribute' => trans('model.role.attribute')]) : trans('admin.action.add_item', ['attribute' =>
-                     trans('model.role.attribute')]) }}
+                    {{ isset($role)
+                        ? trans('admin.action.edit_item', ['attribute' => trans('model.role.attribute')])
+                        : trans('admin.action.add_item', ['attribute' => trans('model.role.attribute')]) }}
                 </h2>
                 <div class="panel-actions">
-                    <a href="{{route('admin.role.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.role.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="@isset($role){{route('admin.role.update',$role)}}@else{{route('admin.role.store')}}@endisset"
-                      method="POST" enctype="multipart/form-data" class="form-horizontal">
+                <form class="form-horizontal"
+                      action="@isset($role){{ route('admin.role.update', $role) }}@else{{ route('admin.role.store') }}@endisset"
+                      method="POST" enctype="multipart/form-data">
                     @isset($role)
                         @method('PUT')
                     @endisset
@@ -35,14 +37,14 @@
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="name">{{ trans('model.role.name') }}</label>
                         <div class="col-md-5 col-sm-9">
-                            <input type="text" class="form-control" name="name" id="name" required/>
+                            <input class="form-control" id="name" name="name" type="text" required />
                             <span class="text-help"> {{ trans('admin.role.name_hint') }} </span>
                         </div>
                     </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="description">{{ trans('model.common.description') }}</label>
                         <div class="col-md-5 col-sm-9">
-                            <input type="text" class="form-control" name="description" id="description" required/>
+                            <input class="form-control" id="description" name="description" type="text" required />
                             <span class="text-help"> {{ trans('admin.role.description_hint') }} </span>
                         </div>
                     </div>
@@ -50,18 +52,18 @@
                         <label class="col-md-2 col-sm-3 col-form-label" for="permissions">{{ trans('model.role.permissions') }}</label>
                         <div class="col-md-9 col-sm-9">
                             <div class="btn-group mb-20">
-                                <button type="button" class="btn btn-primary" id="select-all">{{ trans('admin.select_all') }}</button>
-                                <button type="button" class="btn btn-danger" id="deselect-all">{{ trans('admin.clear') }}</button>
+                                <button class="btn btn-primary" id="select-all" type="button">{{ trans('admin.select_all') }}</button>
+                                <button class="btn btn-danger" id="deselect-all" type="button">{{ trans('admin.clear') }}</button>
                             </div>
-                            <select class="form-control mx-auto w-p100" name="permissions[]" id="permissions" data-plugin="multiSelect" multiple>
-                                @foreach($permissions as $key => $description)
-                                    <option value="{{ $key }}">{{ $description .' - '. $key }}</option>
+                            <select class="form-control mx-auto w-p100" id="permissions" name="permissions[]" data-plugin="multiSelect" multiple>
+                                @foreach ($permissions as $key => $description)
+                                    <option value="{{ $key }}">{{ $description . ' - ' . $key }}</option>
                                 @endforeach
                             </select>
                         </div>
                     </div>
                     <div class="form-actions text-right">
-                        <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                     </div>
                 </form>
             </div>
@@ -74,57 +76,57 @@
     <script src="/assets/custom/jquery.quicksearch.min.js"></script>
     <script>
         @isset($role)
-        $(document).ready(function() {
-          $('#description').val('{{$role->description}}');
-          $('#name').val('{{$role->name}}');
-          $('#permissions').multiSelect('select',@json($role->permissions->pluck('name')));
-        });
+            $(document).ready(function() {
+                $('#description').val('{{ $role->description }}');
+                $('#name').val('{{ $role->name }}');
+                $('#permissions').multiSelect('select', @json($role->permissions->pluck('name')));
+            });
         @endisset
         // 权限列表
         $('#permissions').multiSelect({
-          selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.unselected_hint') }}\'>',
-          selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.selected_hint') }}\'>',
-          afterInit: function() {
-            const that = this,
-                $selectableSearch = that.$selectableUl.prev(),
-                $selectionSearch = that.$selectionUl.prev(),
-                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
-                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
+            selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.unselected_hint') }}\'>',
+            selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.selected_hint') }}\'>',
+            afterInit: function() {
+                const that = this,
+                    $selectableSearch = that.$selectableUl.prev(),
+                    $selectionSearch = that.$selectionUl.prev(),
+                    selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
+                    selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
 
-            that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectableUl.focus();
-                return false;
-              }
-            });
+                that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectableUl.focus();
+                        return false;
+                    }
+                });
 
-            that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectionUl.focus();
-                return false;
-              }
-            });
-          },
-          afterSelect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
-          afterDeselect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
+                that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectionUl.focus();
+                        return false;
+                    }
+                });
+            },
+            afterSelect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
+            afterDeselect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
         });
 
         // 全选
         $('#select-all').click(function() {
-          $('#permissions').multiSelect('select_all');
-          return false;
+            $('#permissions').multiSelect('select_all');
+            return false;
         });
 
         // 反选
         $('#deselect-all').click(function() {
-          $('#permissions').multiSelect('deselect_all');
-          return false;
+            $('#permissions').multiSelect('deselect_all');
+            return false;
         });
     </script>
 @endsection

+ 68 - 64
resources/views/admin/rule/group/index.blade.php

@@ -9,7 +9,7 @@
                 <h2 class="panel-title">{{ trans('admin.rule.group.title') }}</h2>
                 @can('admin.rule.group.create')
                     <div class="panel-actions">
-                        <a href="{{route('admin.rule.group.create')}}" class="btn btn-outline-primary">
+                        <a class="btn btn-outline-primary" href="{{ route('admin.rule.group.create') }}">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -18,38 +18,38 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.rule_group.name') }}</th>
-                        <th> {{ trans('model.rule_group.type') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($ruleGroups as $ruleGroup)
                         <tr>
-                            <td> {{$ruleGroup->id}} </td>
-                            <td> {{$ruleGroup->name}} </td>
-                            <td> {!! $ruleGroup->type_label !!} </td>
-                            <td>
-                                @canany(['admin.rule.group.edit', 'admin.rule.group.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.rule.group.edit')
-                                            <a href="{{route('admin.rule.group.edit', $ruleGroup)}}" class="btn btn-sm btn-outline-primary">
-                                                <i class="icon wb-edit"></i> {{ trans('common.edit') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.rule.group.destroy')
-                                            <button onclick="delRuleGroup('{{route('admin.rule.group.destroy', $ruleGroup)}}', '{{$ruleGroup->name}}')"
-                                                    class="btn btn-sm btn-outline-danger">
-                                                <i class="icon wb-trash"></i> {{ trans('common.delete') }}
-                                            </button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.rule_group.name') }}</th>
+                            <th> {{ trans('model.rule_group.type') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($ruleGroups as $ruleGroup)
+                            <tr>
+                                <td> {{ $ruleGroup->id }} </td>
+                                <td> {{ $ruleGroup->name }} </td>
+                                <td> {!! $ruleGroup->type_label !!} </td>
+                                <td>
+                                    @canany(['admin.rule.group.edit', 'admin.rule.group.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.rule.group.edit')
+                                                <a class="btn btn-sm btn-outline-primary" href="{{ route('admin.rule.group.edit', $ruleGroup) }}">
+                                                    <i class="icon wb-edit"></i> {{ trans('common.edit') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.rule.group.destroy')
+                                                <button class="btn btn-sm btn-outline-danger"
+                                                        onclick="delRuleGroup('{{ route('admin.rule.group.destroy', $ruleGroup) }}', '{{ $ruleGroup->name }}')">
+                                                    <i class="icon wb-trash"></i> {{ trans('common.delete') }}
+                                                </button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -60,7 +60,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$ruleGroups->links()}}
+                            {{ $ruleGroups->links() }}
                         </nav>
                     </div>
                 </div>
@@ -73,40 +73,44 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     @can('admin.rule.group.destroy')
         <script>
-          // 删除规则分组
-          function delRuleGroup(url, name) {
-            swal.fire({
-              title: '{{trans('common.warning')}}',
-              text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.rule_group.attribute')]) }}' +
-                  name + '{{ trans('admin.confirm.delete.1') }}',
-              icon: 'warning',
-              showCancelButton: true,
-              cancelButtonText: '{{trans('common.close')}}',
-              confirmButtonText: '{{trans('common.confirm')}}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{csrf_token()}}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({
-                        title: ret.message,
-                        icon: 'success',
-                        timer: 1000,
-                        showConfirmButton: false,
-                      }).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除规则分组
+            function delRuleGroup(url, name) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.rule_group.attribute')]) }}' +
+                        name + '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection
-

+ 56 - 55
resources/views/admin/rule/group/info.blade.php

@@ -7,29 +7,30 @@
         <div class="panel">
             <div class="panel-heading">
                 <h2 class="panel-title">
-                    {{ isset($ruleGroup) ? trans('admin.action.edit_item', ['attribute' => trans('model.rule_group.attribute')]) : trans('admin.action.add_item', ['attribute' =>
-                     trans('model.rule_group.attribute')]) }}
+                    {{ isset($ruleGroup)
+                        ? trans('admin.action.edit_item', ['attribute' => trans('model.rule_group.attribute')])
+                        : trans('admin.action.add_item', ['attribute' => trans('model.rule_group.attribute')]) }}
                 </h2>
                 <div class="panel-actions">
-                    <a href="{{route('admin.rule.group.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.rule.group.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="{{isset($ruleGroup) ? route('admin.rule.group.update', $ruleGroup) : route('admin.rule.group.store')}}" method="post"
-                      enctype="multipart/form-data" class="form-horizontal">
+                <form class="form-horizontal" action="{{ isset($ruleGroup) ? route('admin.rule.group.update', $ruleGroup) : route('admin.rule.group.store') }}"
+                      method="post" enctype="multipart/form-data">
                     @isset($ruleGroup)
                         @method('PUT')
                     @endisset @csrf
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="name">{{ trans('model.rule_group.name') }}</label>
                         <div class="col-md-9 col-sm-9">
-                            <input type="text" class="form-control" name="name" id="name"/>
+                            <input class="form-control" id="name" name="name" type="text" />
                         </div>
                     </div>
                     <div class="form-group row">
@@ -38,13 +39,13 @@
                             <ul class="list-unstyled list-inline">
                                 <li class="list-inline-item">
                                     <div class="radio-custom radio-primary">
-                                        <input type="radio" name="type" id="block" value="1" checked/>
+                                        <input id="block" name="type" type="radio" value="1" checked />
                                         <label for="block">{{ trans('admin.rule.group.type.off') }}</label>
                                     </div>
                                 </li>
                                 <li class="list-inline-item">
                                     <div class="radio-custom radio-primary">
-                                        <input type="radio" name="type" id="unblock" value="0"/>
+                                        <input id="unblock" name="type" type="radio" value="0" />
                                         <label for="unblock">{{ trans('admin.rule.group.type.on') }}</label>
                                     </div>
                                 </li>
@@ -55,18 +56,18 @@
                         <label class="col-md-2 col-sm-3 col-form-label" for="rules">{{ trans('model.rule_group.rules') }}</label>
                         <div class="col-md-9 col-sm-9">
                             <div class="btn-group mb-20">
-                                <button type="button" class="btn btn-primary" id="select-all">{{ trans('admin.select_all') }}</button>
-                                <button type="button" class="btn btn-danger" id="deselect-all">{{ trans('admin.clear') }}</button>
+                                <button class="btn btn-primary" id="select-all" type="button">{{ trans('admin.select_all') }}</button>
+                                <button class="btn btn-danger" id="deselect-all" type="button">{{ trans('admin.clear') }}</button>
                             </div>
-                            <select class="form-control" name="rules[]" id="rules" data-plugin="multiSelect" multiple>
-                                @foreach($rules as $rule)
-                                    <option value="{{$rule->id}}">{{$rule->id . ' - ' . $rule->name}}</option>
+                            <select class="form-control" id="rules" name="rules[]" data-plugin="multiSelect" multiple>
+                                @foreach ($rules as $rule)
+                                    <option value="{{ $rule->id }}">{{ $rule->id . ' - ' . $rule->name }}</option>
                                 @endforeach
                             </select>
                         </div>
                     </div>
                     <div class="form-actions text-right">
-                        <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                     </div>
                 </form>
             </div>
@@ -79,57 +80,57 @@
     <script src="/assets/custom/jquery.quicksearch.min.js"></script>
     <script>
         @isset($ruleGroup)
-        $(document).ready(function() {
-          $('#name').val('{{$ruleGroup->name}}');
-          $("input[name='type'][value='{{$ruleGroup->type}}']").click();
-          $('#rules').multiSelect('select', @json(array_map('strval', $ruleGroup->rules()->get()->pluck('id')->toArray())));
-        });
+            $(document).ready(function() {
+                $('#name').val('{{ $ruleGroup->name }}');
+                $("input[name='type'][value='{{ $ruleGroup->type }}']").click();
+                $('#rules').multiSelect('select', @json(array_map('strval', $ruleGroup->rules()->get()->pluck('id')->toArray())));
+            });
         @endisset
         // 权限列表
         $('#rules').multiSelect({
-          selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.unselected_hint') }}\'>',
-          selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.selected_hint') }}\'>',
-          afterInit: function() {
-            const that = this,
-                $selectableSearch = that.$selectableUl.prev(),
-                $selectionSearch = that.$selectionUl.prev(),
-                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
-                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
+            selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.unselected_hint') }}\'>',
+            selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.selected_hint') }}\'>',
+            afterInit: function() {
+                const that = this,
+                    $selectableSearch = that.$selectableUl.prev(),
+                    $selectionSearch = that.$selectionUl.prev(),
+                    selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
+                    selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
 
-            that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectableUl.focus();
-                return false;
-              }
-            });
+                that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectableUl.focus();
+                        return false;
+                    }
+                });
 
-            that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectionUl.focus();
-                return false;
-              }
-            });
-          },
-          afterSelect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
-          afterDeselect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
+                that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectionUl.focus();
+                        return false;
+                    }
+                });
+            },
+            afterSelect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
+            afterDeselect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
         });
 
         // 全选
         $('#select-all').click(function() {
-          $('#rules').multiSelect('select_all');
-          return false;
+            $('#rules').multiSelect('select_all');
+            return false;
         });
 
         // 反选
         $('#deselect-all').click(function() {
-          $('#rules').multiSelect('deselect_all');
-          return false;
+            $('#rules').multiSelect('deselect_all');
+            return false;
         });
     </script>
 @endsection

+ 184 - 180
resources/views/admin/rule/index.blade.php

@@ -1,8 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-    <link href="/assets/global/vendor/bootstrap-select/bootstrap-select.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -10,7 +6,7 @@
                 <h2 class="panel-title">{{ trans('admin.rule.title') }}</h2>
                 @can('admin.rule.store')
                     <div class="panel-actions">
-                        <button data-toggle="modal" data-target="#add" class="btn btn-outline-primary">
+                        <button class="btn btn-outline-primary" data-toggle="modal" data-target="#add">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </button>
                     </div>
@@ -19,8 +15,8 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary" title="{{ trans('model.rule.attribute') }}"
-                                onchange="this.form.submit()">
+                        <select class="form-control" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.rule.attribute') }}">
                             <option value="1">{{ trans('admin.rule.type.reg') }}</option>
                             <option value="2">{{ trans('admin.rule.type.domain') }}</option>
                             <option value="3">{{ trans('admin.rule.type.ip') }}</option>
@@ -28,46 +24,47 @@
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <a href="{{route('admin.rule.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
+                        <a class="btn btn-danger" href="{{ route('admin.rule.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.rule.attribute') }}</th>
-                        <th> {{ trans('model.rule.name') }}</th>
-                        <th> {{ trans('model.rule.pattern') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($rules as $rule)
                         <tr>
-                            <td> {{$rule->id}} </td>
-                            <td> {!! $rule->type_label !!} </td>
-                            <td>
-                                <input type="text" class="form-control" name="name" id="name_{{$rule->id}}" value="{{$rule->name}}"/>
-                            </td>
-                            <td>
-                                <input type="text" class="form-control" name="pattern" id="pattern_{{$rule->id}}" value="{{$rule->pattern}}"/>
-                            </td>
-                            <td>
-                                @canany(['admin.rule.update', 'admin.rule.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.rule.update')
-                                            <button class="btn btn-sm btn-outline-primary" onclick="editRule('{{$rule->id}}')">
-                                                <i class="icon wb-edit"></i></button>
-                                        @endcan
-                                        @can('admin.rule.destroy')
-                                            <button class="btn btn-sm btn-outline-danger" onclick="delRule('{{route('admin.rule.destroy',$rule)}}','{{$rule->name}}')">
-                                                <i class="icon wb-trash"></i></button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.rule.attribute') }}</th>
+                            <th> {{ trans('model.rule.name') }}</th>
+                            <th> {{ trans('model.rule.pattern') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($rules as $rule)
+                            <tr>
+                                <td> {{ $rule->id }} </td>
+                                <td> {!! $rule->type_label !!} </td>
+                                <td>
+                                    <input class="form-control" id="name_{{ $rule->id }}" name="name" type="text" value="{{ $rule->name }}" />
+                                </td>
+                                <td>
+                                    <input class="form-control" id="pattern_{{ $rule->id }}" name="pattern" type="text" value="{{ $rule->pattern }}" />
+                                </td>
+                                <td>
+                                    @canany(['admin.rule.update', 'admin.rule.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.rule.update')
+                                                <button class="btn btn-sm btn-outline-primary" onclick="editRule('{{ $rule->id }}')">
+                                                    <i class="icon wb-edit"></i></button>
+                                            @endcan
+                                            @can('admin.rule.destroy')
+                                                <button class="btn btn-sm btn-outline-danger"
+                                                        onclick="delRule('{{ route('admin.rule.destroy', $rule) }}','{{ $rule->name }}')">
+                                                    <i class="icon wb-trash"></i></button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -78,7 +75,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$rules->links()}}
+                            {{ $rules->links() }}
                         </nav>
                     </div>
                 </div>
@@ -87,23 +84,23 @@
     </div>
 
     @can('admin.rule.store')
-        <div class="modal fade" id="add" aria-hidden="true" role="dialog" tabindex="-1">
+        <div class="modal fade" id="add" role="dialog" aria-hidden="true" tabindex="-1">
             <div class="modal-dialog modal-simple modal-center">
                 <div class="modal-content">
                     <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                        <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                             <span aria-hidden="true">×</span>
                         </button>
                         <h4 class="modal-title">{{ trans('admin.action.add_item', ['attribute' => trans('model.rule.attribute')]) }}</h4>
                     </div>
-                    <form action="#" method="post" class="modal-body">
-                        <div class="alert alert-danger" style="display: none;" id="msg"></div>
+                    <form class="modal-body" action="#" method="post">
+                        <div class="alert alert-danger" id="msg" style="display: none;"></div>
                         <div class="form-row">
                             <div class="col-12">
                                 <div class="form-group row">
                                     <label class="col-md-2 col-sm-3 col-form-label" for="add_type">{{ trans('model.rule.attribute') }}</label>
                                     <div class="col-xl-4 col-sm-8">
-                                        <select class="form-control" name="add_type" id="add_type" data-plugin="selectpicker" data-style="btn-outline btn-primary">
+                                        <select class="form-control" id="add_type" name="add_type" data-plugin="selectpicker" data-style="btn-outline btn-primary">
                                             <option value="1">{{ trans('admin.rule.type.reg') }}</option>
                                             <option value="2">{{ trans('admin.rule.type.domain') }}</option>
                                             <option value="3">{{ trans('admin.rule.type.ip') }}</option>
@@ -114,7 +111,7 @@
                                 <div class="form-group row">
                                     <label class="col-md-2 col-sm-3 col-form-label" for="name">{{ trans('model.rule.name') }}</label>
                                     <div class="col-xl-6 col-sm-8">
-                                        <input type="text" class="form-control" name="name" id="name" required/>
+                                        <input class="form-control" id="name" name="name" type="text" required />
                                     </div>
                                 </div>
                             </div>
@@ -122,154 +119,161 @@
                                 <div class="form-group row">
                                     <label class="col-md-2 col-sm-3 col-form-label" for="pattern">{{ trans('model.rule.pattern') }}</label>
                                     <div class="col-xl-6 col-sm-8">
-                                        <input type="text" class="form-control" name="pattern" id="pattern" required/>
+                                        <input class="form-control" id="pattern" name="pattern" type="text" required />
                                     </div>
                                 </div>
                             </div>
                         </div>
                     </form>
                     <div class="modal-footer">
-                        <button data-dismiss="modal" class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
-                        <button type="button" class="btn btn-primary" onclick="addRule()">{{ trans('common.add') }}</button>
+                        <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
+                        <button class="btn btn-primary" type="button" onclick="addRule()">{{ trans('common.add') }}</button>
                     </div>
                 </div>
             </div>
         </div>
     @endcan
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js"></script>
-    <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('select').selectpicker('val', {{Request::query('type')}});
-      });
-
-      @can('admin.rule.store')
-      // 添加规则
-      function addRule() {
-        $.ajax({
-          method: 'POST',
-          url: "{{route('admin.rule.store')}}",
-          data: {
-            _token: '{{csrf_token()}}',
-            type: $('#add_type').val(),
-            name: $('#name').val(),
-            pattern: $('#pattern').val(),
-          },
-          dataType: 'json',
-          success: function(ret) {
-            $('#add').modal('hide');
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-          error: function(data) {
-            $('#add').modal('hide');
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({
-                title: '{{ trans('admin.hint') }}',
-                html: str,
-                icon: 'error',
-                confirmButtonText: '{{ trans('common.confirm') }}',
-              });
-            }
-          },
+        $(document).ready(function() {
+            $('select').selectpicker('val', {{ Request::query('type') }});
         });
-      }
-      @endcan
 
-      @can('admin.rule.update')
-      // 编辑规则
-      function editRule(id) {
-        $.ajax({
-          method: 'PUT',
-          url: '{{route('admin.rule.update','')}}/' + id,
-          data: {
-            _token: '{{csrf_token()}}',
-            name: $('#name_' + id).val(),
-            pattern: $('#pattern_' + id).val(),
-          },
-          dataType: 'json',
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+        @can('admin.rule.store')
+            // 添加规则
+            function addRule() {
+                $.ajax({
+                    method: 'POST',
+                    url: "{{ route('admin.rule.store') }}",
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        type: $('#add_type').val(),
+                        name: $('#name').val(),
+                        pattern: $('#pattern').val(),
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        $('#add').modal('hide');
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                    error: function(data) {
+                        $('#add').modal('hide');
+                        let str = '';
+                        const errors = data.responseJSON;
+                        if ($.isEmptyObject(errors) === false) {
+                            $.each(errors.errors, function(index, value) {
+                                str += '<li>' + value + '</li>';
+                            });
+                            swal.fire({
+                                title: '{{ trans('admin.hint') }}',
+                                html: str,
+                                icon: 'error',
+                                confirmButtonText: '{{ trans('common.confirm') }}',
+                            });
+                        }
+                    },
+                });
             }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({
-                title: '{{ trans('admin.hint') }}',
-                html: str,
-                icon: 'error',
-                confirmButtonText: '{{ trans('common.confirm') }}',
-              });
+        @endcan
+
+        @can('admin.rule.update')
+            // 编辑规则
+            function editRule(id) {
+                $.ajax({
+                    method: 'PUT',
+                    url: '{{ route('admin.rule.update', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        name: $('#name_' + id).val(),
+                        pattern: $('#pattern_' + id).val(),
+                    },
+                    dataType: 'json',
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    },
+                    error: function(data) {
+                        let str = '';
+                        const errors = data.responseJSON;
+                        if ($.isEmptyObject(errors) === false) {
+                            $.each(errors.errors, function(index, value) {
+                                str += '<li>' + value + '</li>';
+                            });
+                            swal.fire({
+                                title: '{{ trans('admin.hint') }}',
+                                html: str,
+                                icon: 'error',
+                                confirmButtonText: '{{ trans('common.confirm') }}',
+                            });
+                        }
+                    },
+                });
             }
-          },
-        });
-      }
-      @endcan
+        @endcan
 
-      @can('admin.rule.destroy')
-      // 删除规则
-      function delRule(url, name) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.rule.attribute')]) }}' + name +
-              '{{ trans('admin.confirm.delete.1') }}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: url,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          }
-        });
-      }
+        @can('admin.rule.destroy')
+            // 删除规则
+            function delRule(url, name) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.rule.attribute')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
-@endsection
+@endpush

+ 75 - 75
resources/views/admin/rule/log.blade.php

@@ -1,7 +1,4 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -9,7 +6,7 @@
                 <h2 class="panel-title">{{ trans('admin.logs.rule.title') }}</h2>
                 @can('admin.rule.clear')
                     <div class="panel-actions">
-                        <button onclick="clearLog()" class="btn btn-outline-primary">
+                        <button class="btn btn-outline-primary" onclick="clearLog()">
                             <i class="icon wb-rubber" aria-hidden="true"></i>{{ trans('admin.logs.rule.clear_all') }}
                         </button>
                     </div>
@@ -18,56 +15,60 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-2 col-md-1 col-sm-4">
-                        <input type="number" class="form-control" name="user_id" value="{{Request::query('user_id')}}" placeholder="{{ trans('model.user.id') }}"/>
+                        <input class="form-control" name="user_id" type="number" value="{{ Request::query('user_id') }}"
+                               placeholder="{{ trans('model.user.id') }}" />
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('model.user.username') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('model.user.username') }}" />
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="node_id" name="node_id">
-                            <option value="" hidden>{{ trans('model.node.attribute') }}</option>
-                            @foreach($nodes as $node)
-                                <option value="{{$node->id}}">{{$node->id . ' - ' . $node->name}}</option>
+                        <select class="form-control" id="node_id" name="node_id" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.node.attribute') }}">
+                            @foreach ($nodes as $node)
+                                <option value="{{ $node->id }}">{{ $node->id . ' - ' . $node->name }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="rule_id" name="rule_id">
-                            <option value="" hidden>{{ trans('model.rule.attribute') }}</option>
-                            @foreach($rules as $rule)
-                                <option value="{{$rule->id}}">{{$rule->name}}</option>
+                        <select class="form-control" id="rule_id" name="rule_id" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.rule.attribute') }}">
+                            @foreach ($rules as $rule)
+                                <option value="{{ $rule->id }}">{{ $rule->name }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.rule.log')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.rule.log') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> UID</th>
-                        <th> {{ trans('model.user.username') }}</th>
-                        <th> {{ trans('model.node.attribute') }}</th>
-                        <th> {{ trans('admin.logs.rule.name') }}</th>
-                        <th> {{ trans('admin.logs.rule.reason') }}</th>
-                        <th> {{ trans('admin.logs.rule.created_at') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($ruleLogs as $ruleLog)
                         <tr>
-                            <td> {{$ruleLog->id}} </td>
-                            <td> {{$ruleLog->user->id ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】'}} </td>
-                            <td> {{$ruleLog->user->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】'}} </td>
-                            <td> {{empty($ruleLog->node) ? '【'.trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]).'】' : '【'.trans('model.node.attribute').'#: ' . $ruleLog->node_id . '】' . $ruleLog->node->name}} </td>
-                            <td> {{$ruleLog->rule_id ? '⛔  ' . ($ruleLog->rule->name ?? '【'.trans('common.deleted_item', ['attribute' => trans('model.rule.attribute')]).'】') : trans('admin.logs.rule.tag')}} </td>
-                            <td> {{$ruleLog->reason}} </td>
-                            <td> {{$ruleLog->created_at}} </td>
+                            <th> #</th>
+                            <th> UID</th>
+                            <th> {{ trans('model.user.username') }}</th>
+                            <th> {{ trans('model.node.attribute') }}</th>
+                            <th> {{ trans('admin.logs.rule.name') }}</th>
+                            <th> {{ trans('admin.logs.rule.reason') }}</th>
+                            <th> {{ trans('admin.logs.rule.created_at') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($ruleLogs as $ruleLog)
+                            <tr>
+                                <td> {{ $ruleLog->id }} </td>
+                                <td> {{ $ruleLog->user->id ?? '【' . trans('common.deleted_item', ['attribute' => trans('common.account')]) . '】' }} </td>
+                                <td> {{ $ruleLog->user->username ?? '【' . trans('common.deleted_item', ['attribute' => trans('common.account')]) . '】' }} </td>
+                                <td> {{ empty($ruleLog->node) ? '【' . trans('common.deleted_item', ['attribute' => trans('model.node.attribute')]) . '】' : '【' . trans('model.node.attribute') . '#: ' . $ruleLog->node_id . '】' . $ruleLog->node->name }}
+                                </td>
+                                <td> {{ $ruleLog->rule_id ? '⛔  ' . ($ruleLog->rule->name ?? '【' . trans('common.deleted_item', ['attribute' => trans('model.rule.attribute')]) . '】') : trans('admin.logs.rule.tag') }}
+                                </td>
+                                <td> {{ $ruleLog->reason }} </td>
+                                <td> {{ $ruleLog->created_at }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -78,7 +79,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$ruleLogs->links()}}
+                            {{ $ruleLogs->links() }}
                         </nav>
                     </div>
                 </div>
@@ -86,46 +87,45 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#node_id').val({{Request::query('node_id')}});
-        $('#rule_id').val({{Request::query('rule_id')}});
-
-        $('select').on('change', function() {
-          this.form.submit();
+        $(document).ready(function() {
+            $('#node_id').selectpicker('val', @json(Request::query('node_id')));
+            $('#rule_id').selectpicker('val', @json(Request::query('rule_id')));
         });
-      });
 
-      @can('admin.rule.clear')
-      // 清除所有记录
-      function clearLog() {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '{{ trans('admin.logs.rule.clear_confirm') }}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post("{{route('admin.rule.clear')}}", {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
+        @can('admin.rule.clear')
+            // 清除所有记录
+            function clearLog() {
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'});
-              }
-            });
-          }
-        });
-      }
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.logs.rule.clear_confirm') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.post("{{ route('admin.rule.clear') }}", {
+                            _token: '{{ csrf_token() }}'
+                        }, function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                });
+                            }
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
-@endsection
+@endpush

+ 128 - 131
resources/views/admin/shop/index.blade.php

@@ -1,16 +1,14 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
-@endsection
+@extends('admin.table_layouts')
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel panel-bordered">
             <div class="panel-heading">
                 <h1 class="panel-title">
-                    <i class="icon wb-shopping-cart" aria-hidden="true"></i>{{ trans('admin.goods.title') }}</h1>
+                    <i class="icon wb-shopping-cart" aria-hidden="true"></i>{{ trans('admin.goods.title') }}
+                </h1>
                 @can('admin.goods.create')
                     <div class="panel-actions">
-                        <a href="{{route('admin.goods.create')}}" class="btn btn-primary">
+                        <a class="btn btn-primary" href="{{ route('admin.goods.create') }}">
                             <i class="icon wb-plus"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -19,101 +17,101 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" id="type" name="type">
-                            <option value="" hidden>{{ trans('model.common.type') }}</option>
+                        <select class="form-control" id="type" name="type" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.common.type') }}">
                             <option value="1">{{ trans('admin.goods.type.package') }}</option>
                             <option value="2">{{ trans('admin.goods.type.plan') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4">
-                        <select class="form-control" id="status" name="status">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="1">{{ trans('admin.goods.status.yes') }}</option>
                             <option value="0">{{ trans('admin.goods.status.no') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.goods.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.goods.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.goods.name') }}</th>
-                        <th> {{ trans('model.common.type') }}</th>
-                        <th> {{ trans('model.goods.logo') }}</th>
-                        <th> {{ trans('model.goods.traffic') }}</th>
-                        <th> {{ trans('model.goods.price') }}</th>
-                        <th> {{ trans('model.common.sort') }}</th>
-                        <th> {{ trans('admin.goods.sell_and_used') }}</th>
-                        <th> {{ trans('model.goods.hot') }}</th>
-                        <th> {{ trans('model.goods.limit_num') }}</th>
-                        <th> {{trans('common.status.attribute')}}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($goodsList as $goods)
                         <tr>
-                            <td> {{$goods->id}} </td>
-                            <td> {{$goods->name}} </td>
-                            <td>
-                                @if($goods->type === 1)
-                                    {{ trans('admin.goods.type.package') }}
-                                @elseif($goods->type === 2)
-                                    {{ trans('admin.goods.type.plan') }}
-                                @else
-                                    {{ trans('admin.goods.type.top_up') }}
-                                @endif
-                            </td>
-                            <td style="background-color: {{$goods->color ?? 'white'}}" @if($goods->color)class="text-white"@endif>
-                                @if($goods->logo)
-                                    <a href="{{asset($goods->logo)}}" target="_blank">
-                                        <img src="{{asset($goods->logo)}}" class="h-50" alt="logo"/>
-                                    </a>
-                                @elseif($goods->color)
-                                    {{ trans('common.none') }}
-                                @endif
-                            </td>
-                            <td> {{$goods->traffic_label}} </td>
-                            <td> {{$goods->price_tag}}</td>
-                            <td> {{$goods->sort}} </td>
-                            <td><code>{{$goods->use_count}} / {{$goods->total_count}}</code></td>
-                            <td>
-                                @if($goods->is_hot)
-                                    🔥
-                                @endif
-                            </td>
-                            <td>
-                                {{$goods->limit_num ?: trans('common.unlimited')}}
-                            </td>
-                            <td>
-                                @if($goods->status)
-                                    <span class="badge badge-lg badge-success">{{ trans('admin.goods.status.yes') }}</span>
-                                @else
-                                    <span class="badge badge-lg badge-default">{{ trans('admin.goods.status.no') }}</span>
-                                @endif
-                            </td>
-                            <td>
-                                @canany(['admin.goods.edit', 'admin.goods.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.goods.edit')
-                                            <a href="{{route('admin.goods.edit', $goods)}}" class="btn btn-primary">
-                                                <i class="icon wb-edit"></i>
-                                            </a>
-                                        @endcan
-                                        @can('admin.goods.destroy')
-                                            <button onclick="delGoods('{{route('admin.goods.destroy', $goods)}}','{{$goods->name}}')" class="btn btn-danger">
-                                                <i class="icon wb-trash"></i>
-                                            </button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.goods.name') }}</th>
+                            <th> {{ trans('model.common.type') }}</th>
+                            <th> {{ trans('model.goods.logo') }}</th>
+                            <th> {{ trans('model.goods.traffic') }}</th>
+                            <th> {{ trans('model.goods.price') }}</th>
+                            <th> {{ trans('model.common.sort') }}</th>
+                            <th> {{ trans('admin.goods.sell_and_used') }}</th>
+                            <th> {{ trans('model.goods.hot') }}</th>
+                            <th> {{ trans('model.goods.limit_num') }}</th>
+                            <th> {{ trans('common.status.attribute') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($goodsList as $goods)
+                            <tr>
+                                <td> {{ $goods->id }} </td>
+                                <td> {{ $goods->name }} </td>
+                                <td>
+                                    @if ($goods->type === 1)
+                                        {{ trans('admin.goods.type.package') }}
+                                    @elseif($goods->type === 2)
+                                        {{ trans('admin.goods.type.plan') }}
+                                    @else
+                                        {{ trans('admin.goods.type.top_up') }}
+                                    @endif
+                                </td>
+                                <td style="background-color: {{ $goods->color ?? 'white' }}" @if ($goods->color) class="text-white" @endif>
+                                    @if ($goods->logo)
+                                        <a href="{{ asset($goods->logo) }}" target="_blank">
+                                            <img class="h-50" src="{{ asset($goods->logo) }}" alt="logo" />
+                                        </a>
+                                    @elseif($goods->color)
+                                        {{ trans('common.none') }}
+                                    @endif
+                                </td>
+                                <td> {{ $goods->traffic_label }} </td>
+                                <td> {{ $goods->price_tag }}</td>
+                                <td> {{ $goods->sort }} </td>
+                                <td><code>{{ $goods->use_count }} / {{ $goods->total_count }}</code></td>
+                                <td>
+                                    @if ($goods->is_hot)
+                                        🔥
+                                    @endif
+                                </td>
+                                <td>
+                                    {{ $goods->limit_num ?: trans('common.unlimited') }}
+                                </td>
+                                <td>
+                                    @if ($goods->status)
+                                        <span class="badge badge-lg badge-success">{{ trans('admin.goods.status.yes') }}</span>
+                                    @else
+                                        <span class="badge badge-lg badge-default">{{ trans('admin.goods.status.no') }}</span>
+                                    @endif
+                                </td>
+                                <td>
+                                    @canany(['admin.goods.edit', 'admin.goods.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.goods.edit')
+                                                <a class="btn btn-primary" href="{{ route('admin.goods.edit', $goods) }}">
+                                                    <i class="icon wb-edit"></i>
+                                                </a>
+                                            @endcan
+                                            @can('admin.goods.destroy')
+                                                <button class="btn btn-danger" onclick="delGoods('{{ route('admin.goods.destroy', $goods) }}','{{ $goods->name }}')">
+                                                    <i class="icon wb-trash"></i>
+                                                </button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -124,7 +122,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$goodsList->links()}}
+                            {{ $goodsList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -132,53 +130,52 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#type').val({{Request::query('type')}});
-        $('#status').val({{Request::query('status')}});
-
-        $('select').on('change', function() {
-          this.form.submit();
+        $(document).ready(function() {
+            $('#type').selectpicker('val', @json(Request::query('type')));
+            $('#status').selectpicker('val', @json(Request::query('status')));
         });
-      });
 
-      @can('admin.goods.destroy')
-      // 删除商品
-      function delGoods(url, name) {
-        swal.fire({
-          title: '{{ trans('common.warning') }}',
-          text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.goods.attribute')]) }}' + name +
-              '{{ trans('admin.confirm.delete.1') }}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.cancel') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              url: url,
-              method: 'DELETE',
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          }
-        });
-      }
+        @can('admin.goods.destroy')
+            // 删除商品
+            function delGoods(url, name) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.goods.attribute')]) }}' + name +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.cancel') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            url: url,
+                            method: 'DELETE',
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
-@endsection
+@endpush

+ 132 - 126
resources/views/admin/shop/info.blade.php

@@ -14,18 +14,19 @@
                     {{ isset($good) ? trans('admin.action.edit_item', ['attribute' => trans('model.goods.attribute')]) : trans('admin.action.add_item', ['attribute' => trans('model.goods.attribute')]) }}
                 </h1>
                 <div class="panel-actions">
-                    <a href="{{route('admin.goods.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.goods.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action=@isset($good){{route('admin.goods.update', $good)}} @else {{route('admin.goods.store')}} @endisset method="post"
-                      enctype="multipart/form-data" class="form-horizontal" role="form">@csrf
+                <form class="form-horizontal" role="form"
+                      action=@isset($good){{ route('admin.goods.update', $good) }} @else {{ route('admin.goods.store') }} @endisset
+                      method="post" enctype="multipart/form-data">@csrf
                     @isset($good)
                         @method('PUT')
                     @endisset
@@ -35,11 +36,11 @@
                                 <label class="col-md-2 col-form-label">{{ trans('model.common.type') }}</label>
                                 <div class="col-md-10 align-items-center">
                                     <div class="radio-custom radio-primary radio-inline">
-                                        <input type="radio" name="type" id="data_package" value="1"/>
+                                        <input id="data_package" name="type" type="radio" value="1" />
                                         <label for="data_package">{{ trans('admin.goods.type.package') }}</label>
                                     </div>
                                     <div class="radio-custom radio-primary radio-inline">
-                                        <input type="radio" name="type" id="data_plan" value="2" checked/>
+                                        <input id="data_plan" name="type" type="radio" value="2" checked />
                                         <label for="data_plan">{{ trans('admin.goods.type.plan') }}</label>
                                     </div>
                                     <span class="text-help"> {{ trans('admin.goods.info.type_hint') }} </span>
@@ -48,34 +49,36 @@
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="name">{{ trans('model.goods.name') }}</label>
                                 <div class="col-md-4">
-                                    <input type="text" class="form-control" name="name" id="name" required/>
+                                    <input class="form-control" id="name" name="name" type="text" required />
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="price">{{ trans('model.goods.price') }}</label>
                                 <div class="col-md-4 input-group">
                                     <div class="input-group-prepend">
-                                        <span class="input-group-text">{{array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')]}}</span>
+                                        <span
+                                              class="input-group-text">{{ array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')] }}</span>
                                     </div>
-                                    <input type="number" class="form-control" name="price" id="price" step="0.01" required/>
+                                    <input class="form-control" id="price" name="price" type="number" step="0.01" required />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label for="level" class="col-md-2 col-form-label">{{ trans('model.goods.category') }}</label>
+                                <label class="col-md-2 col-form-label" for="level">{{ trans('model.goods.category') }}</label>
                                 <div class="col-md-4">
-                                    <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="form-control" name="category_id" id="category_id">
+                                    <select class="form-control" id="category_id" name="category_id" data-plugin="selectpicker"
+                                            data-style="btn-outline btn-primary">
                                         @foreach ($categories as $category)
-                                            <option value="{{$category->id}}">{{$category->name}}</option>
+                                            <option value="{{ $category->id }}">{{ $category->name }}</option>
                                         @endforeach
                                     </select>
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label for="level" class="col-md-2 col-form-label">{{ trans('model.common.level') }}</label>
+                                <label class="col-md-2 col-form-label" for="level">{{ trans('model.common.level') }}</label>
                                 <div class="col-md-4">
-                                    <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="form-control" name="level" id="level">
+                                    <select class="form-control" id="level" name="level" data-plugin="selectpicker" data-style="btn-outline btn-primary">
                                         @foreach ($levels as $level)
-                                            <option value="{{$level->level}}">{{$level->name}}</option>
+                                            <option value="{{ $level->level }}">{{ $level->name }}</option>
                                         @endforeach
                                     </select>
                                 </div>
@@ -84,15 +87,16 @@
                                 <label class="col-md-2 col-form-label" for="renew">{{ trans('model.goods.renew') }}</label>
                                 <div class="col-md-4 input-group">
                                     <div class="input-group-prepend">
-                                        <span class="input-group-text">{{array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')]}}</span>
+                                        <span
+                                              class="input-group-text">{{ array_column(config('common.currency'), 'symbol', 'code')[sysConfig('standard_currency')] }}</span>
                                     </div>
-                                    <input type="number" class="form-control" name="renew" id="renew" step="0.01" value="0"/>
+                                    <input class="form-control" id="renew" name="renew" type="number" value="0" step="0.01" />
                                 </div>
                             </div>
                             <div class="form-group row package-renew">
                                 <label class="col-md-2 col-form-label" for="speed_limit">{{ trans('model.goods.user_limit') }}</label>
                                 <div class="col-md-4 input-group">
-                                    <input type="number" style="width: 30%" class="form-control" name="speed_limit" id="speed_limit" value="0"/>
+                                    <input class="form-control" id="speed_limit" name="speed_limit" type="number" value="0" style="width: 30%" />
                                     <span class="input-group-text"> Mbps</span>
                                     <span class="text-help"> {{ trans('admin.zero_unlimited_hint') }} </span>
                                 </div>
@@ -100,7 +104,7 @@
                             <div class="form-group row package-renew">
                                 <label class="col-md-2 col-form-label" for="period">{{ trans('model.goods.period') }}</label>
                                 <div class="col-md-4 input-group">
-                                    <input type="number" class="form-control" name="period" id="period" value="30"/>
+                                    <input class="form-control" id="period" name="period" type="number" value="30" />
                                     <span class="input-group-text"> {{ trans_choice('common.days.attribute', 1) }}</span>
                                     <span class="text-help"> {{ trans('admin.goods.info.period_hint') }} </span>
                                 </div>
@@ -108,8 +112,9 @@
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="traffic">{{ trans('model.goods.traffic') }}</label>
                                 <div class="col-md-4 input-group">
-                                    <input type="number" class="form-control" name="traffic" id="traffic" value="100"/>
-                                    <select data-plugin="selectpicker" data-style="btn-outline btn-primary" class="form-control" name="traffic_unit" id="traffic_unit">
+                                    <input class="form-control" id="traffic" name="traffic" type="number" value="100" />
+                                    <select class="form-control" id="traffic_unit" name="traffic_unit" data-plugin="selectpicker"
+                                            data-style="btn-outline btn-primary">
                                         <option value="1" selected>MB</option>
                                         <option value="1024">GB</option>
                                         <option value="1048576">TB</option>
@@ -120,13 +125,13 @@
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="invite_num">{{ trans('model.goods.invite_num') }}</label>
                                 <div class="col-md-4">
-                                    <input type="number" class="form-control" name="invite_num" id="invite_num" value="0" required/>
+                                    <input class="form-control" id="invite_num" name="invite_num" type="number" value="0" required />
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="limit_num">{{ trans('model.goods.limit_num') }}</label>
                                 <div class="col-md-4 input-group">
-                                    <input type="number" class="form-control" name="limit_num" id="limit_num" value="0" required/>
+                                    <input class="form-control" id="limit_num" name="limit_num" type="number" value="0" required />
                                     <span class="input-group-text">{{ trans('admin.times') }}</span>
                                     <span class="text-help"> {{ trans('admin.goods.info.limit_num_hint') }} </span>
                                 </div>
@@ -134,7 +139,7 @@
                             <div class="form-group row package-renew">
                                 <label class="col-md-2 col-form-label" for="days">{{ trans('model.goods.available_date') }}</label>
                                 <div class="col-md-4 input-group">
-                                    <input type="number" class="form-control" name="days" id="days" value="30"/>
+                                    <input class="form-control" id="days" name="days" type="number" value="30" />
                                     <span class="input-group-text">{{ trans_choice('common.days.attribute', 1) }}</span>
                                     <span class="text-help"> {{ trans('admin.goods.info.available_date_hint') }} </span>
                                 </div>
@@ -144,52 +149,54 @@
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="is_hot">{{ trans('model.goods.hot') }}</label>
                                 <div class="col-md-10">
-                                    <input type="checkbox" data-toggle="switch" name="is_hot" id="is_hot" data-on-color="primary" data-off-color="default"
-                                           data-on-text="{{ trans('admin.yes') }}" data-off-text="{{ trans('admin.no') }}" data-size="small">
+                                    <input id="is_hot" name="is_hot" data-toggle="switch" data-on-color="primary" data-off-color="default"
+                                           data-on-text="{{ trans('admin.yes') }}" data-off-text="{{ trans('admin.no') }}" data-size="small" type="checkbox">
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="status">{{ trans('common.status.attribute') }}</label>
                                 <div class="col-md-10">
-                                    <input type="checkbox" data-toggle="switch" name="status" id="status" data-on-color="primary" data-off-color="default"
-                                           data-on-text="{{ trans('admin.goods.status.yes') }}" data-off-text="{{ trans('admin.goods.status.no') }}" data-size="small">
+                                    <input id="status" name="status" data-toggle="switch" data-on-color="primary" data-off-color="default"
+                                           data-on-text="{{ trans('admin.goods.status.yes') }}" data-off-text="{{ trans('admin.goods.status.no') }}"
+                                           data-size="small" type="checkbox">
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="sort">{{ trans('model.common.sort') }}</label>
                                 <div class="col-md-4">
-                                    <input type="number" class="form-control" name="sort" id="sort" value="0" min="0" max="255"/>
+                                    <input class="form-control" id="sort" name="sort" type="number" value="0" min="0" max="255" />
                                     <span class="text-help"> {{ trans('admin.sort_asc') }} </span>
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="color">{{ trans('model.goods.color') }}</label>
                                 <div class="col-md-4">
-                                    <input type="text" class="form-control" name="color" id="color" data-plugin="asColorPicker" data-mode="simple" value="#A57AFA"/>
+                                    <input class="form-control" id="color" name="color" data-plugin="asColorPicker" data-mode="simple" type="text"
+                                           value="#A57AFA" />
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="logo">{{ trans('model.goods.logo') }}</label>
                                 <div class="col-md-6">
-                                    <input type="file" id="logo" name="logo" data-plugin="dropify" data-default-file="{{asset($good->logo ?? '/assets/images/default.png')}}"/>
+                                    <input id="logo" name="logo" data-plugin="dropify"
+                                           data-default-file="{{ asset($good->logo ?? '/assets/images/default.png') }}" type="file" />
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="description">{{ trans('model.common.description') }}</label>
                                 <div class="col-md-8">
-                                    <textarea class="form-control" rows="2" name="description" id="description"
-                                              placeholder="{{ trans('admin.goods.info.desc_placeholder') }}"></textarea>
+                                    <textarea class="form-control" id="description" name="description" rows="2" placeholder="{{ trans('admin.goods.info.desc_placeholder') }}"></textarea>
                                 </div>
                             </div>
                             <div class="form-group row">
                                 <label class="col-md-2 col-form-label" for="info">{{ trans('model.goods.info') }}</label>
                                 <div class="col-md-8">
-                                    <textarea class="form-control" rows="6" name="info" id="info" placeholder="{{ trans('admin.goods.info.list_placeholder') }}"></textarea>
+                                    <textarea class="form-control" id="info" name="info" rows="6" placeholder="{{ trans('admin.goods.info.list_placeholder') }}"></textarea>
                                     <span class="text-help"> {!! trans('admin.goods.info.list_hint') !!}</span>
                                 </div>
                             </div>
                             <div class="form-actions col-12 text-right">
-                                <button type="submit" class="btn btn-success">
+                                <button class="btn btn-success" type="submit">
                                     <i class="icon wb-check"></i>{{ trans('common.submit') }}</button>
                             </div>
                         </div>
@@ -210,97 +217,96 @@
     <script src="/assets/global/js/Plugin/ascolorpicker.js"></script>
     <script src="/assets/global/js/Plugin/dropify.js"></script>
     <script>
-      $('[data-toggle="switch"]').bootstrapSwitch();
-      @isset($good)
-      $(document).ready(function() {
-        const type = $('input[name=\'type\']');
-        $('#id').val('{{$good->id}}');
-        $("input[name='type'][value='{{$good->type}}']").click();
-        type.attr('disabled', true);
-        $('#name').val('{{$good->name}}');
-        $('#price').val('{{$good->price}}');
-        $('#level').selectpicker('val', '{{$good->level}}');
-          @if ($good->type == 2)
-          $('#renew').val('{{$good->renew}}');
-        $('#speed_limit').val('{{$good->speed_limit}}');
-        $('#period').val('{{$good->period}}');
-        $('#days').val('{{$good->days}}').attr('disabled', true);
-          @endif
-          $('#invite_num').val('{{$good->invite_num}}');
-        $('#limit_num').val('{{$good->limit_num}}');
-          @if ($good->is_hot)
-          $('#is_hot').click();
-          @endif
-          @if ($good->status)
-          $('#status').click();
-          @endif
-          $('#sort').val('{{$good->sort}}');
-        $('#color').asColorPicker('val', '{{$good->color}}');
-        $('#description').val(@json($good->description));
-        $('#info').val(@json($good->info));
-        $('#category_id').selectpicker('val', '{{$good->category_id}}');
-        const trafficUnit = $('#traffic_unit');
-        const traffic = $('#traffic');
-          @if($good->traffic >= 1073741824)
-          traffic.val('{{$good->traffic/1073741824}}');
-        trafficUnit.selectpicker('val', '1073741824');
-          @elseif($good->traffic >= 1048576)
-          traffic.val('{{$good->traffic/1048576}}');
-        trafficUnit.selectpicker('val', '1048576');
-          @elseif($good->traffic >= 1024)
-          traffic.val('{{$good->traffic/1024}}');
-        trafficUnit.selectpicker('val', '1024');
-          @else
-          traffic.val('{{$good->traffic}}');
-          @endif
-          traffic.attr('disabled', true);
-        trafficUnit.attr('disabled', true).selectpicker('refresh');
-      });
-      @elseif(old('type'))
-      $(document).ready(function() {
-        const type = $('input[name=\'type\']');
-        $('#id').val('{{old('id')}}');
-        $("input[name='type'][value='{{old('type')}}']").click();
-        $('#name').val('{{old('name')}}');
-        $('#price').val('{{old('price')}}');
-        $('#level').selectpicker('val', '{{old('level')}}');
-          @if (old('type') == 2)
-          $('#renew').val('{{old('renew',0)}}');
-        $('#speed_limit').val('{{old('speed_limit',0)}}');
-        $('#period').val('{{old('period',0)}}');
-        $('#days').val('{{old('days',0)}}');
-          @endif
-          $('#traffic').val('{{old('traffic')}}');
-        $('#traffic_unit').selectpicker('val', '{{old('traffic_unit')}}');
-        $('#invite_num').val('{{old('invite_num')}}');
-        $('#limit_num').val('{{old('limit_num')}}');
-          @if (old('is_hot'))
-          $('#is_hot').click();
-          @endif
-          @if (old('status'))
-          $('#status').click();
-          @endif
-          $('#sort').val('{{old('sort')}}');
-        $('#color').asColorPicker('val', '{{old('color')}}');
-        $('#description').val('{{old('description')}}');
-        $('#info').val('{{old('info')}}');
-      });
-      @else
-      $('#status').click();
+        $('[data-toggle="switch"]').bootstrapSwitch();
+        @isset($good)
+            $(document).ready(function() {
+                const type = $('input[name=\'type\']');
+                $('#id').val('{{ $good->id }}');
+                $("input[name='type'][value='{{ $good->type }}']").click();
+                type.attr('disabled', true);
+                $('#name').val('{{ $good->name }}');
+                $('#price').val('{{ $good->price }}');
+                $('#level').selectpicker('val', '{{ $good->level }}');
+                @if ($good->type == 2)
+                    $('#renew').val('{{ $good->renew }}');
+                    $('#speed_limit').val('{{ $good->speed_limit }}');
+                    $('#period').val('{{ $good->period }}');
+                    $('#days').val('{{ $good->days }}').attr('disabled', true);
+                @endif
+                $('#invite_num').val('{{ $good->invite_num }}');
+                $('#limit_num').val('{{ $good->limit_num }}');
+                @if ($good->is_hot)
+                    $('#is_hot').click();
+                @endif
+                @if ($good->status)
+                    $('#status').click();
+                @endif
+                $('#sort').val('{{ $good->sort }}');
+                $('#color').asColorPicker('val', '{{ $good->color }}');
+                $('#description').val(@json($good->description));
+                $('#info').val(@json($good->info));
+                $('#category_id').selectpicker('val', '{{ $good->category_id }}');
+                const trafficUnit = $('#traffic_unit');
+                const traffic = $('#traffic');
+                @if ($good->traffic >= 1073741824)
+                    traffic.val('{{ $good->traffic / 1073741824 }}');
+                    trafficUnit.selectpicker('val', '1073741824');
+                @elseif ($good->traffic >= 1048576)
+                    traffic.val('{{ $good->traffic / 1048576 }}');
+                    trafficUnit.selectpicker('val', '1048576');
+                @elseif ($good->traffic >= 1024)
+                    traffic.val('{{ $good->traffic / 1024 }}');
+                    trafficUnit.selectpicker('val', '1024');
+                @else
+                    traffic.val('{{ $good->traffic }}');
+                @endif
+                traffic.attr('disabled', true);
+                trafficUnit.attr('disabled', true).selectpicker('refresh');
+            });
+        @elseif (old('type'))
+            $(document).ready(function() {
+                const type = $('input[name=\'type\']');
+                $('#id').val('{{ old('id') }}');
+                $("input[name='type'][value='{{ old('type') }}']").click();
+                $('#name').val('{{ old('name') }}');
+                $('#price').val('{{ old('price') }}');
+                $('#level').selectpicker('val', '{{ old('level') }}');
+                @if (old('type') == 2)
+                    $('#renew').val('{{ old('renew', 0) }}');
+                    $('#speed_limit').val('{{ old('speed_limit', 0) }}');
+                    $('#period').val('{{ old('period', 0) }}');
+                    $('#days').val('{{ old('days', 0) }}');
+                @endif
+                $('#traffic').val('{{ old('traffic') }}');
+                $('#traffic_unit').selectpicker('val', '{{ old('traffic_unit') }}');
+                $('#invite_num').val('{{ old('invite_num') }}');
+                $('#limit_num').val('{{ old('limit_num') }}');
+                @if (old('is_hot'))
+                    $('#is_hot').click();
+                @endif
+                @if (old('status'))
+                    $('#status').click();
+                @endif
+                $('#sort').val('{{ old('sort') }}');
+                $('#color').asColorPicker('val', '{{ old('color') }}');
+                $('#description').val('{{ old('description') }}');
+                $('#info').val('{{ old('info') }}');
+            });
+        @else
+            $('#status').click();
+        @endisset
 
-      @endisset
-
-      function itemControl(value) {
-        if (value === 1) {
-          $('.package-renew').hide();
-        } else {
-          $('.package-renew').show();
+        function itemControl(value) {
+            if (value === 1) {
+                $('.package-renew').hide();
+            } else {
+                $('.package-renew').show();
+            }
         }
-      }
 
-      // 选择商品类型
-      $('input[name=\'type\']').change(function() {
-        itemControl(parseInt($(this).val()));
-      });
+        // 选择商品类型
+        $('input[name=\'type\']').change(function() {
+            itemControl(parseInt($(this).val()));
+        });
     </script>
 @endsection

+ 91 - 79
resources/views/admin/subscribe/index.blade.php

@@ -1,13 +1,12 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
+@extends('admin.table_layouts')
+@push('css')
     <style>
         .table th a {
             color: #76838f;
             text-decoration: none;
         }
     </style>
-@endsection
+@endpush
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -17,77 +16,80 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-1 col-sm-6">
-                        <input type="number" class="form-control" name="user_id" value="{{Request::query('user_id')}}" placeholder="{{ trans('model.user.id') }}"/>
+                        <input class="form-control" name="user_id" type="number" value="{{ Request::query('user_id') }}" placeholder="{{ trans('model.user.id') }}" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('model.user.username') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('model.user.username') }}" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="code" value="{{Request::query('code')}}" placeholder="{{ trans('model.subscribe.code') }}"/>
+                        <input class="form-control" name="code" type="text" value="{{ Request::query('code') }}"
+                               placeholder="{{ trans('model.subscribe.code') }}" />
                     </div>
                     <div class="form-group col-lg-3 col-sm-6">
-                        <select name="status" id="status" class="form-control" onchange="this.form.submit()">
-                            <option value="" hidden>{{ trans('common.status.attribute') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('common.status.attribute') }}">
                             <option value="0">{{ trans('common.status.banned') }}</option>
                             <option value="1">{{ trans('common.status.normal') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.subscribe.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.subscribe.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> @sortablelink('id', '#')</th>
-                        <th> {{ trans('model.user.username') }}</th>
-                        <th> {{ trans('model.subscribe.code') }}</th>
-                        <th> @sortablelink('times', trans('model.subscribe.req_times'))</th>
-                        <th> {{ trans('model.subscribe.updated_at') }}</th>
-                        <th> {{ trans('model.subscribe.ban_time') }}</th>
-                        <th> {{ trans('model.subscribe.ban_desc') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
+                        <tr>
+                            <th> @sortablelink('id', '#')</th>
+                            <th> {{ trans('model.user.username') }}</th>
+                            <th> {{ trans('model.subscribe.code') }}</th>
+                            <th> @sortablelink('times', trans('model.subscribe.req_times'))</th>
+                            <th> {{ trans('model.subscribe.updated_at') }}</th>
+                            <th> {{ trans('model.subscribe.ban_time') }}</th>
+                            <th> {{ trans('model.subscribe.ban_desc') }}</th>
+                            <th> {{ trans('common.action') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($subscribeList as $subscribe)
-                        <tr>
-                            <td> {{$subscribe->id}} </td>
-                            <td>
-                                @if($subscribe->has('user'))
-                                    @can('admin.user.index')
-                                        <a href="{{route('admin.user.index', ['id'=>$subscribe->user->id])}}" target="_blank">{{$subscribe->user->username}}</a>
+                        @foreach ($subscribeList as $subscribe)
+                            <tr>
+                                <td> {{ $subscribe->id }} </td>
+                                <td>
+                                    @if ($subscribe->has('user'))
+                                        @can('admin.user.index')
+                                            <a href="{{ route('admin.user.index', ['id' => $subscribe->user->id]) }}"
+                                               target="_blank">{{ $subscribe->user->username }}</a>
+                                        @else
+                                            {{ $subscribe->user->username }}
+                                        @endcan
                                     @else
-                                        {{$subscribe->user->username}}
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
+                                    @endif
+                                </td>
+                                <td> {{ $subscribe->code }} </td>
+                                <td>
+                                    @can('admin.subscribe.log')
+                                        <a href="{{ route('admin.subscribe.log', $subscribe) }}" target="_blank">{{ $subscribe->times }}</a>
                                     @endcan
-                                @else
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @endif
-                            </td>
-                            <td> {{$subscribe->code}} </td>
-                            <td>
-                                @can('admin.subscribe.log')
-                                    <a href="{{route('admin.subscribe.log', $subscribe)}}" target="_blank">{{$subscribe->times}}</a>
-                                @endcan
-                            </td>
-                            <td> {{$subscribe->updated_at}} </td>
-                            <td> {{$subscribe->ban_time ? date('Y-m-d H:i', $subscribe->ban_time): ''}} </td>
-                            <td> {{ __($subscribe->ban_desc) }} </td>
-                            <td>
-                                @can('admin.subscribe.set')
-                                    <button class="btn btn-sm @if($subscribe->status === 0) btn-outline-success @else btn-outline-danger @endif"
-                                            onclick="setSubscribeStatus('{{route('admin.subscribe.set', $subscribe)}}')">
-                                        @if($subscribe->status === 0)
-                                            {{ trans('common.status.enabled') }}
-                                        @else
-                                            {{ trans('common.status.banned') }}
-                                        @endif
-                                    </button>
-                                @endcan
-                            </td>
-                        </tr>
-                    @endforeach
+                                </td>
+                                <td> {{ $subscribe->updated_at }} </td>
+                                <td> {{ $subscribe->ban_time ? date('Y-m-d H:i', $subscribe->ban_time) : '' }} </td>
+                                <td> {{ __($subscribe->ban_desc) }} </td>
+                                <td>
+                                    @can('admin.subscribe.set')
+                                        <button class="btn btn-sm @if ($subscribe->status === 0) btn-outline-success @else btn-outline-danger @endif"
+                                                onclick="setSubscribeStatus('{{ route('admin.subscribe.set', $subscribe) }}')">
+                                            @if ($subscribe->status === 0)
+                                                {{ trans('common.status.enabled') }}
+                                            @else
+                                                {{ trans('common.status.banned') }}
+                                            @endif
+                                        </button>
+                                    @endcan
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -98,7 +100,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$subscribeList->links()}}
+                            {{ $subscribeList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -106,29 +108,39 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script>
-      $(document).ready(function() {
-        $('#status').val({{Request::query('status')}});
-      });
-
-      @can('admin.subscribe.set')
-      // 启用禁用用户的订阅
-      function setSubscribeStatus(url) {
-        $.post(url, {_token: '{{csrf_token()}}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
-            });
-          } else {
-            swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
-            });
-          }
+        $(document).ready(function() {
+            $('#status').selectpicker('val', @json(Request::query('status')));
         });
-      }
+
+        @can('admin.subscribe.set')
+            // 启用禁用用户的订阅
+            function setSubscribeStatus(url) {
+                $.post(url, {
+                    _token: '{{ csrf_token() }}'
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => {
+                            window.location.reload();
+                        });
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => {
+                            window.location.reload();
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
-@endsection
+@endpush

+ 68 - 51
resources/views/admin/subscribe/log.blade.php

@@ -12,10 +12,10 @@
             <div class="panel-body row">
                 <form class="form-row col-12">
                     <div class="form-group col-xxl-1 col-lg-2 col-md-3">
-                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="ID"/>
+                        <input class="form-control" name="id" type="number" value="{{ Request::query('id') }}" placeholder="ID" />
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-6">
-                        <input type="text" class="form-control" name="ip" value="{{Request::query('ip')}}" placeholder="IP"/>
+                        <input class="form-control" name="ip" type="text" value="{{ Request::query('ip') }}" placeholder="IP" />
                     </div>
                     <div class="form-group col-xxl-3 col-lg-5">
                         <div class="input-group input-daterange" data-plugin="datepicker">
@@ -24,27 +24,31 @@
                                     <i class="icon wb-calendar" aria-hidden="true"></i>
                                 </span>
                             </div>
-                            <input type="text" class="form-control" name="start" value="{{Request::query('start')}}" placeholder="{{ trans('admin.start_time') }}" autocomplete="off"/>
+                            <input class="form-control" name="start" type="text" value="{{ Request::query('start') }}"
+                                   placeholder="{{ trans('admin.start_time') }}" autocomplete="off" />
                             <div class="input-group-prepend">
                                 <span class="input-group-text">{{ trans('common.to') }}</span>
                             </div>
-                            <input type="text" class="form-control" name="end" value="{{Request::query('end')}}" placeholder="{{ trans('admin.end_time') }}" autocomplete="off"/>
+                            <input class="form-control" name="end" type="text" value="{{ Request::query('end') }}"
+                                   placeholder="{{ trans('admin.end_time') }}" autocomplete="off" />
                         </div>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-2 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.subscribe.log', $subscribe->user->id)}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.subscribe.log', $subscribe->user->id) }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <div class="col-sm-12 col-xl-2">
                     <ul class="list-group list-group-gap">
                         <li class="list-group-item bg-blue-grey-100">
                             <i class="icon wb-user-circle" aria-hidden="true"></i> {{ trans('model.user.nickname') }}:
-                            <span class="float-right">{{ $subscribe->user->nickname ?? trans('common.deleted_item', ['attribute' => trans('common.account')])}}</span>
+                            <span
+                                  class="float-right">{{ $subscribe->user->nickname ?? trans('common.deleted_item', ['attribute' => trans('common.account')]) }}</span>
                         </li>
                         <li class="list-group-item bg-blue-grey-100">
                             <i class="icon wb-envelope" aria-hidden="true"></i> {{ trans('model.user.username') }}:
-                            <span class="float-right">{{ $subscribe->user->username ?? trans('common.deleted_item', ['attribute' => trans('model.user.attribute')])}}</span>
+                            <span
+                                  class="float-right">{{ $subscribe->user->username ?? trans('common.deleted_item', ['attribute' => trans('model.user.attribute')]) }}</span>
                         </li>
                         <li class="list-group-item bg-blue-grey-100">
                             <i class="icon wb-heart" aria-hidden="true"></i> {{ trans('common.status.attribute') }}:
@@ -58,10 +62,10 @@
                             <i class="icon wb-time" aria-hidden="true"></i> {{ trans('model.subscribe.updated_at') }}:
                             <span class="float-right">{{ $subscribe->updated_at }}</span>
                         </li>
-                        @if($subscribe->ban_time)
+                        @if ($subscribe->ban_time)
                             <li class="list-group-item bg-blue-grey-100">
                                 <i class="icon wb-power" aria-hidden="true"></i> {{ trans('model.subscribe.ban_time') }}
-                                : <span class="float-right">{{ date('Y-m-d H:i', $subscribe->ban_time ) }}</span>
+                                : <span class="float-right">{{ date('Y-m-d H:i', $subscribe->ban_time) }}</span>
                             </li>
                             <li class="list-group-item bg-blue-grey-100">
                                 <i class="icon wb-lock" aria-hidden="true"></i> {{ trans('model.subscribe.ban_desc') }}:
@@ -69,8 +73,9 @@
                             </li>
                         @endif
                         @can('admin.subscribe.set')
-                            <button class="list-group-item btn btn-block @if($subscribe->status) btn-danger @else btn-success @endif" onclick="setSubscribeStatus('{{route('admin.subscribe.set', $subscribe)}}')">
-                                @if($subscribe->status === 0)
+                            <button class="list-group-item btn btn-block @if ($subscribe->status) btn-danger @else btn-success @endif"
+                                    onclick="setSubscribeStatus('{{ route('admin.subscribe.set', $subscribe) }}')">
+                                @if ($subscribe->status === 0)
                                     <i class="icon wb-unlock" aria-hidden="true"></i> {{ trans('common.status.enabled') }}
                                 @else
                                     <i class="icon wb-unlock" aria-hidden="true"></i> {{ trans('common.status.disabled') }}
@@ -82,28 +87,28 @@
                 <div class="col-sm-12 col-xl-10">
                     <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                         <thead class="thead-default">
-                        <tr>
-                            <th> #</th>
-                            <th> {{ trans('model.subscribe.req_ip') }}</th>
-                            <th> {{ trans('model.ip.info') }}</th>
-                            <th> {{ trans('model.subscribe.req_times') }}</th>
-                            <th> {{ trans('model.subscribe.req_header') }}</th>
-                        </tr>
-                        </thead>
-                        <tbody>
-                        @foreach($subscribeLog as $subscribe)
                             <tr>
-                                <td>{{$subscribe->id}}</td>
-                                <td>
-                                    @if ($subscribe->request_ip)
-                                        <a href="https://db-ip.com/{{$subscribe->request_ip}}" target="_blank">{{$subscribe->request_ip}}</a>
-                                    @endif
-                                </td>
-                                <td>{{$subscribe->ipInfo}}</td>
-                                <td>{{$subscribe->request_time}}</td>
-                                <td>{{trim($subscribe->request_header)}}</td>
+                                <th> #</th>
+                                <th> {{ trans('model.subscribe.req_ip') }}</th>
+                                <th> {{ trans('model.ip.info') }}</th>
+                                <th> {{ trans('model.subscribe.req_times') }}</th>
+                                <th> {{ trans('model.subscribe.req_header') }}</th>
                             </tr>
-                        @endforeach
+                        </thead>
+                        <tbody>
+                            @foreach ($subscribeLog as $subscribe)
+                                <tr>
+                                    <td>{{ $subscribe->id }}</td>
+                                    <td>
+                                        @if ($subscribe->request_ip)
+                                            <a href="https://db-ip.com/{{ $subscribe->request_ip }}" target="_blank">{{ $subscribe->request_ip }}</a>
+                                        @endif
+                                    </td>
+                                    <td>{{ $subscribe->ipInfo }}</td>
+                                    <td>{{ $subscribe->request_time }}</td>
+                                    <td>{{ trim($subscribe->request_header) }}</td>
+                                </tr>
+                            @endforeach
                         </tbody>
                     </table>
                 </div>
@@ -115,7 +120,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$subscribeLog->links()}}
+                            {{ $subscribeLog->links() }}
                         </nav>
                     </div>
                 </div>
@@ -129,25 +134,37 @@
     <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $('.input-daterange').datepicker({
-        format: 'yyyy-mm-dd',
-      });
-
-      @can('admin.subscribe.set')
-      // 启用禁用用户的订阅
-      function setSubscribeStatus(url) {
-        $.post(url, {_token: '{{csrf_token()}}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
-            });
-          } else {
-            swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false}).then(() => {
-              window.location.reload();
-            });
-          }
+        $('.input-daterange').datepicker({
+            format: 'yyyy-mm-dd',
         });
-      }
+
+        @can('admin.subscribe.set')
+            // 启用禁用用户的订阅
+            function setSubscribeStatus(url) {
+                $.post(url, {
+                    _token: '{{ csrf_token() }}'
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => {
+                            window.location.reload();
+                        });
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error',
+                            timer: 1000,
+                            showConfirmButton: false
+                        }).then(() => {
+                            window.location.reload();
+                        });
+                    }
+                });
+            }
         @endcan
     </script>
 @endsection

+ 18 - 0
resources/views/admin/table_layouts.blade.php

@@ -0,0 +1,18 @@
+@extends('admin.layouts')
+@section('css')
+    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
+    <link href="/assets/global/vendor/bootstrap-select/bootstrap-select.min.css" rel="stylesheet">
+    @stack('css')
+@endsection
+@section('javascript')
+    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
+    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+    <script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js"></script>
+    <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
+    <script>
+        $('select').on('change', function() {
+            this.form.submit()
+        })
+    </script>
+    @stack('javascript')
+@endsection

+ 138 - 132
resources/views/admin/ticket/index.blade.php

@@ -10,9 +10,9 @@
                 @can('admin.ticket.store')
                     <div class="panel-actions">
                         <button class="btn btn-primary btn-animate btn-animate-side" data-toggle="modal" data-target="#add_ticket_modal">
-                        <span>
-                            <i class="icon wb-plus" aria-hidden="true"></i> {{trans('user.ticket.new')}}
-                        </span>
+                            <span>
+                                <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('user.ticket.new') }}
+                            </span>
                         </button>
                     </div>
                 @endcan
@@ -20,61 +20,61 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-lg-3 col-sm-6">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('model.user.username') }}"
-                               autocomplete="off"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('model.user.username') }}" autocomplete="off" />
                     </div>
                     <div class="form-group col-lg-2 col-sm-6 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.ticket.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.ticket.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.user.username') }}</th>
-                        <th> {{ trans('validation.attributes.title') }}</th>
-                        <th> {{ trans('common.status.attribute') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('model.user.username') }}</th>
+                            <th> {{ trans('validation.attributes.title') }}</th>
+                            <th> {{ trans('common.status.attribute') }}</th>
+                            <th> {{ trans('common.action') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($ticketList as $ticket)
-                        <tr>
-                            <td> {{$ticket->id}} </td>
-                            <td>
-                                @if(!$ticket->user)
-                                    【{{trans('common.deleted_item', ['attribute' => trans('common.account')])}}】
-                                @else
-                                    @can('admin.user.index')
-                                        <a href="{{route('admin.user.index', ['id' => $ticket->user->id])}}" target="_blank">{{$ticket->user->username}}</a>
+                        @foreach ($ticketList as $ticket)
+                            <tr>
+                                <td> {{ $ticket->id }} </td>
+                                <td>
+                                    @if (!$ticket->user)
+                                        【{{ trans('common.deleted_item', ['attribute' => trans('common.account')]) }}】
                                     @else
-                                        {{$ticket->user->username}}
-                                    @endcan
-                                @endif
-                            </td>
+                                        @can('admin.user.index')
+                                            <a href="{{ route('admin.user.index', ['id' => $ticket->user->id]) }}" target="_blank">{{ $ticket->user->username }}</a>
+                                        @else
+                                            {{ $ticket->user->username }}
+                                        @endcan
+                                    @endif
+                                </td>
 
-                            <td>
-                                {{$ticket->title}}
-                            </td>
-                            <td>
-                                {!!$ticket->status_label!!}
-                            </td>
-                            <td>
-                                @can('admin.ticket.edit')
-                                    <a href="{{route('admin.ticket.edit', $ticket)}}" class="btn btn-animate btn-animate-vertical btn-outline-info">
-                                        <span>
-                                            @if($ticket->status === 2)
-                                                <i class="icon wb-eye" aria-hidden="true" style="left: 40%"> </i>{{trans('common.view')}}
-                                            @else
-                                                <i class="icon wb-check" aria-hidden="true" style="left: 40%"> </i>{{trans('common.open')}}
-                                            @endif
-                                        </span>
-                                    </a>
-                                @endcan
-                            </td>
-                        </tr>
-                    @endforeach
+                                <td>
+                                    {{ $ticket->title }}
+                                </td>
+                                <td>
+                                    {!! $ticket->status_label !!}
+                                </td>
+                                <td>
+                                    @can('admin.ticket.edit')
+                                        <a class="btn btn-animate btn-animate-vertical btn-outline-info" href="{{ route('admin.ticket.edit', $ticket) }}">
+                                            <span>
+                                                @if ($ticket->status === 2)
+                                                    <i class="icon wb-eye" aria-hidden="true" style="left: 40%"> </i>{{ trans('common.view') }}
+                                                @else
+                                                    <i class="icon wb-check" aria-hidden="true" style="left: 40%"> </i>{{ trans('common.open') }}
+                                                @endif
+                                            </span>
+                                        </a>
+                                    @endcan
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -85,7 +85,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$ticketList->links()}}
+                            {{ $ticketList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -94,36 +94,36 @@
     </div>
 
     @can('admin.ticket.store')
-        <div id="add_ticket_modal" class="modal fade" tabindex="-1" data-focus-on="input:first" data-keyboard="false">
+        <div class="modal fade" id="add_ticket_modal" data-focus-on="input:first" data-keyboard="false" tabindex="-1">
             <div class="modal-dialog modal-simple modal-center modal-lg">
                 <div class="modal-content">
                     <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                        <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                             <span aria-hidden="true">×</span>
                         </button>
-                        <h4 class="modal-title"> {{trans('user.ticket.new')}} </h4>
+                        <h4 class="modal-title"> {{ trans('user.ticket.new') }} </h4>
                     </div>
                     <div class="modal-body">
                         <div class="form-group row">
-                            <label for="userId" class="col-2 col-form-label">{{ trans('model.user.attribute') }}</label>
+                            <label class="col-2 col-form-label" for="userId">{{ trans('model.user.attribute') }}</label>
                             <div class="input-group col-10">
-                                <input type="number" class="form-control col-md-4" name="uid" id="uid" placeholder="{{ trans('model.user.id') }}"/>
+                                <input class="form-control col-md-4" id="uid" name="uid" type="number" placeholder="{{ trans('model.user.id') }}" />
                                 <div class="input-group-prepend">
                                     <span class="input-group-text">{{ trans('common.or') }}</span>
                                 </div>
-                                <input type="text" class="form-control col-md-8" name="username" id="username" placeholder="{{ trans('model.user.username') }}"/>
+                                <input class="form-control col-md-8" id="username" name="username" type="text" placeholder="{{ trans('model.user.username') }}" />
                             </div>
                         </div>
                         <div class="form-group">
-                            <input type="text" class="form-control" name="title" id="title" placeholder="{{ trans('validation.attributes.title') }}">
+                            <input class="form-control" id="title" name="title" type="text" placeholder="{{ trans('validation.attributes.title') }}">
                         </div>
                         <div class="form-group">
-                            <textarea type="text" class="form-control" rows="5" name="content" id="content" placeholder="{{ trans('validation.attributes.content') }}"></textarea>
+                            <textarea class="form-control" id="content" name="content" type="text" rows="5" placeholder="{{ trans('validation.attributes.content') }}"></textarea>
                         </div>
                     </div>
                     <div class="modal-footer">
-                        <button type="button" data-dismiss="modal" class="btn btn-danger mr-auto"> {{ trans('common.cancel') }} </button>
-                        <button type="button" data-dismiss="modal" class="btn btn-success" onclick="createTicket()"> {{ trans('common.confirm') }} </button>
+                        <button class="btn btn-danger mr-auto" data-dismiss="modal" type="button"> {{ trans('common.cancel') }} </button>
+                        <button class="btn btn-success" data-dismiss="modal" type="button" onclick="createTicket()"> {{ trans('common.confirm') }} </button>
                     </div>
                 </div>
             </div>
@@ -135,86 +135,92 @@
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
         @can('admin.ticket.store')
-        // 发起工单
-        function createTicket() {
-          const uid = $('#uid').val();
-          const username = $('#username').val();
-          const title = $('#title').val();
-          const content = $('#content').val();
+            // 发起工单
+            function createTicket() {
+                const uid = $('#uid').val();
+                const username = $('#username').val();
+                const title = $('#title').val();
+                const content = $('#content').val();
 
-          if (uid.trim() === '' && username.trim() === '') {
-            swal.fire({title: '{{ trans('admin.ticket.send_to') }}', icon: 'warning'});
-            return false;
-          }
-
-          if (title.trim() === '') {
-            swal.fire({
-              title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.title')]) }}',
-              icon: 'warning',
-            });
-            return false;
-          }
-
-          if (content.trim() === '') {
-            swal.fire({
-              title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.content')]) }}',
-              icon: 'warning',
-            });
-            return false;
-          }
+                if (uid.trim() === '' && username.trim() === '') {
+                    swal.fire({
+                        title: '{{ trans('admin.ticket.send_to') }}',
+                        icon: 'warning'
+                    });
+                    return false;
+                }
 
-          swal.fire({
-            title: '{{ trans('user.ticket.submit_tips') }}',
-            icon: 'question',
-            showCancelButton: true,
-            cancelButtonText: '{{ trans('common.close') }}',
-            confirmButtonText: '{{ trans('common.confirm') }}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'POST',
-                url: "{{route('admin.ticket.store')}}",
-                data: {
-                  _token: '{{csrf_token()}}',
-                  uid: uid,
-                  username: username,
-                  title: title,
-                  content: content,
-                },
-                dataType: 'json',
-                success: function(ret) {
-                  $('#add_ticket_modal').modal('hide');
-                  if (ret.status === 'success') {
+                if (title.trim() === '') {
                     swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-                error: function(data) {
-                  $('#add_ticket_modal').modal('hide');
-                  let str = '';
-                  const errors = data.responseJSON;
-                  if ($.isEmptyObject(errors) === false) {
-                    $.each(errors.errors, function(index, value) {
-                      str += '<li>' + value + '</li>';
+                        title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.title')]) }}',
+                        icon: 'warning',
                     });
+                    return false;
+                }
+
+                if (content.trim() === '') {
                     swal.fire({
-                      title: '{{ trans('admin.hint') }}',
-                      html: str,
-                      icon: 'error',
-                      confirmButtonText: '{{ trans('common.confirm') }}',
+                        title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.content')]) }}',
+                        icon: 'warning',
                     });
-                  }
-                },
-              });
+                    return false;
+                }
+
+                swal.fire({
+                    title: '{{ trans('user.ticket.submit_tips') }}',
+                    icon: 'question',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'POST',
+                            url: "{{ route('admin.ticket.store') }}",
+                            data: {
+                                _token: '{{ csrf_token() }}',
+                                uid: uid,
+                                username: username,
+                                title: title,
+                                content: content,
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                $('#add_ticket_modal').modal('hide');
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                            error: function(data) {
+                                $('#add_ticket_modal').modal('hide');
+                                let str = '';
+                                const errors = data.responseJSON;
+                                if ($.isEmptyObject(errors) === false) {
+                                    $.each(errors.errors, function(index, value) {
+                                        str += '<li>' + value + '</li>';
+                                    });
+                                    swal.fire({
+                                        title: '{{ trans('admin.hint') }}',
+                                        html: str,
+                                        icon: 'error',
+                                        confirmButtonText: '{{ trans('common.confirm') }}',
+                                    });
+                                }
+                            },
+                        });
+                    }
+                });
             }
-          });
-        }
         @endcan
     </script>
 @endsection

+ 154 - 137
resources/views/admin/ticket/reply.blade.php

@@ -4,16 +4,15 @@
         <div class="panel panel-bordered">
             <div class="panel-heading">
                 <h1 class="panel-title cyan-600">
-                    <i class="icon wb-help-circle"></i> {{$ticket->title}}
+                    <i class="icon wb-help-circle"></i> {{ $ticket->title }}
                 </h1>
                 <div class="panel-actions btn-group">
-                    <button class="btn icon-1x btn-info btn-icon wb-user-circle" data-target="#userInfo"
-                            data-toggle="modal"
-                            type="button"> {{ trans('admin.ticket.user_info') }}</button>
-                    <a href="{{route('admin.ticket.index')}}" class="btn btn-default">{{ trans('common.back') }}</a>
-                    @if($ticket->status !== 2)
+                    <button class="btn icon-1x btn-info btn-icon wb-user-circle" data-target="#userInfo" data-toggle="modal" type="button">
+                        {{ trans('admin.ticket.user_info') }}</button>
+                    <a class="btn btn-default" href="{{ route('admin.ticket.index') }}">{{ trans('common.back') }}</a>
+                    @if ($ticket->status !== 2)
                         @can('admin.ticket.destroy')
-                            <button class="btn btn-danger" onclick="closeTicket()"> {{trans('common.close')}} </button>
+                            <button class="btn btn-danger" onclick="closeTicket()"> {{ trans('common.close') }} </button>
                         @endcan
                     @endif
                 </div>
@@ -21,9 +20,12 @@
             <div class="panel-body">
                 <div class="chat-box">
                     <div class="chats">
-                        <x-chat-unit :user="Auth::getUser()" :ticket="$ticket"/>
+                        @php
+                            $currentUser = Auth::user();
+                        @endphp
+                        <x-chat-unit :user="$currentUser" :ticket="$ticket" />
                         @foreach ($replyList as $reply)
-                            <x-chat-unit :user="Auth::getUser()" :ticket="$reply"/>
+                            <x-chat-unit :user="$currentUser" :ticket="$reply" />
                         @endforeach
                     </div>
                 </div>
@@ -32,11 +34,9 @@
                 <div class="panel-footer pb-30">
                     <form>
                         <div class="input-group">
-                            <input type="text" class="form-control" id="editor"
-                                   placeholder="{{trans('user.ticket.reply_placeholder')}}"/>
+                            <input class="form-control" id="editor" type="text" placeholder="{{ trans('user.ticket.reply_placeholder') }}" />
                             <span class="input-group-btn">
-                                <button type="button" class="btn btn-primary"
-                                        onclick="replyTicket()"> {{trans('common.send')}}</button>
+                                <button class="btn btn-primary" type="button" onclick="replyTicket()"> {{ trans('common.send') }}</button>
                             </span>
                         </div>
                     </form>
@@ -44,25 +44,25 @@
             @endcan
         </div>
     </div>
-    <div class="modal fade" id="userInfo" aria-hidden="true" aria-labelledby="userInfo"
-         role="dialog" tabindex="-1">
+    <div class="modal fade" id="userInfo" role="dialog" aria-hidden="true" aria-labelledby="userInfo" tabindex="-1">
         <div class="modal-dialog modal-simple modal-sidebar">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">
-                        <i class="wb-user" aria-hidden="true"></i> {{ trans('admin.ticket.user_info') }}</h4>
+                        <i class="wb-user" aria-hidden="true"></i> {{ trans('admin.ticket.user_info') }}
+                    </h4>
                 </div>
                 <div class="modal-body">
                     <ul class="list-group list-group-dividered px-20 mb-0">
                         <h5>{{ trans('admin.node.info.basic') }}</h5>
                         <dl class="dl-horizontal row">
                             <dt class="col-sm-3">{{ trans('model.user.nickname') }}</dt>
-                            <dd class="col-sm-9">{{$user->nickname}}</dd>
+                            <dd class="col-sm-9">{{ $user->nickname }}</dd>
                             <dt class="col-sm-3">{{ trans('model.user.username') }}</dt>
-                            <dd class="col-sm-9">{{$user->username}}</dd>
+                            <dd class="col-sm-9">{{ $user->username }}</dd>
                             <dt class="col-sm-3">{{ trans('model.user.account_status') }}</dt>
                             <dd class="col-sm-9">
                                 @if ($user->status > 0)
@@ -80,24 +80,25 @@
                                 @endif
                             </dd>
                             <dt class="col-sm-3">{{ trans('model.common.level') }}</dt>
-                            <dd class="col-sm-9">{{$user->level}}</dd>
+                            <dd class="col-sm-9">{{ $user->level }}</dd>
                             <dt class="col-sm-3">{{ trans('model.user.group') }}</dt>
-                            <dd class="col-sm-9">{{$user->userGroup->name ?? trans('common.none')}}</dd>
+                            <dd class="col-sm-9">{{ $user->userGroup->name ?? trans('common.none') }}</dd>
                             <dt class="col-sm-3">{{ trans('model.user.credit') }}</dt>
-                            <dd class="col-sm-9">{{$user->credit}}</dd>
+                            <dd class="col-sm-9">{{ $user->credit }}</dd>
                             <dt class="col-sm-3">{{ trans('model.user.traffic_used') }}</dt>
-                            <dd class="col-sm-9">{{formatBytes($user->used_traffic)}}
-                                / {{$user->transfer_enable_formatted}}</dd>
+                            <dd class="col-sm-9">{{ formatBytes($user->used_traffic) }}
+                                / {{ $user->transfer_enable_formatted }}</dd>
                             <dt class="col-sm-3">{{ trans('model.user.reset_date') }}</dt>
-                            <dd class="col-sm-9">{{$user->reset_date ?? trans('common.none')}}</dd>
+                            <dd class="col-sm-9">{{ $user->reset_date ?? trans('common.none') }}</dd>
                             <dt class="col-sm-3">{{ trans('common.latest_at') }}</dt>
                             <dd class="col-sm-9">
-                                {{$user->t? date('Y-m-d H:i', $user->t) : trans('common.status.unused')}}
+                                {{ $user->t ? date('Y-m-d H:i', $user->t) : trans('common.status.unused') }}
                             </dd>
                             <dt class="col-sm-3">{{ trans('model.user.expired_date') }}</dt>
                             <dd class="col-sm-9">
-                                @if($user->expiration_status() !== 3)
-                                    <span class="badge badge-lg badge-{{['danger','warning','default'][$user->expiration_status()]}}"> {{ $user->expiration_date }} </span>
+                                @if ($user->expiration_status() !== 3)
+                                    <span class="badge badge-lg badge-{{ ['danger', 'warning', 'default'][$user->expiration_status()] }}">
+                                        {{ $user->expiration_date }} </span>
                                 @else
                                     {{ $user->expiration_date }}
                                 @endif
@@ -109,134 +110,150 @@
                         <dl class="dl-horizontal row">
                             <dt class="col-sm-3">{{ trans('common.status.attribute') }}</dt>
                             <dd class="col-sm-9">
-                                <span class="badge badge-lg badge-{{$user->enable?'info':'danger'}}">
-                                    <i class="wb-{{$user->enable?'check':'close'}}" aria-hidden="true"></i>
+                                <span class="badge badge-lg badge-{{ $user->enable ? 'info' : 'danger' }}">
+                                    <i class="wb-{{ $user->enable ? 'check' : 'close' }}" aria-hidden="true"></i>
                                 </span>
                             </dd>
                             <dt class="col-sm-3">{{ trans('model.user.port') }}</dt>
-                            <dd class="col-sm-9">{!! $user->port? : '<span class="badge badge-lg badge-danger"> '.trans('common.none').' </span>' !!}</dd>
+                            <dd class="col-sm-9">{!! $user->port ?: '<span class="badge badge-lg badge-danger"> ' . trans('common.none') . ' </span>' !!}</dd>
                         </dl>
                         <h5>{{ trans('common.more') }}</h5>
                         <dl class="dl-horizontal row">
                             <dt class="col-sm-3">{{ trans('admin.ticket.inviter_info') }}</dt>
                             <dd class="col-sm-9">
-                                {{$user->inviter->nickname ?? trans('common.none')}}
+                                {{ $user->inviter->nickname ?? trans('common.none') }}
                             </dd>
-                            @isset ($user->inviter)
+                            @isset($user->inviter)
                                 <dt class="col-sm-3 offset-md-1">{{ trans('model.user.username') }}</dt>
-                                <dd class="col-sm-8">{{$user->inviter->username}}</dd>
+                                <dd class="col-sm-8">{{ $user->inviter->username }}</dd>
                                 <dt class="col-sm-3 offset-md-1">{{ trans('model.common.level') }}</dt>
-                                <dd class="col-sm-8">{{$user->inviter->level}}</dd>
+                                <dd class="col-sm-8">{{ $user->inviter->level }}</dd>
                                 <dt class="col-sm-3 offset-md-1">{{ trans('common.latest_at') }}</dt>
                                 <dd class="col-sm-8">
-                                    {{$user->inviter->t? date('Y-m-d H:i', $user->inviter->t): trans('common.status.unused')}}
+                                    {{ $user->inviter->t ? date('Y-m-d H:i', $user->inviter->t) : trans('common.status.unused') }}
                                 </dd>
-                            @endif
-                        </dl>
-                    </ul>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-default"
-                            data-dismiss="modal">{{ trans('common.close') }}</button>
+                                @endif
+                            </dl>
+                        </ul>
+                    </div>
+                    <div class="modal-footer">
+                        <button class="btn btn-default" data-dismiss="modal" type="button">{{ trans('common.close') }}</button>
+                    </div>
                 </div>
             </div>
         </div>
-    </div>
-@endsection
-@section('javascript')
-    <script>
-        @can('admin.ticket.destroy')
-        // 关闭工单
-        function closeTicket() {
-          swal.fire({
-            title: '{{ trans('admin.ticket.close_confirm') }}',
-            icon: 'question',
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'DELETE',
-                url: '{{route('admin.ticket.destroy', $ticket->id)}}',
-                async: true,
-                data: {_token: '{{csrf_token()}}'},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
+    @endsection
+    @section('javascript')
+        <script>
+            @can('admin.ticket.destroy')
+                // 关闭工单
+                function closeTicket() {
                     swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.href = '{{route('admin.ticket.index')}}');
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-                error: function() {
-                  swal.fire({title: '{{  trans('user.ticket.error') }}', icon: 'error'});
-                },
-              });
-            }
-          });
-        }
-        @endcan
+                        title: '{{ trans('admin.ticket.close_confirm') }}',
+                        icon: 'question',
+                        showCancelButton: true,
+                        cancelButtonText: '{{ trans('common.close') }}',
+                        confirmButtonText: '{{ trans('common.confirm') }}',
+                    }).then((result) => {
+                        if (result.value) {
+                            $.ajax({
+                                method: 'DELETE',
+                                url: '{{ route('admin.ticket.destroy', $ticket->id) }}',
+                                async: true,
+                                data: {
+                                    _token: '{{ csrf_token() }}'
+                                },
+                                dataType: 'json',
+                                success: function(ret) {
+                                    if (ret.status === 'success') {
+                                        swal.fire({
+                                            title: ret.message,
+                                            icon: 'success',
+                                            timer: 1000,
+                                            showConfirmButton: false,
+                                        }).then(() => window.location.href = '{{ route('admin.ticket.index') }}');
+                                    } else {
+                                        swal.fire({
+                                            title: ret.message,
+                                            icon: 'error'
+                                        }).then(() => window.location.reload());
+                                    }
+                                },
+                                error: function() {
+                                    swal.fire({
+                                        title: '{{ trans('user.ticket.error') }}',
+                                        icon: 'error'
+                                    });
+                                },
+                            });
+                        }
+                    });
+                }
+            @endcan
 
-        @can('admin.ticket.update')
-        //回车检测
-        $(document).on('keypress', 'input', function(e) {
-          if (e.which === 13) {
-            replyTicket();
-            return false;
-          }
-        });
+            @can('admin.ticket.update')
+                //回车检测
+                $(document).on('keypress', 'input', function(e) {
+                    if (e.which === 13) {
+                        replyTicket();
+                        return false;
+                    }
+                });
 
-        // 回复工单
-        function replyTicket() {
-          const content = document.getElementById('editor').value;
+                // 回复工单
+                function replyTicket() {
+                    const content = document.getElementById('editor').value;
 
-          if (content.trim() === '') {
-            swal.fire({
-              title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!',
-              icon: 'warning',
-              timer: 1500,
-            });
-            return false;
-          }
-          swal.fire({
-            title: '{{trans('user.ticket.reply_confirm')}}',
-            icon: 'question',
-            allowEnterKey: false,
-            showCancelButton: true,
-            cancelButtonText: '{{trans('common.close')}}',
-            confirmButtonText: '{{trans('common.confirm')}}',
-          }).then((result) => {
-            if (result.value) {
-              $.ajax({
-                method: 'PUT',
-                url: '{{route('admin.ticket.update', $ticket)}}',
-                data: {_token: '{{csrf_token()}}', content: content},
-                dataType: 'json',
-                success: function(ret) {
-                  if (ret.status === 'success') {
+                    if (content.trim() === '') {
+                        swal.fire({
+                            title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.content')]) }}!',
+                            icon: 'warning',
+                            timer: 1500,
+                        });
+                        return false;
+                    }
                     swal.fire({
-                      title: ret.message,
-                      icon: 'success',
-                      timer: 1000,
-                      showConfirmButton: false,
-                    }).then(() => window.location.reload());
-                  } else {
-                    swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                  }
-                },
-                error: function() {
-                  swal.fire({title: '{{ trans('admin.ticket.error') }}', icon: 'error'});
-                },
-              });
-            }
-          });
-        }
-        @endcan
-    </script>
-@endsection
+                        title: '{{ trans('user.ticket.reply_confirm') }}',
+                        icon: 'question',
+                        allowEnterKey: false,
+                        showCancelButton: true,
+                        cancelButtonText: '{{ trans('common.close') }}',
+                        confirmButtonText: '{{ trans('common.confirm') }}',
+                    }).then((result) => {
+                        if (result.value) {
+                            $.ajax({
+                                method: 'PUT',
+                                url: '{{ route('admin.ticket.update', $ticket) }}',
+                                data: {
+                                    _token: '{{ csrf_token() }}',
+                                    content: content
+                                },
+                                dataType: 'json',
+                                success: function(ret) {
+                                    if (ret.status === 'success') {
+                                        swal.fire({
+                                            title: ret.message,
+                                            icon: 'success',
+                                            timer: 1000,
+                                            showConfirmButton: false,
+                                        }).then(() => window.location.reload());
+                                    } else {
+                                        swal.fire({
+                                            title: ret.message,
+                                            icon: 'error'
+                                        }).then(() => window.location.reload());
+                                    }
+                                },
+                                error: function() {
+                                    swal.fire({
+                                        title: '{{ trans('admin.ticket.error') }}',
+                                        icon: 'error'
+                                    });
+                                },
+                            });
+                        }
+                    });
+                }
+            @endcan
+        </script>
+    @endsection

+ 67 - 54
resources/views/admin/tools/analysis.blade.php

@@ -11,27 +11,27 @@
                 </h2>
             </div>
             @if (Session::has('analysisErrorMsg'))
-                <x-alert type="danger" :message="Session::pull('analysisErrorMsg')"/>
+                <x-alert type="danger" :message="Session::pull('analysisErrorMsg')" />
             @endif
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th>{{ trans('admin.tools.analysis.req_url') }}</th>
-                    </tr>
+                        <tr>
+                            <th>{{ trans('admin.tools.analysis.req_url') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @if(! empty($urlList))
-                        @foreach($urlList as $url)
+                        @if (!empty($urlList))
+                            @foreach ($urlList as $url)
+                                <tr>
+                                    <td> {{ $url }} </td>
+                                </tr>
+                            @endforeach
+                        @else
                             <tr>
-                                <td> {{$url}} </td>
+                                <td colspan="1">{{ trans('admin.tools.analysis.not_enough') }}</td>
                             </tr>
-                        @endforeach
-                    @else
-                        <tr>
-                            <td colspan="1">{{ trans('admin.tools.analysis.not_enough') }}</td>
-                        </tr>
-                    @endif
+                        @endif
                     </tbody>
                 </table>
             </div>
@@ -43,46 +43,59 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      const TableDatatablesScroller = function() {
-        const e = function() {
-          const e = $('#analysis');
-          e.dataTable({
-            language: {
-              aria: {
-                sortAscending: ': activate to sort column ascending',
-                sortDescending: ': activate to sort column descending',
-              },
-              emptyTable: '暂无数据',
-              info: '第 _START_ 到 _END_ 条,共计 _TOTAL_ 条',
-              infoEmpty: '未找到',
-              infoFiltered: '(filtered1 from _MAX_ total entries)',
-              lengthMenu: '_MENU_ entries',
-              search: '搜索:',
-              zeroRecords: '未找到',
-            },
-            buttons: [
-              {extend: 'print', className: 'btn btn-outline-dark'},
-              {extend: 'pdf', className: 'btn btn-outline-success'},
-              {extend: 'csv', className: 'btn btn-outline-primary'},
-            ],
-            scrollY: 300,
-            deferRender: !0,
-            scroller: !0,
-            stateSave: !0,
-            order: [[0, 'asc']],
-            lengthMenu: [[10, 15, 20, -1], [10, 15, 20, 'All']],
-            pageLength: 20,
-            dom: '<\'row\' <\'col-md-12\'B>><\'row\'<\'col-md-6 col-sm-12\'l><\'col-md-6 col-sm-12\'f>r><\'table-scrollable\'t><\'row\'<\'col-md-5 col-sm-12\'i><\'col-md-7 col-sm-12\'p>>',
-          });
-        };
-        return {
-          init: function() {
-            jQuery().dataTable && (e());
-          },
-        };
-      }();
-      jQuery(document).ready(function() {
-        TableDatatablesScroller.init();
-      });
+        const TableDatatablesScroller = function() {
+            const e = function() {
+                const e = $('#analysis');
+                e.dataTable({
+                    language: {
+                        aria: {
+                            sortAscending: ': activate to sort column ascending',
+                            sortDescending: ': activate to sort column descending',
+                        },
+                        emptyTable: '暂无数据',
+                        info: '第 _START_ 到 _END_ 条,共计 _TOTAL_ 条',
+                        infoEmpty: '未找到',
+                        infoFiltered: '(filtered1 from _MAX_ total entries)',
+                        lengthMenu: '_MENU_ entries',
+                        search: '搜索:',
+                        zeroRecords: '未找到',
+                    },
+                    buttons: [{
+                            extend: 'print',
+                            className: 'btn btn-outline-dark'
+                        },
+                        {
+                            extend: 'pdf',
+                            className: 'btn btn-outline-success'
+                        },
+                        {
+                            extend: 'csv',
+                            className: 'btn btn-outline-primary'
+                        },
+                    ],
+                    scrollY: 300,
+                    deferRender: !0,
+                    scroller: !0,
+                    stateSave: !0,
+                    order: [
+                        [0, 'asc']
+                    ],
+                    lengthMenu: [
+                        [10, 15, 20, -1],
+                        [10, 15, 20, 'All']
+                    ],
+                    pageLength: 20,
+                    dom: '<\'row\' <\'col-md-12\'B>><\'row\'<\'col-md-6 col-sm-12\'l><\'col-md-6 col-sm-12\'f>r><\'table-scrollable\'t><\'row\'<\'col-md-5 col-sm-12\'i><\'col-md-7 col-sm-12\'p>>',
+                });
+            };
+            return {
+                init: function() {
+                    jQuery().dataTable && (e());
+                },
+            };
+        }();
+        jQuery(document).ready(function() {
+            TableDatatablesScroller.init();
+        });
     </script>
 @endsection

+ 60 - 62
resources/views/admin/tools/convert.blade.php

@@ -11,10 +11,10 @@
                 <div class="row">
                     <div class="col-md-4 form-group">
                         <label for="method">{{ trans('model.node.method') }}</label>
-                        <select class="form-control" name="method" id="method">
+                        <select class="form-control" id="method" name="method">
                             @foreach (Helpers::methodList() as $method)
-                                <option value="{{$method->name}}" @if($method->is_default) selected @endif>
-                                    {{$method->name}}
+                                <option value="{{ $method->name }}" @if ($method->is_default) selected @endif>
+                                    {{ $method->name }}
                                 </option>
                             @endforeach
                         </select>
@@ -22,106 +22,104 @@
                     <div class="col-md-4 form-group">
                         <label for="transfer_enable">{{ trans('model.user.usable_traffic') }}</label>
                         <div class="input-group">
-                            <input type="number" class="form-control" name="transfer_enable" value="1000" id="transfer_enable" placeholder="" required>
+                            <input class="form-control" id="transfer_enable" name="transfer_enable" type="number" value="1000" placeholder="" required>
                             <span class="input-group-text">GB</span>
                         </div>
                     </div>
                     <div class="col-md-4 form-group">
                         <label for="protocol">{{ trans('model.node.protocol') }}</label>
-                        <select class="form-control" name="protocol" id="protocol">
+                        <select class="form-control" id="protocol" name="protocol">
                             @foreach (Helpers::protocolList() as $protocol)
-                                <option value="{{$protocol->name}}" @if($protocol->is_default) selected @endif>
-                                    {{$protocol->name}}
+                                <option value="{{ $protocol->name }}" @if ($protocol->is_default) selected @endif>
+                                    {{ $protocol->name }}
                                 </option>
                             @endforeach
                         </select>
                     </div>
                     <div class="col-md-4 form-group">
                         <label for="protocol_param">{{ trans('model.node.protocol_param') }}</label>
-                        <input type="text" class="form-control" name="protocol_param" id="protocol_param" placeholder="">
+                        <input class="form-control" id="protocol_param" name="protocol_param" type="text" placeholder="">
                     </div>
                     <div class="col-md-4 form-group">
                         <label for="obfs">{{ trans('model.node.obfs') }}</label>
-                        <select class="form-control" name="obfs" id="obfs">
+                        <select class="form-control" id="obfs" name="obfs">
                             @foreach (Helpers::obfsList() as $obfs)
-                                <option value="{{$obfs->name}}" @if($obfs->is_default) selected @endif>
-                                    {{$obfs->name}}
+                                <option value="{{ $obfs->name }}" @if ($obfs->is_default) selected @endif>
+                                    {{ $obfs->name }}
                                 </option>
                             @endforeach
                         </select>
                     </div>
                     <div class="col-md-4 form-group">
                         <label for="obfs_param">{{ trans('model.node.obfs_param') }}</label>
-                        <input type="text" class="form-control" name="obfs_param" id="obfs_param" placeholder="">
+                        <input class="form-control" id="obfs_param" name="obfs_param" type="text" placeholder="">
                     </div>
                     <div class="col-md-6">
-                        <textarea class="form-control" rows="22" name="content" id="content" placeholder="{{ trans('admin.tools.convert.content_placeholder') }}"
-                                  autofocus></textarea>
+                        <textarea class="form-control" id="content" name="content" rows="22" placeholder="{{ trans('admin.tools.convert.content_placeholder') }}" autofocus></textarea>
                     </div>
                     <div class="col-md-6">
-                        <textarea class="form-control" rows="22" name="result" id="result" onclick="this.focus();this.select()" readonly="readonly"></textarea>
+                        <textarea class="form-control" id="result" name="result" rows="22" onclick="this.focus();this.select()" readonly="readonly"></textarea>
                     </div>
                     <div class="col-md-6">
                         <button class="btn btn-block btn-primary" onclick="Convert()">{{ trans('common.convert') }}</button>
                     </div>
                     <div class="col-md-6">
-                        <a href="{{route('admin.tools.download', ['type' => 1])}}" class="btn btn-block btn-danger">{{ trans('common.download') }}</a>
+                        <a class="btn btn-block btn-danger" href="{{ route('admin.tools.download', ['type' => 1]) }}">{{ trans('common.download') }}</a>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
 @endsection
 @section('javascript')
     <script>
-      // 转换
-      function Convert() {
-        const content = $('#content').val();
+        // 转换
+        function Convert() {
+            const content = $('#content').val();
 
-        if (content.trim() === '') {
-          swal.fire({
-            title: '{{ trans('admin.tools.convert.content_placeholder') }}',
-            icon: 'warning',
-            timer: 1000,
-            showConfirmButton: false,
-          });
-          return;
-        }
-        swal.fire({
-          title: '{{ trans('admin.confirm.continues') }}',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('admin.tools.convert')}}',
-              dataType: 'json',
-              data: {
-                _token: '{{csrf_token()}}',
-                method: $('#method').val(),
-                transfer_enable: $('#transfer_enable').val(),
-                protocol: $('#protocol').val(),
-                protocol_param: $('#protocol_param').val(),
-                obfs: $('#obfs').val(),
-                obfs_param: $('#obfs_param').val(),
-                content: content,
-              },
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  $('#result').val(ret.data);
-                } else {
-                  $('#result').val(ret.message);
+            if (content.trim() === '') {
+                swal.fire({
+                    title: '{{ trans('admin.tools.convert.content_placeholder') }}',
+                    icon: 'warning',
+                    timer: 1000,
+                    showConfirmButton: false,
+                });
+                return;
+            }
+            swal.fire({
+                title: '{{ trans('admin.confirm.continues') }}',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{ route('admin.tools.convert') }}',
+                        dataType: 'json',
+                        data: {
+                            _token: '{{ csrf_token() }}',
+                            method: $('#method').val(),
+                            transfer_enable: $('#transfer_enable').val(),
+                            protocol: $('#protocol').val(),
+                            protocol_param: $('#protocol_param').val(),
+                            obfs: $('#obfs').val(),
+                            obfs_param: $('#obfs_param').val(),
+                            content: content,
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                $('#result').val(ret.data);
+                            } else {
+                                $('#result').val(ret.message);
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-        return false;
-      }
+            return false;
+        }
     </script>
 @endsection

+ 42 - 40
resources/views/admin/tools/decompile.blade.php

@@ -8,17 +8,16 @@
             <div class="panel-body">
                 <div class="row">
                     <div class="col-md-6">
-                        <textarea class="form-control" rows="25" name="content" id="content" placeholder="{{ trans('admin.tools.decompile.content_placeholder') }}"
-                                  autofocus></textarea>
+                        <textarea class="form-control" id="content" name="content" rows="25" placeholder="{{ trans('admin.tools.decompile.content_placeholder') }}" autofocus></textarea>
                     </div>
                     <div class="col-md-6">
-                        <textarea class="form-control" rows="25" name="result" id="result" readonly="readonly"></textarea>
+                        <textarea class="form-control" id="result" name="result" rows="25" readonly="readonly"></textarea>
                     </div>
                     <div class="col-md-6">
                         <button class="btn btn-block btn-primary" onclick="Decompile()">{{ trans('admin.tools.decompile.attribute') }}</button>
                     </div>
                     <div class="col-md-6">
-                        <a href="{{route('admin.tools.download', ['type' => 2])}}" class="btn btn-block btn-danger">{{ trans('common.download') }}</a>
+                        <a class="btn btn-block btn-danger" href="{{ route('admin.tools.download', ['type' => 2]) }}">{{ trans('common.download') }}</a>
                     </div>
                 </div>
             </div>
@@ -27,44 +26,47 @@
 @endsection
 @section('javascript')
     <script>
-      // 转换
-      function Decompile() {
-        const content = $('#content').val();
+        // 转换
+        function Decompile() {
+            const content = $('#content').val();
 
-        if (content.trim() === '') {
-          swal.fire({
-            title: '{{ trans('admin.tools.decompile.content_placeholder') }}',
-            icon: 'warning',
-            timer: 1000,
-            showConfirmButton: false,
-          });
-          return;
-        }
-        swal.fire({
-          title: '{{ trans('admin.confirm.continues') }}',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('admin.tools.decompile')}}',
-              dataType: 'json',
-              data: {_token: '{{csrf_token()}}', content: content},
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  $('#result').val(ret.data);
-                } else {
-                  $('#result').val(ret.message);
+            if (content.trim() === '') {
+                swal.fire({
+                    title: '{{ trans('admin.tools.decompile.content_placeholder') }}',
+                    icon: 'warning',
+                    timer: 1000,
+                    showConfirmButton: false,
+                });
+                return;
+            }
+            swal.fire({
+                title: '{{ trans('admin.confirm.continues') }}',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{ route('admin.tools.decompile') }}',
+                        dataType: 'json',
+                        data: {
+                            _token: '{{ csrf_token() }}',
+                            content: content
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                $('#result').val(ret.data);
+                            } else {
+                                $('#result').val(ret.message);
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-        return false;
-      }
+            return false;
+        }
     </script>
 @endsection

+ 6 - 6
resources/views/admin/tools/import.blade.php

@@ -9,16 +9,16 @@
                 <h2 class="panel-title">{{ trans('admin.menu.tools.import') }}</h2>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="{{route('admin.tools.import')}}" method="POST" enctype="multipart/form-data" class="upload-form">
+                <form class="upload-form" action="{{ route('admin.tools.import') }}" method="POST" enctype="multipart/form-data">
                     @csrf
-                    <input type="file" id="inputUpload" name="uploadFile" data-plugin="dropify" data-default-file="" required/>
-                    <button type="submit" class="btn btn-success float-right mt-10"> {{ trans('common.import') }}</button>
+                    <input id="inputUpload" name="uploadFile" data-plugin="dropify" data-default-file="" type="file" required />
+                    <button class="btn btn-success float-right mt-10" type="submit"> {{ trans('common.import') }}</button>
                 </form>
             </div>
         </div>

+ 115 - 114
resources/views/admin/user/export.blade.php

@@ -11,69 +11,61 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th>#</th>
-                        <th>{{ trans('model.node.attribute') }}</th>
-                        <th>{{ trans('admin.node.info.extend') }}</th>
-                        <th>{{ trans('model.node.domain') }}</th>
-                        <th>{{ trans('model.node.ipv4') }}</th>
-                        <th>{{ trans('admin.user.proxy_info') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($nodeList as $node)
                         <tr>
-                            <td>{{$loop->iteration}}</td>
-                            <td>
-                                @can('admin.node.edit')
-                                    <a href="{{route('admin.node.edit', $node)}}" target="_blank"> {{$node->name}} </a>
-                                @else
-                                    {{$node->name}}
-                                @endcan
-                            </td>
-                            <td>
-                                @isset($node->profile['passwd'])
-                                    {{-- 单端口 --}}
-                                    <span class="badge badge-lg badge-info"><i
-                                                class="fa-solid fa-arrows-left-right-to-line"
-                                                aria-hidden="true"></i></span>
-                                @endisset
-                                @if($node->is_display === 0)
-                                    {{-- 节点完全不可见 --}}
-                                    <span class="badge badge-lg badge-danger"><i class="icon wb-eye-close"
-                                                                                 aria-hidden="true"></i></span>
-                                @elseif($node->is_display === 1)
-                                    {{-- 节点只在页面中显示 --}}
-                                    <span class="badge badge-lg badge-danger"><i class="fa-solid fa-link-slash"
-                                                                                 aria-hidden="true"></i></span>
-                                @elseif($node->is_display === 2)
-                                    {{-- 节点只可被订阅到 --}}
-                                    <span class="badge badge-lg badge-danger"><i class="fa-solid fa-store-slash"
-                                                                                 aria-hidden="true"></i></span>
-                                @endif
-                            </td>
-                            <td>{{$node->server}}</td>
-                            <td>{{$node->ip}}</td>
-                            <td>
-                                @can('admin.user.exportProxy')
-                                    <div class="btn-group">
-                                        <button class="btn btn-sm btn-outline-info"
-                                                onclick="getInfo('{{$node->id}}','code')"><i
-                                                    class="fa-solid fa-code"></i>
-                                        </button>
-                                        <button class="btn btn-sm btn-outline-info"
-                                                onclick="getInfo('{{$node->id}}','qrcode')"><i
-                                                    class="fa-solid fa-qrcode"></i>
-                                        </button>
-                                        <button class="btn btn-sm btn-outline-info"
-                                                onclick="getInfo('{{$node->id}}','text')"><i
-                                                    class="fa-solid fa-list"></i>
-                                        </button>
-                                    </div>
-                                @endcan
-                            </td>
+                            <th>#</th>
+                            <th>{{ trans('model.node.attribute') }}</th>
+                            <th>{{ trans('admin.node.info.extend') }}</th>
+                            <th>{{ trans('model.node.domain') }}</th>
+                            <th>{{ trans('model.node.ipv4') }}</th>
+                            <th>{{ trans('admin.user.proxy_info') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($nodeList as $node)
+                            <tr>
+                                <td>{{ $loop->iteration }}</td>
+                                <td>
+                                    @can('admin.node.edit')
+                                        <a href="{{ route('admin.node.edit', $node) }}" target="_blank"> {{ $node->name }} </a>
+                                    @else
+                                        {{ $node->name }}
+                                    @endcan
+                                </td>
+                                <td>
+                                    @isset($node->profile['passwd'])
+                                        {{-- 单端口 --}}
+                                        <span class="badge badge-lg badge-info"><i class="fa-solid fa-arrows-left-right-to-line" aria-hidden="true"></i></span>
+                                    @endisset
+                                    @if ($node->is_display === 0)
+                                        {{-- 节点完全不可见 --}}
+                                        <span class="badge badge-lg badge-danger"><i class="icon wb-eye-close" aria-hidden="true"></i></span>
+                                    @elseif($node->is_display === 1)
+                                        {{-- 节点只在页面中显示 --}}
+                                        <span class="badge badge-lg badge-danger"><i class="fa-solid fa-link-slash" aria-hidden="true"></i></span>
+                                    @elseif($node->is_display === 2)
+                                        {{-- 节点只可被订阅到 --}}
+                                        <span class="badge badge-lg badge-danger"><i class="fa-solid fa-store-slash" aria-hidden="true"></i></span>
+                                    @endif
+                                </td>
+                                <td>{{ $node->server }}</td>
+                                <td>{{ $node->ip }}</td>
+                                <td>
+                                    @can('admin.user.exportProxy')
+                                        <div class="btn-group">
+                                            <button class="btn btn-sm btn-outline-info" onclick="getInfo('{{ $node->id }}','code')"><i
+                                                   class="fa-solid fa-code"></i>
+                                            </button>
+                                            <button class="btn btn-sm btn-outline-info" onclick="getInfo('{{ $node->id }}','qrcode')"><i
+                                                   class="fa-solid fa-qrcode"></i>
+                                            </button>
+                                            <button class="btn btn-sm btn-outline-info" onclick="getInfo('{{ $node->id }}','text')"><i
+                                                   class="fa-solid fa-list"></i>
+                                            </button>
+                                        </div>
+                                    @endcan
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -84,7 +76,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$nodeList->links()}}
+                            {{ $nodeList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -98,60 +90,69 @@
     <script src="/assets/custom/easy.qrcode.min.js" type="text/javascript"></script>
     @can('admin.user.exportProxy')
         <script>
-          function getInfo(id, type) {
-            $.post("{{route('admin.user.exportProxy', $user)}}", {_token: '{{csrf_token()}}', id: id, type: type},
-                function(ret) {
-                  if (ret.status === 'success') {
-                    switch (type) {
-                      case 'code':
-                        swal.fire({
-                          html: '<textarea class="form-control" rows="8" readonly="readonly">' + ret.data +
-                              '</textarea>' +
-                              '<a href="' + ret.data +
-                              '" class="btn btn-block btn-danger mt-4">{{ trans('common.open') }} ' +
-                              ret.title + '</a>',
-                          showConfirmButton: false,
-                        });
-                        break;
-                      case 'qrcode':
-                        swal.fire({
-                          title: '{{trans('user.scan_qrcode')}}',
-                          html: '<div id="qrcode"></div><button class="btn btn-block btn-outline-primary mt-4" onclick="Download()"> <i class="icon wb-download"></i> {{trans('common.download')}}</button>',
-                          onBeforeOpen: () => {
-                            new QRCode(document.getElementById('qrcode'), {text: ret.data});
-                          },
-                          showConfirmButton: false,
-                        });
-                        break;
-                      case 'text':
-                        swal.fire({
-                          title: '{{trans('user.node.info')}}',
-                          html: '<textarea class="form-control" rows="12" readonly="readonly">' + ret.data +
-                              '</textarea>',
-                          showConfirmButton: false,
-                        });
-                        break;
-                      default:
-                        swal.fire({title: ret.title, text: ret.data});
-                    }
-                  }
-                });
-          }
+            function getInfo(id, type) {
+                $.post("{{ route('admin.user.exportProxy', $user) }}", {
+                        _token: '{{ csrf_token() }}',
+                        id: id,
+                        type: type
+                    },
+                    function(ret) {
+                        if (ret.status === 'success') {
+                            switch (type) {
+                                case 'code':
+                                    swal.fire({
+                                        html: '<textarea class="form-control" rows="8" readonly="readonly">' + ret.data +
+                                            '</textarea>' +
+                                            '<a href="' + ret.data +
+                                            '" class="btn btn-block btn-danger mt-4">{{ trans('common.open') }} ' +
+                                            ret.title + '</a>',
+                                        showConfirmButton: false,
+                                    });
+                                    break;
+                                case 'qrcode':
+                                    swal.fire({
+                                        title: '{{ trans('user.scan_qrcode') }}',
+                                        html: '<div id="qrcode"></div><button class="btn btn-block btn-outline-primary mt-4" onclick="Download()"> <i class="icon wb-download"></i> {{ trans('common.download') }}</button>',
+                                        onBeforeOpen: () => {
+                                            new QRCode(document.getElementById('qrcode'), {
+                                                text: ret.data
+                                            });
+                                        },
+                                        showConfirmButton: false,
+                                    });
+                                    break;
+                                case 'text':
+                                    swal.fire({
+                                        title: '{{ trans('user.node.info') }}',
+                                        html: '<textarea class="form-control" rows="12" readonly="readonly">' + ret.data +
+                                            '</textarea>',
+                                        showConfirmButton: false,
+                                    });
+                                    break;
+                                default:
+                                    swal.fire({
+                                        title: ret.title,
+                                        text: ret.data
+                                    });
+                            }
+                        }
+                    });
+            }
 
-          function Download() {
-            const canvas = document.getElementsByTagName('canvas')[0];
-            canvas.toBlob((blob) => {
-              let link = document.createElement('a');
-              link.download = 'qr.png';
+            function Download() {
+                const canvas = document.getElementsByTagName('canvas')[0];
+                canvas.toBlob((blob) => {
+                    let link = document.createElement('a');
+                    link.download = 'qr.png';
 
-              let reader = new FileReader();
-              reader.readAsDataURL(blob);
-              reader.onload = () => {
-                link.href = reader.result;
-                link.click();
-              };
-            }, 'image/png');
-          }
+                    let reader = new FileReader();
+                    reader.readAsDataURL(blob);
+                    reader.onload = () => {
+                        link.href = reader.result;
+                        link.click();
+                    };
+                }, 'image/png');
+            }
         </script>
     @endcan
 @endsection

+ 66 - 60
resources/views/admin/user/group/index.blade.php

@@ -9,7 +9,7 @@
                 <h2 class="panel-title">{!! trans('admin.user.group.title') !!}</h2>
                 @can('admin.user.group.create')
                     <div class="panel-actions">
-                        <a class="btn btn-primary" href="{{route('admin.user.group.create')}}">
+                        <a class="btn btn-primary" href="{{ route('admin.user.group.create') }}">
                             <i class="icon wb-plus" aria-hidden="true"></i> {{ trans('common.add') }}
                         </a>
                     </div>
@@ -18,35 +18,36 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('admin.user.group.name') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($groups as $group)
                         <tr>
-                            <td> {{$group->id}} </td>
-                            <td> {{$group->name}} </td>
-                            <td>
-                                @canany(['admin.user.group.edit', 'admin.user.group.destroy'])
-                                    <div class="btn-group">
-                                        @can('admin.user.group.edit')
-                                            <a href="{{route('admin.user.group.edit',$group)}}" class="btn btn-primary">
-                                                <i class="icon wb-edit" aria-hidden="true"></i>
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.group.destroy')
-                                            <button onclick="deleteUserGroup('{{route('admin.user.group.destroy',$group)}}', '{{$group->name}}')" class="btn btn-danger">
-                                                <i class="icon wb-trash" aria-hidden="true"></i>
-                                            </button>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('admin.user.group.name') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($groups as $group)
+                            <tr>
+                                <td> {{ $group->id }} </td>
+                                <td> {{ $group->name }} </td>
+                                <td>
+                                    @canany(['admin.user.group.edit', 'admin.user.group.destroy'])
+                                        <div class="btn-group">
+                                            @can('admin.user.group.edit')
+                                                <a class="btn btn-primary" href="{{ route('admin.user.group.edit', $group) }}">
+                                                    <i class="icon wb-edit" aria-hidden="true"></i>
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.group.destroy')
+                                                <button class="btn btn-danger"
+                                                        onclick="deleteUserGroup('{{ route('admin.user.group.destroy', $group) }}', '{{ $group->name }}')">
+                                                    <i class="icon wb-trash" aria-hidden="true"></i>
+                                                </button>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -57,7 +58,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$groups->links()}}
+                            {{ $groups->links() }}
                         </nav>
                     </div>
                 </div>
@@ -71,39 +72,44 @@
 
     @can('admin.user.group.edit')
         <script>
-          // 删除用户分组
-          function deleteUserGroup(url, name) {
-            swal.fire({
-              title: '{{ trans('admin.hint') }}',
-              text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.user_group.attribute')]) }}' +
-                  name + '{{ trans('admin.confirm.delete.1') }}',
-              icon: 'info',
-              showCancelButton: true,
-              cancelButtonText: '{{ trans('common.close') }}',
-              confirmButtonText: '{{ trans('common.confirm') }}',
-            }).then((result) => {
-              if (result.value) {
-                $.ajax({
-                  method: 'DELETE',
-                  url: url,
-                  data: {_token: '{{ csrf_token() }}'},
-                  dataType: 'json',
-                  success: function(ret) {
-                    if (ret.status === 'success') {
-                      swal.fire({
-                        title: ret.message,
-                        icon: 'success',
-                        timer: 1000,
-                        showConfirmButton: false,
-                      }).then(() => window.location.reload());
-                    } else {
-                      swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+            // 删除用户分组
+            function deleteUserGroup(url, name) {
+                swal.fire({
+                    title: '{{ trans('admin.hint') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.user_group.attribute')]) }}' +
+                        name + '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'info',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
                     }
-                  },
                 });
-              }
-            });
-          }
+            }
         </script>
     @endcan
 @endsection

+ 54 - 51
resources/views/admin/user/group/info.blade.php

@@ -6,20 +6,23 @@
     <div class="page-content container">
         <div class="panel">
             <div class="panel-heading">
-                <h2 class="panel-title"> {{ isset($user) ? trans('admin.action.edit_item', ['attribute' => trans('model.user_group.attribute')]) : trans('admin.action.add_item', ['attribute' => trans('model.user_group.attribute')]) }} </h2>
+                <h2 class="panel-title">
+                    {{ isset($user) ? trans('admin.action.edit_item', ['attribute' => trans('model.user_group.attribute')]) : trans('admin.action.add_item', ['attribute' => trans('model.user_group.attribute')]) }}
+                </h2>
                 <div class="panel-actions">
-                    <a href="{{route('admin.user.group.index')}}" class="btn btn-danger">{{ trans('common.back') }}</a>
+                    <a class="btn btn-danger" href="{{ route('admin.user.group.index') }}">{{ trans('common.back') }}</a>
                 </div>
             </div>
             @if (Session::has('successMsg'))
-                <x-alert type="success" :message="Session::pull('successMsg')"/>
+                <x-alert type="success" :message="Session::pull('successMsg')" />
             @endif
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             <div class="panel-body">
-                <form action="@isset($group){{route('admin.user.group.update',$group)}}@else{{route('admin.user.group.store')}}@endisset"
-                      method="POST" enctype="multipart/form-data" class="form-horizontal">
+                <form class="form-horizontal"
+                      action="@isset($group){{ route('admin.user.group.update', $group) }}@else{{ route('admin.user.group.store') }}@endisset"
+                      method="POST" enctype="multipart/form-data">
                     @isset($group)
                         @method('PUT')
                     @endisset
@@ -27,25 +30,25 @@
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="name">{{ trans('model.user_group.name') }}</label>
                         <div class="col-md-9 col-sm-9">
-                            <input type="text" class="form-control" name="name" id="name" required/>
+                            <input class="form-control" id="name" name="name" type="text" required />
                         </div>
                     </div>
                     <div class="form-group row">
                         <label class="col-md-2 col-sm-3 col-form-label" for="nodes">{{ trans('model.user_group.nodes') }}</label>
                         <div class="col-md-9 col-sm-9">
                             <div class="btn-group mb-20">
-                                <button type="button" class="btn btn-primary" id="select-all">{{ trans('admin.select_all') }}</button>
-                                <button type="button" class="btn btn-danger" id="deselect-all">{{ trans('admin.clear') }}</button>
+                                <button class="btn btn-primary" id="select-all" type="button">{{ trans('admin.select_all') }}</button>
+                                <button class="btn btn-danger" id="deselect-all" type="button">{{ trans('admin.clear') }}</button>
                             </div>
-                            <select class="form-control" name="nodes[]" id="nodes" data-plugin="multiSelect" multiple>
-                                @foreach($nodes as $id => $name)
-                                    <option value="{{$id}}">{{$id . ' - ' . $name}}</option>
+                            <select class="form-control" id="nodes" name="nodes[]" data-plugin="multiSelect" multiple>
+                                @foreach ($nodes as $id => $name)
+                                    <option value="{{ $id }}">{{ $id . ' - ' . $name }}</option>
                                 @endforeach
                             </select>
                         </div>
                     </div>
                     <div class="form-actions text-right">
-                        <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                        <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                     </div>
                 </form>
             </div>
@@ -58,55 +61,55 @@
     <script src="/assets/custom/jquery.quicksearch.min.js"></script>
     <script>
         @isset($group)
-        $(document).ready(function() {
-          $('#name').val('{{$group->name}}');
-          $('#nodes').multiSelect('select', @json(array_map('strval', $group->nodes->pluck('id')->toArray())));
-        });
+            $(document).ready(function() {
+                $('#name').val('{{ $group->name }}');
+                $('#nodes').multiSelect('select', @json(array_map('strval', $group->nodes->pluck('id')->toArray())));
+            });
         @endisset
         // 权限列表
         $('#nodes').multiSelect({
-          selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.unselected_hint') }}\'>',
-          selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.selected_hint') }}\'>',
-          afterInit: function() {
-            const that = this,
-                $selectableSearch = that.$selectableUl.prev(),
-                $selectionSearch = that.$selectionUl.prev(),
-                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
-                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
-            that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectableUl.focus();
-                return false;
-              }
-            });
+            selectableHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.unselected_hint') }}\'>',
+            selectionHeader: '<input type=\'text\' class=\'search-input form-control\' autocomplete=\'off\' placeholder=\'{{ trans('admin.selected_hint') }}\'>',
+            afterInit: function() {
+                const that = this,
+                    $selectableSearch = that.$selectableUl.prev(),
+                    $selectionSearch = that.$selectionUl.prev(),
+                    selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
+                    selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
+                that.qs1 = $selectableSearch.quicksearch(selectableSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectableUl.focus();
+                        return false;
+                    }
+                });
 
-            that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
-              if (e.which === 40) {
-                that.$selectionUl.focus();
-                return false;
-              }
-            });
-          },
-          afterSelect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
-          afterDeselect: function() {
-            this.qs1.cache();
-            this.qs2.cache();
-          },
+                that.qs2 = $selectionSearch.quicksearch(selectionSearchString).on('keydown', function(e) {
+                    if (e.which === 40) {
+                        that.$selectionUl.focus();
+                        return false;
+                    }
+                });
+            },
+            afterSelect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
+            afterDeselect: function() {
+                this.qs1.cache();
+                this.qs2.cache();
+            },
         });
 
         // 全选
         $('#select-all').click(function() {
-          $('#nodes').multiSelect('select_all');
-          return false;
+            $('#nodes').multiSelect('select_all');
+            return false;
         });
 
         // 反选
         $('#deselect-all').click(function() {
-          $('#nodes').multiSelect('deselect_all');
-          return false;
+            $('#nodes').multiSelect('deselect_all');
+            return false;
         });
     </script>
 @endsection

+ 330 - 299
resources/views/admin/user/index.blade.php

@@ -1,6 +1,5 @@
-@extends('admin.layouts')
-@section('css')
-    <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
+@extends('admin.table_layouts')
+@push('css')
     <link href="/assets/custom/range.min.css" rel="stylesheet">
     <style>
         #swal2-content {
@@ -12,7 +11,7 @@
             text-decoration: none;
         }
     </style>
-@endsection
+@endpush
 @section('content')
     <div class="page-content container-fluid">
         <div class="panel">
@@ -26,7 +25,7 @@
                             </button>
                         @endcan
                         @can('admin.user.create')
-                            <a href="{{route('admin.user.create')}}" class="btn btn-outline-primary">
+                            <a class="btn btn-outline-primary" href="{{ route('admin.user.create') }}">
                                 <i class="icon wb-user-add" aria-hidden="true"></i> {{ trans('common.add') }}
                             </a>
                         @endcan
@@ -36,164 +35,174 @@
             <div class="panel-body">
                 <form class="form-row">
                     <div class="form-group col-xxl-1 col-lg-1 col-md-1 col-sm-4">
-                        <input type="number" class="form-control" name="id" value="{{Request::query('id')}}" placeholder="{{ trans('model.user.id') }}"/>
+                        <input class="form-control" name="id" type="number" value="{{ Request::query('id') }}" placeholder="{{ trans('model.user.id') }}" />
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" placeholder="{{ trans('model.user.username') }}"/>
+                        <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}"
+                               placeholder="{{ trans('model.user.username') }}" />
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="text" class="form-control" name="wechat" value="{{Request::query('wechat')}}" placeholder="{{ trans('model.user.wechat') }}"/>
+                        <input class="form-control" name="wechat" type="text" value="{{ Request::query('wechat') }}"
+                               placeholder="{{ trans('model.user.wechat') }}" />
                     </div>
                     <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
-                        <input type="number" class="form-control" name="qq" value="{{Request::query('qq')}}" placeholder="{{ trans('model.user.qq') }}"/>
+                        <input class="form-control" name="qq" type="number" value="{{ Request::query('qq') }}" placeholder="{{ trans('model.user.qq') }}" />
                     </div>
                     <div class="form-group col-xxl-1 col-lg-2 col-md-2 col-sm-4">
-                        <input type="number" class="form-control" name="port" value="{{Request::query('port')}}" placeholder="{{ trans('model.user.port') }}"/>
+                        <input class="form-control" name="port" type="number" value="{{ Request::query('port') }}"
+                               placeholder="{{ trans('model.user.port') }}" />
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="user_group_id" name="user_group_id">
-                            <option value="" hidden>{{ trans('model.user.group') }}</option>
-                            @foreach($userGroups as $key => $group)
-                                <option value="{{$key}}">{{$group}}</option>
+                        <select class="form-control" id="user_group_id" name="user_group_id" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.user.group') }}">
+                            @foreach ($userGroups as $key => $group)
+                                <option value="{{ $key }}">{{ $group }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="level" name="level">
-                            <option value="" hidden>{{ trans('model.common.level') }}</option>
-                            @foreach($levels as $key => $level)
-                                <option value="{{$key}}">{{$level}}</option>
+                        <select class="form-control" id="level" name="level" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.common.level') }}">
+                            @foreach ($levels as $key => $level)
+                                <option value="{{ $key }}">{{ $level }}</option>
                             @endforeach
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="status" name="status">
-                            <option value="" hidden>{{ trans('model.user.account_status') }}</option>
+                        <select class="form-control" id="status" name="status" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.user.account_status') }}">
                             <option value="-1">{{ trans('common.status.banned') }}</option>
                             <option value="0">{{ trans('common.status.inactive') }}</option>
                             <option value="1">{{ trans('common.status.normal') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
-                        <select class="form-control" id="enable" name="enable">
-                            <option value="" hidden>{{ trans('model.user.proxy_status') }}</option>
+                        <select class="form-control" id="enable" name="enable" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                title="{{ trans('model.user.proxy_status') }}">
                             <option value="1">{{ trans('common.status.enabled') }}</option>
                             <option value="0">{{ trans('common.status.banned') }}</option>
                         </select>
                     </div>
                     <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4 btn-group">
-                        <button type="submit" class="btn btn-primary">{{ trans('common.search') }}</button>
-                        <a href="{{route('admin.user.index')}}" class="btn btn-danger">{{ trans('common.reset') }}</a>
+                        <button class="btn btn-primary" type="submit">{{ trans('common.search') }}</button>
+                        <a class="btn btn-danger" href="{{ route('admin.user.index') }}">{{ trans('common.reset') }}</a>
                     </div>
                 </form>
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> @sortablelink('id', '#')</th>
-                        <th> {{ trans('model.user.username') }}</th>
-                        <th> @sortablelink('credit', trans('model.user.credit'))</th>
-                        <th> @sortablelink('port', trans('model.user.port'))</th>
-                        <th> {{ trans('model.subscribe.code') }}</th>
-                        <th> {{ trans('model.user.traffic_used') }}</th>
-                        <th> @sortablelink('t', trans('common.latest_at'))</th>
-                        <th> @sortablelink('expired_at', trans('common.expired_at'))</th>
-                        <th> {{ trans('common.account') }}</th>
-                        <th> {{ trans('model.user.service') }}</th>
-                        <th> {{ trans('common.action') }}</th>
-                    </tr>
+                        <tr>
+                            <th> @sortablelink('id', '#')</th>
+                            <th> {{ trans('model.user.username') }}</th>
+                            <th> @sortablelink('credit', trans('model.user.credit'))</th>
+                            <th> @sortablelink('port', trans('model.user.port'))</th>
+                            <th> {{ trans('model.subscribe.code') }}</th>
+                            <th> {{ trans('model.user.traffic_used') }}</th>
+                            <th> @sortablelink('t', trans('common.latest_at'))</th>
+                            <th> @sortablelink('expired_at', trans('common.expired_at'))</th>
+                            <th> {{ trans('common.account') }}</th>
+                            <th> {{ trans('model.user.service') }}</th>
+                            <th> {{ trans('common.action') }}</th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach ($userList as $user)
-                        <tr class="{{$user->isTrafficWarning() ? 'table-danger' : ''}}">
-                            <td> {{$user->id}} </td>
-                            <td> {{$user->username}} </td>
-                            <td> {{$user->credit}} </td>
-                            <td>
-                                {!! $user->port?: '<span class="badge badge-lg badge-danger"> '.trans('common.none').' </span>' !!}
-                            </td>
-                            <td>
-                                <a href="javascript:" class="copySubscribeLink" data-clipboard-action="copy" data-clipboard-text="{{$user->subUrl()}}">{{$user->subscribe->code}}</a>
-                            </td>
-                            <td> {{formatBytes($user->used_traffic)}} / {{$user->transfer_enable_formatted}} </td>
-                            <td> {{$user->t? date('Y-m-d H:i', $user->t): trans('common.status.unused')}} </td>
-                            <td>
-                                @if($user->expiration_status() !== 3)
-                                    <span class="badge badge-lg badge-{{ ['danger', 'warning', 'default'][$user->expiration_status()] }}"> {{ $user->expiration_date }} </span>
-                                @else
-                                    {{ $user->expiration_date }}
-                                @endif
-                            </td>
-                            <td>
-                                @if ($user->status > 0)
-                                    <span class="badge badge-lg badge-primary">
-                                        <i class="wb-check" aria-hidden="true"></i>
-                                    </span>
-                                @elseif ($user->status < 0)
-                                    <span class="badge badge-lg badge-danger">
-                                        <i class="wb-close" aria-hidden="true"></i>
-                                    </span>
-                                @else
-                                    <span class="badge badge-lg badge-default">
-                                        <i class="wb-minus" aria-hidden="true"></i>
+                        @foreach ($userList as $user)
+                            <tr class="{{ $user->isTrafficWarning() ? 'table-danger' : '' }}">
+                                <td> {{ $user->id }} </td>
+                                <td> {{ $user->username }} </td>
+                                <td> {{ $user->credit }} </td>
+                                <td>
+                                    {!! $user->port ?: '<span class="badge badge-lg badge-danger"> ' . trans('common.none') . ' </span>' !!}
+                                </td>
+                                <td>
+                                    <a class="copySubscribeLink" data-clipboard-action="copy" data-clipboard-text="{{ $user->subUrl() }}"
+                                       href="javascript:">{{ $user->subscribe->code }}</a>
+                                </td>
+                                <td> {{ formatBytes($user->used_traffic) }} / {{ $user->transfer_enable_formatted }} </td>
+                                <td> {{ $user->t ? date('Y-m-d H:i', $user->t) : trans('common.status.unused') }} </td>
+                                <td>
+                                    @if ($user->expiration_status() !== 3)
+                                        <span class="badge badge-lg badge-{{ ['danger', 'warning', 'default'][$user->expiration_status()] }}">
+                                            {{ $user->expiration_date }} </span>
+                                    @else
+                                        {{ $user->expiration_date }}
+                                    @endif
+                                </td>
+                                <td>
+                                    @if ($user->status > 0)
+                                        <span class="badge badge-lg badge-primary">
+                                            <i class="wb-check" aria-hidden="true"></i>
+                                        </span>
+                                    @elseif ($user->status < 0)
+                                        <span class="badge badge-lg badge-danger">
+                                            <i class="wb-close" aria-hidden="true"></i>
+                                        </span>
+                                    @else
+                                        <span class="badge badge-lg badge-default">
+                                            <i class="wb-minus" aria-hidden="true"></i>
+                                        </span>
+                                    @endif
+                                </td>
+                                <td>
+                                    <span class="badge badge-lg badge-{{ $user->enable ? 'info' : 'danger' }}">
+                                        <i class="wb-{{ $user->enable ? 'check' : 'close' }}" aria-hidden="true"></i>
                                     </span>
-                                @endif
-                            </td>
-                            <td>
-                                <span class="badge badge-lg badge-{{ $user->enable ? 'info' : 'danger' }}">
-                                    <i class="wb-{{ $user->enable ? 'check' : 'close' }}" aria-hidden="true"></i>
-                                </span>
-                            </td>
-                            <td>
-                                @canany(['admin.user.edit', 'admin.user.destroy', 'admin.user.export', 'admin.user.monitor', 'admin.user.online', 'admin.user.reset', 'admin.user.switch'])
-                                    <button type="button" class="btn btn-primary dropdown-toggle" data-boundary="viewport" data-toggle="dropdown" aria-expanded="false">
-                                        <i class="icon wb-wrench" aria-hidden="true"></i>
-                                    </button>
-                                    <div class="dropdown-menu" role="menu">
-                                        @can('admin.user.edit')
-                                            <a class="dropdown-item" href="{{route('admin.user.edit', ['user'=>$user->id, Request::getQueryString()])}}" role="menuitem">
-                                                <i class="icon wb-edit" aria-hidden="true"></i> {{ trans('common.edit') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.destroy')
-                                            <a class="dropdown-item" href="javascript:delUser('{{route('admin.user.destroy', $user->id)}}','{{$user->username}}')" role="menuitem">
-                                                <i class="icon wb-trash" aria-hidden="true"></i> {{ trans('common.delete') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.export')
-                                            <a class="dropdown-item" href="{{route('admin.user.export', $user)}}" role="menuitem">
-                                                <i class="icon wb-code" aria-hidden="true"></i> {{ trans('admin.user.proxy_info') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.monitor')
-                                            <a class="dropdown-item" href="{{route('admin.user.monitor', $user)}}" role="menuitem">
-                                                <i class="icon wb-stats-bars" aria-hidden="true"></i> {{ trans('admin.user.traffic_monitor') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.online')
-                                            <a class="dropdown-item" href="{{route('admin.user.online', $user)}}" role="menuitem">
-                                                <i class="icon wb-cloud" aria-hidden="true"></i> {{ trans('admin.user.online_monitor') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.reset')
-                                            <a class="dropdown-item" href="javascript:resetTraffic('{{$user->id}}','{{$user->username}}')" role="menuitem">
-                                                <i class="icon wb-reload" aria-hidden="true"></i> {{ trans('admin.user.reset_traffic') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.switch')
-                                            <a class="dropdown-item" href="javascript:switchToUser('{{$user->id}}')" role="menuitem">
-                                                <i class="icon wb-user" aria-hidden="true"></i> {{ trans('admin.user.user_view') }}
-                                            </a>
-                                        @endcan
-                                        @can('admin.user.VNetInfo')
-                                            <a class="dropdown-item" href="javascript:VNetInfo('{{$user->id}}')" role="menuitem">
-                                                <i id="vent_{{$user->id}}" class="icon wb-link-broken" aria-hidden="true"></i> {{ trans('admin.user.connection_test') }}
-                                            </a>
-                                        @endcan
-                                    </div>
-                                @endcanany
-                            </td>
-                        </tr>
-                    @endforeach
+                                </td>
+                                <td>
+                                    @canany(['admin.user.edit', 'admin.user.destroy', 'admin.user.export', 'admin.user.monitor', 'admin.user.online',
+                                        'admin.user.reset', 'admin.user.switch'])
+                                        <button class="btn btn-primary dropdown-toggle" data-boundary="viewport" data-toggle="dropdown" type="button"
+                                                aria-expanded="false">
+                                            <i class="icon wb-wrench" aria-hidden="true"></i>
+                                        </button>
+                                        <div class="dropdown-menu" role="menu">
+                                            @can('admin.user.edit')
+                                                <a class="dropdown-item" href="{{ route('admin.user.edit', ['user' => $user->id, Request::getQueryString()]) }}"
+                                                   role="menuitem">
+                                                    <i class="icon wb-edit" aria-hidden="true"></i> {{ trans('common.edit') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.destroy')
+                                                <a class="dropdown-item"
+                                                   href="javascript:delUser('{{ route('admin.user.destroy', $user->id) }}','{{ $user->username }}')" role="menuitem">
+                                                    <i class="icon wb-trash" aria-hidden="true"></i> {{ trans('common.delete') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.export')
+                                                <a class="dropdown-item" href="{{ route('admin.user.export', $user) }}" role="menuitem">
+                                                    <i class="icon wb-code" aria-hidden="true"></i> {{ trans('admin.user.proxy_info') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.monitor')
+                                                <a class="dropdown-item" href="{{ route('admin.user.monitor', $user) }}" role="menuitem">
+                                                    <i class="icon wb-stats-bars" aria-hidden="true"></i> {{ trans('admin.user.traffic_monitor') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.online')
+                                                <a class="dropdown-item" href="{{ route('admin.user.online', $user) }}" role="menuitem">
+                                                    <i class="icon wb-cloud" aria-hidden="true"></i> {{ trans('admin.user.online_monitor') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.reset')
+                                                <a class="dropdown-item" href="javascript:resetTraffic('{{ $user->id }}','{{ $user->username }}')" role="menuitem">
+                                                    <i class="icon wb-reload" aria-hidden="true"></i> {{ trans('admin.user.reset_traffic') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.switch')
+                                                <a class="dropdown-item" href="javascript:switchToUser('{{ $user->id }}')" role="menuitem">
+                                                    <i class="icon wb-user" aria-hidden="true"></i> {{ trans('admin.user.user_view') }}
+                                                </a>
+                                            @endcan
+                                            @can('admin.user.VNetInfo')
+                                                <a class="dropdown-item" href="javascript:VNetInfo('{{ $user->id }}')" role="menuitem">
+                                                    <i class="icon wb-link-broken" id="vent_{{ $user->id }}" aria-hidden="true"></i>
+                                                    {{ trans('admin.user.connection_test') }}
+                                                </a>
+                                            @endcan
+                                        </div>
+                                    @endcanany
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -204,7 +213,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$userList->links()}}
+                            {{ $userList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -212,189 +221,211 @@
         </div>
     </div>
 @endsection
-@section('javascript')
-    <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
-    <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
+@push('javascript')
     <script src="/assets/custom/clipboardjs/clipboard.min.js"></script>
     <script>
-      $(document).ready(function() {
-        $('#user_group_id').val({{Request::query('user_group_id')}});
-        $('#level').val({{Request::query('level')}});
-        $('#status').val({{Request::query('status')}});
-        $('#enable').val({{Request::query('enable')}});
-        $('select').on('change', function() {
-          this.form.submit();
+        $(document).ready(function() {
+            $('#user_group_id').selectpicker('val', @json(Request::query('user_group_id')));
+            $('#level').selectpicker('val', @json(Request::query('level')));
+            $('#status').selectpicker('val', @json(Request::query('status')));
+            $('#enable').selectpicker('val', @json(Request::query('enable')));
         });
-      });
 
-      @can('admin.user.batch')
-      // 批量生成账号
-      function batchAddUsers() {
-        swal.fire({
-          title: '{{ trans('admin.user.massive.text') }}',
-          input: 'range',
-          inputAttributes: {min: 1, max: 10},
-          inputValue: 1,
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('admin.user.batch')}}', {
-              _token: '{{csrf_token()}}',
-              amount: result.value,
-            }, function(ret) {
-              if (ret.status === 'success') {
+        @can('admin.user.batch')
+            // 批量生成账号
+            function batchAddUsers() {
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            });
-          }
-        });
-      }
-      @endcan
+                    title: '{{ trans('admin.user.massive.text') }}',
+                    input: 'range',
+                    inputAttributes: {
+                        min: 1,
+                        max: 10
+                    },
+                    inputValue: 1,
+                    icon: 'question',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.post('{{ route('admin.user.batch') }}', {
+                            _token: '{{ csrf_token() }}',
+                            amount: result.value,
+                        }, function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                }).then(() => window.location.reload());
+                            }
+                        });
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.user.destroy')
-      // 删除账号
-      function delUser(url, username) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.user.attribute')]) }}' + username +
-              '{{ trans('admin.confirm.delete.1') }}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'DELETE',
-              url: url,
-              data: {_token: '{{csrf_token()}}'},
-              dataType: 'json',
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-                }
-              },
-            });
-          }
-        });
-      }
-      @endcan
+        @can('admin.user.destroy')
+            // 删除账号
+            function delUser(url, username) {
+                swal.fire({
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.confirm.delete.0', ['attribute' => trans('model.user.attribute')]) }}' + username +
+                        '{{ trans('admin.confirm.delete.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.ajax({
+                            method: 'DELETE',
+                            url: url,
+                            data: {
+                                _token: '{{ csrf_token() }}'
+                            },
+                            dataType: 'json',
+                            success: function(ret) {
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => window.location.reload());
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            },
+                        });
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.user.reset')
-      // 重置流量
-      function resetTraffic(id, username) {
-        swal.fire({
-          title: '{{trans('common.warning')}}',
-          text: '{{ trans('admin.user.reset_confirm.0') }}' + username + '{{ trans('admin.user.reset_confirm.1') }}',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{ trans('common.close') }}',
-          confirmButtonText: '{{ trans('common.confirm') }}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('admin.user.reset', '')}}/' + id, {_token: '{{ csrf_token() }}'}, function(ret) {
-              if (ret.status === 'success') {
+        @can('admin.user.reset')
+            // 重置流量
+            function resetTraffic(id, username) {
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            });
-          }
-        });
-      }
-      @endcan
+                    title: '{{ trans('common.warning') }}',
+                    text: '{{ trans('admin.user.reset_confirm.0') }}' + username + '{{ trans('admin.user.reset_confirm.1') }}',
+                    icon: 'warning',
+                    showCancelButton: true,
+                    cancelButtonText: '{{ trans('common.close') }}',
+                    confirmButtonText: '{{ trans('common.confirm') }}',
+                }).then((result) => {
+                    if (result.value) {
+                        $.post('{{ route('admin.user.reset', '') }}/' + id, {
+                            _token: '{{ csrf_token() }}'
+                        }, function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                }).then(() => window.location.reload());
+                            }
+                        });
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.user.switch')
-      // 切换用户身份
-      function switchToUser(id) {
-        $.post('{{route('admin.user.switch', '')}}/' + id, {_token: '{{ csrf_token() }}'}, function(ret) {
-          if (ret.status === 'success') {
-            swal.fire({
-              title: ret.message,
-              icon: 'success',
-              timer: 1000,
-              showConfirmButton: false,
-            }).then(() => window.location.href = '/');
-          } else {
-            swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-          }
-        });
-      }
-      @endcan
+        @can('admin.user.switch')
+            // 切换用户身份
+            function switchToUser(id) {
+                $.post('{{ route('admin.user.switch', '') }}/' + id, {
+                    _token: '{{ csrf_token() }}'
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1000,
+                            showConfirmButton: false,
+                        }).then(() => window.location.href = '/');
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        }).then(() => window.location.reload());
+                    }
+                });
+            }
+        @endcan
 
-      @can('admin.user.VNetInfo')
-      // 节点连通性测试
-      function VNetInfo(id) {
-        $.ajax({
-          method: 'POST',
-          url: '{{route('admin.user.VNetInfo', '')}}/' + id,
-          data: {_token: '{{csrf_token()}}'},
-          beforeSend: function() {
-            $('#vent_' + id).removeClass('wb-link-broken').addClass('wb-loop icon-spin');
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              let str = '';
-              for (let i in ret.data) {
-                str += '<tr><td>' + ret.data[i]['id'] + '</td><td>' + ret.data[i]['name'] + '</td><td>' +
-                    ret.data[i]['avaliable'] + '</td></tr>';
-              }
-              swal.fire({
-                title: ret.title,
-                icon: 'info',
-                html: '<table class="my-20"><thead class="thead-default"><tr><th> ID </th><th> {{ trans('model.node.attribute') }} </th> <th> {{ trans('common.status.attribute')
-                 }} </th></thead><tbody>' + str + '</tbody></table>',
-                showConfirmButton: false,
-              });
-            } else {
-              swal.fire({title: ret.title, text: ret.data, icon: 'error'});
+        @can('admin.user.VNetInfo')
+            // 节点连通性测试
+            function VNetInfo(id) {
+                $.ajax({
+                    method: 'POST',
+                    url: '{{ route('admin.user.VNetInfo', '') }}/' + id,
+                    data: {
+                        _token: '{{ csrf_token() }}'
+                    },
+                    beforeSend: function() {
+                        $('#vent_' + id).removeClass('wb-link-broken').addClass('wb-loop icon-spin');
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'success') {
+                            let str = '';
+                            for (let i in ret.data) {
+                                str += '<tr><td>' + ret.data[i]['id'] + '</td><td>' + ret.data[i]['name'] + '</td><td>' +
+                                    ret.data[i]['avaliable'] + '</td></tr>';
+                            }
+                            swal.fire({
+                                title: ret.title,
+                                icon: 'info',
+                                html: '<table class="my-20"><thead class="thead-default"><tr><th> ID </th><th> {{ trans('model.node.attribute') }} </th> <th> {{ trans('common.status.attribute') }} </th></thead><tbody>' +
+                                    str + '</tbody></table>',
+                                showConfirmButton: false,
+                            });
+                        } else {
+                            swal.fire({
+                                title: ret.title,
+                                text: ret.data,
+                                icon: 'error'
+                            });
+                        }
+                    },
+                    complete: function() {
+                        $('#vent_' + id).removeClass('wb-loop icon-spin').addClass('wb-link-broken');
+                    },
+                });
             }
-          },
-          complete: function() {
-            $('#vent_' + id).removeClass('wb-loop icon-spin').addClass('wb-link-broken');
-          },
-        });
-      }
-      @endcan
+        @endcan
 
-      const clipboard = new ClipboardJS('.copySubscribeLink');
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{ trans('common.copy.success') }}',
-          icon: 'success',
-          timer: 1000,
-          showConfirmButton: false,
+        const clipboard = new ClipboardJS('.copySubscribeLink');
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{ trans('common.copy.success') }}',
+                icon: 'success',
+                timer: 1000,
+                showConfirmButton: false,
+            });
         });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{ trans('common.copy.failed') }}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{ trans('common.copy.failed') }}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      });
     </script>
-@endsection
+@endpush

+ 294 - 313
resources/views/admin/user/info.blade.php

@@ -7,12 +7,13 @@
     <div class="page-content container-fluid">
         <div class="panel">
             <div class="panel-heading">
-                <h2 class="panel-title"> {{ isset($user) ? trans('admin.action.edit_item', ['attribute' => trans('model.user.attribute')]) : trans('admin.action.add_item', ['attribute' => trans('model.user.attribute')]) }}</h2>
+                <h2 class="panel-title">
+                    {{ isset($user) ? trans('admin.action.edit_item', ['attribute' => trans('model.user.attribute')]) : trans('admin.action.add_item', ['attribute' => trans('model.user.attribute')]) }}
+                </h2>
                 @isset($user)
                     @can('admin.user.switch')
                         <div class="panel-actions">
-                            <button type="button" class="btn btn-sm btn-danger"
-                                    onclick="switchToUser()">{{ trans('admin.user.info.switch') }}</button>
+                            <button class="btn btn-sm btn-danger" type="button" onclick="switchToUser()">{{ trans('admin.user.info.switch') }}</button>
                         </div>
                     @endcan
                 @endisset
@@ -23,64 +24,55 @@
                         <div class="col-lg-6">
                             <h4 class="example-title">{{ trans('admin.user.info.account') }}</h4>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="nickname">{{ trans('model.user.nickname') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="nickname">{{ trans('model.user.nickname') }}</label>
                                 <div class="col-xl-6 col-sm-8">
-                                    <input type="text" class="form-control" name="nickname" id="nickname" required/>
+                                    <input class="form-control" id="nickname" name="nickname" type="text" required />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="username">{{ trans('model.user.username') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="username">{{ trans('model.user.username') }}</label>
                                 <div class="col-xl-6 col-sm-8">
-                                    <input type="text" class="form-control" name="username" id="username" required/>
+                                    <input class="form-control" id="username" name="username" type="text" required />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="password">{{ trans('model.user.password') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="password">{{ trans('model.user.password') }}</label>
                                 <div class="col-xl-6 col-sm-8">
-                                    <input type="password" class="form-control" name="password" id="password"
-                                           autocomplete="new-password"
-                                           placeholder="@isset($user){{ trans('common.stay_unchanged') }} @else {{ trans('common.random_generate') }} @endisset"/>
+                                    <input class="form-control" id="password" name="password" type="password" autocomplete="new-password"
+                                           placeholder="@isset($user){{ trans('common.stay_unchanged') }} @else {{ trans('common.random_generate') }} @endisset" />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="level">{{ trans('model.common.level') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="level">{{ trans('model.common.level') }}</label>
                                 <div class="col-xl-4 col-sm-8">
-                                    <select class="form-control" name="level" id="level" data-plugin="selectpicker"
-                                            data-style="btn-outline btn-primary">
-                                        @foreach($levels as $level)
-                                            <option value="{{$level->level}}">{{$level->name}}</option>
+                                    <select class="form-control" id="level" name="level" data-plugin="selectpicker" data-style="btn-outline btn-primary">
+                                        @foreach ($levels as $level)
+                                            <option value="{{ $level->level }}">{{ $level->name }}</option>
                                         @endforeach
                                     </select>
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="group">{{ trans('model.user.group') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="group">{{ trans('model.user.group') }}</label>
                                 <div class="col-xl-4 col-sm-8">
-                                    <select class="form-control" name="group" id="group" data-plugin="selectpicker"
-                                            data-style="btn-outline btn-primary">
-                                        <option value="">{{ trans('common.none') }}</option>
-                                        @foreach($userGroups as $group)
-                                            <option value="{{$group->id}}">{{$group->name}}</option>
+                                    <select class="form-control" id="group" name="group" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                                            title="{{ trans('common.none') }}">
+                                        @foreach ($userGroups as $group)
+                                            <option value="{{ $group->id }}">{{ $group->name }}</option>
                                         @endforeach
                                     </select>
                                 </div>
                             </div>
                             @isset($user)
                                 <div class="form-group row">
-                                    <label class="col-md-2 col-sm-3 col-form-label"
-                                           for="credit">{{ trans('model.user.credit') }}</label>
+                                    <label class="col-md-2 col-sm-3 col-form-label" for="credit">{{ trans('model.user.credit') }}</label>
                                     <div class="col-xl-4 col-sm-8">
                                         <div class="input-group">
-                                            <p class="form-control"> {{$user->credit}} </p>
+                                            <p class="form-control"> {{ $user->credit }} </p>
                                             @can('admin.user.updateCredit')
                                                 <div class="input-group-append">
-                                                    <button type="button" class="btn btn-danger" data-toggle="modal"
-                                                            data-target="#handle_user_credit">{{ trans('admin.goods.type.top_up') }}</button>
+                                                    <button class="btn btn-danger" data-toggle="modal" data-target="#handle_user_credit"
+                                                            type="button">{{ trans('admin.goods.type.top_up') }}</button>
                                                 </div>
                                             @endcan
                                         </div>
@@ -89,16 +81,13 @@
                             @endisset
 
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="invite_num">{{ trans('model.user.invite_num') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="invite_num">{{ trans('model.user.invite_num') }}</label>
                                 <div class="col-xl-4 col-sm-8">
-                                    <input type="number" class="form-control" name="invite_num" id="invite_num"
-                                           value="0" required/>
+                                    <input class="form-control" id="invite_num" name="invite_num" type="number" value="0" required />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="reset_time">{{ trans('model.user.reset_date') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="reset_time">{{ trans('model.user.reset_date') }}</label>
                                 <div class="col-xl-4 col-sm-4">
                                     <div class="input-group input-daterange" data-plugin="datepicker">
                                         <div class="input-group-prepend">
@@ -106,14 +95,13 @@
                                                 <i class="icon wb-calendar" aria-hidden="true"></i>
                                             </span>
                                         </div>
-                                        <input type="text" class="form-control" name="reset_time" id="reset_time"/>
+                                        <input class="form-control" id="reset_time" name="reset_time" type="text" />
                                     </div>
                                     <span class="text-help"> {{ trans('admin.user.info.reset_date_hint') }} </span>
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="expired_at">{{ trans('model.user.expired_date') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="expired_at">{{ trans('model.user.expired_date') }}</label>
                                 <div class="col-xl-4 col-sm-4">
                                     <div class="input-group input-daterange" data-plugin="datepicker">
                                         <div class="input-group-prepend">
@@ -121,7 +109,7 @@
                                                 <i class="icon wb-calendar" aria-hidden="true"></i>
                                             </span>
                                         </div>
-                                        <input type="text" class="form-control" name="expired_at" id="expired_at"/>
+                                        <input class="form-control" id="expired_at" name="expired_at" type="text" />
                                     </div>
                                     <span class="text-help"> {{ trans('admin.user.info.expired_date_hint') }} </span>
                                 </div>
@@ -132,19 +120,19 @@
                                     <ul class="list-unstyled list-inline">
                                         <li class="list-inline-item">
                                             <div class="radio-custom radio-primary">
-                                                <input type="radio" name="status" id="normal" value="1" checked/>
+                                                <input id="normal" name="status" type="radio" value="1" checked />
                                                 <label for="normal">{{ trans('common.status.normal') }}</label>
                                             </div>
                                         </li>
                                         <li class="list-inline-item">
                                             <div class="radio-custom radio-primary">
-                                                <input type="radio" name="status" id="nonactive" value="0"/>
+                                                <input id="nonactive" name="status" type="radio" value="0" />
                                                 <label for="nonactive">{{ trans('common.status.inactive') }}</label>
                                             </div>
                                         </li>
                                         <li class="list-inline-item">
                                             <div class="radio-custom radio-primary">
-                                                <input type="radio" name="status" id="baned" value="-1"/>
+                                                <input id="baned" name="status" type="radio" value="-1" />
                                                 <label for="baned">{{ trans('common.status.banned') }}</label>
                                             </div>
                                         </li>
@@ -152,12 +140,11 @@
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="roles">{{ trans('model.user.role') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="roles">{{ trans('model.user.role') }}</label>
                                 <div class="col-xl-4 col-sm-8">
-                                    <select class="form-control show-tick" name="roles[]" id="roles"
-                                            data-plugin="selectpicker" data-style="btn-outline btn-primary" multiple>
-                                        @foreach($roles as $key => $description)
+                                    <select class="form-control show-tick" id="roles" name="roles[]" data-plugin="selectpicker"
+                                            data-style="btn-outline btn-primary" multiple>
+                                        @foreach ($roles as $key => $description)
                                             <option value="{{ $key }}">{{ $description }}</option>
                                         @endforeach
                                     </select>
@@ -165,36 +152,32 @@
                             </div>
                             <hr>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="wechat">{{ trans('model.user.wechat') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="wechat">{{ trans('model.user.wechat') }}</label>
                                 <div class="col-xl-6 col-sm-8">
-                                    <input type="text" class="form-control" name="wechat" id="wechat"/>
+                                    <input class="form-control" id="wechat" name="wechat" type="text" />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="qq">{{ trans('model.user.qq') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="qq">{{ trans('model.user.qq') }}</label>
                                 <div class="col-xl-6 col-sm-8">
-                                    <input type="number" class="form-control" name="qq" id="qq"/>
+                                    <input class="form-control" id="qq" name="qq" type="number" />
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="remark">{{ trans('model.user.remark') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="remark">{{ trans('model.user.remark') }}</label>
                                 <div class="col-xl-6 col-sm-8">
-                                    <textarea class="form-control" rows="3" name="remark" id="remark"></textarea>
+                                    <textarea class="form-control" id="remark" name="remark" rows="3"></textarea>
                                 </div>
                             </div>
                         </div>
                         <div class="col-lg-6">
                             <h4 class="example-title">{{ trans('admin.user.info.proxy') }}</h4>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="port">{{ trans('model.user.port') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="port">{{ trans('model.user.port') }}</label>
                                 <div class="col-xl-5 col-sm-8">
                                     <div class="input-group">
-                                        <input type="number" class="form-control" name="port" id="port"
-                                               placeholder="{{ trans('common.random_generate') }}"/>
+                                        <input class="form-control" id="port" name="port" type="number"
+                                               placeholder="{{ trans('common.random_generate') }}" />
                                         <div class="input-group-append">
                                             <button class="btn btn-success" type="button" onclick="makePort()">
                                                 <i class="icon wb-refresh"></i>
@@ -204,12 +187,11 @@
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="uuid">{{ trans('model.user.uuid') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="uuid">{{ trans('model.user.uuid') }}</label>
                                 <div class="col-xl-5 col-sm-8">
                                     <div class="input-group">
-                                        <input type="text" class="form-control" name="uuid" id="uuid"
-                                               placeholder="{{ trans('common.random_generate') }}"/>
+                                        <input class="form-control" id="uuid" name="uuid" type="text"
+                                               placeholder="{{ trans('common.random_generate') }}" />
                                         <div class="input-group-append">
                                             <button class="btn btn-success" type="button" onclick="makeUUID()">
                                                 <i class="icon wb-refresh"></i>
@@ -220,12 +202,11 @@
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="passwd">{{ trans('model.user.proxy_passwd') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="passwd">{{ trans('model.user.proxy_passwd') }}</label>
                                 <div class="col-xl-5 col-sm-8">
                                     <div class="input-group">
-                                        <input type="text" class="form-control" name="passwd" id="passwd"
-                                               placeholder="{{ trans('common.random_generate') }}"/>
+                                        <input class="form-control" id="passwd" name="passwd" type="text"
+                                               placeholder="{{ trans('common.random_generate') }}" />
                                         <div class="input-group-append">
                                             <button class="btn btn-success" type="button" onclick="makePasswd()">
                                                 <i class="icon wb-refresh"></i>
@@ -235,25 +216,20 @@
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="method">{{ trans('model.user.proxy_method') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="method">{{ trans('model.user.proxy_method') }}</label>
                                 <div class="col-xl-5 col-sm-8">
-                                    <select class="form-control" name="method" id="method" data-plugin="selectpicker"
-                                            data-style="btn-outline btn-primary">
+                                    <select class="form-control" id="method" name="method" data-plugin="selectpicker" data-style="btn-outline btn-primary">
                                         @foreach (Helpers::methodList() as $method)
-                                            <option value="{{$method->name}}"
-                                                    @if($method->is_default) selected @endif>{{$method->name}}</option>
+                                            <option value="{{ $method->name }}" @if ($method->is_default) selected @endif>{{ $method->name }}</option>
                                         @endforeach
                                     </select>
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="transfer_enable">{{ trans('model.user.usable_traffic') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="transfer_enable">{{ trans('model.user.usable_traffic') }}</label>
                                 <div class="col-xl-5 col-sm-8">
                                     <div class="input-group">
-                                        <input type="text" class="form-control" name="transfer_enable"
-                                               id="transfer_enable" value="1024" required>
+                                        <input class="form-control" id="transfer_enable" name="transfer_enable" type="text" value="1024" required>
                                         <span class="input-group-text">GB</span>
                                     </div>
                                 </div>
@@ -264,13 +240,13 @@
                                     <ul class="list-unstyled list-inline">
                                         <li class="list-inline-item">
                                             <div class="radio-custom radio-primary">
-                                                <input type="radio" name="enable" id="enable" value="1" checked/>
+                                                <input id="enable" name="enable" type="radio" value="1" checked />
                                                 <label for="enable">{{ trans('common.status.enabled') }}</label>
                                             </div>
                                         </li>
                                         <li class="list-inline-item">
                                             <div class="radio-custom radio-primary">
-                                                <input type="radio" name="enable" id="disable" value="0"/>
+                                                <input id="disable" name="enable" type="radio" value="0" />
                                                 <label for="disable">{{ trans('common.status.banned') }}</label>
                                             </div>
                                         </li>
@@ -279,39 +255,33 @@
                             </div>
                             <hr>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="protocol">{{ trans('model.user.proxy_protocol') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="protocol">{{ trans('model.user.proxy_protocol') }}</label>
                                 <div class="col-xl-5 col-sm-8">
-                                    <select class="form-control" name="protocol" id="protocol"
-                                            data-plugin="selectpicker" data-style="btn-outline btn-primary">
+                                    <select class="form-control" id="protocol" name="protocol" data-plugin="selectpicker"
+                                            data-style="btn-outline btn-primary">
                                         @foreach (Helpers::protocolList() as $protocol)
-                                            <option value="{{$protocol->name}}"
-                                                    @if($protocol->is_default) selected @endif>{{$protocol->name}}</option>
+                                            <option value="{{ $protocol->name }}" @if ($protocol->is_default) selected @endif>{{ $protocol->name }}
+                                            </option>
                                         @endforeach
                                     </select>
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="obfs">{{ trans('model.user.proxy_obfs') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="obfs">{{ trans('model.user.proxy_obfs') }}</label>
                                 <div class="col-xl-5 col-sm-8">
-                                    <select data-plugin="selectpicker" data-style="btn-outline btn-primary"
-                                            class="form-control" name="obfs" id="obfs">
+                                    <select class="form-control" id="obfs" name="obfs" data-plugin="selectpicker" data-style="btn-outline btn-primary">
                                         @foreach (Helpers::obfsList() as $obfs)
-                                            <option value="{{$obfs->name}}"
-                                                    @if($obfs->is_default) selected @endif>{{$obfs->name}}</option>
+                                            <option value="{{ $obfs->name }}" @if ($obfs->is_default) selected @endif>{{ $obfs->name }}</option>
                                         @endforeach
                                     </select>
                                 </div>
                             </div>
                             <hr>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="speed_limit">{{ trans('model.user.speed_limit') }}</label>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="speed_limit">{{ trans('model.user.speed_limit') }}</label>
                                 <div class="col-xl-5 col-sm-8">
                                     <div class="input-group">
-                                        <input type="number" class="form-control" name="speed_limit" id="speed_limit"
-                                               value="200"/>
+                                        <input class="form-control" id="speed_limit" name="speed_limit" type="number" value="200" />
                                         <span class="input-group-text"> Mbps</span>
                                     </div>
                                     <span class="text-help">{{ trans('admin.zero_unlimited_hint') }} </span>
@@ -320,25 +290,22 @@
                             @isset($user)
                                 <hr>
                                 <div class="form-group row">
-                                    <label class="col-md-2 col-sm-3 col-form-label"
-                                           for="inviter">{{ trans('model.user.inviter') }}</label>
+                                    <label class="col-md-2 col-sm-3 col-form-label" for="inviter">{{ trans('model.user.inviter') }}</label>
                                     <div class="col-xl-6 col-sm-8">
-                                        <p class="form-control"> {{$user->inviter->username ?? trans('common.none')}} </p>
+                                        <p class="form-control"> {{ $user->inviter->username ?? trans('common.none') }} </p>
                                     </div>
                                 </div>
                                 <div class="form-group row">
-                                    <label class="col-md-2 col-sm-3 col-form-label"
-                                           for="created_at">{{ trans('model.user.created_date') }}</label>
+                                    <label class="col-md-2 col-sm-3 col-form-label" for="created_at">{{ trans('model.user.created_date') }}</label>
                                     <div class="col-xl-6 col-sm-8">
-                                        <p class="form-control"> {{$user->created_at}} </p>
+                                        <p class="form-control"> {{ $user->created_at }} </p>
                                     </div>
                                 </div>
                             @endisset
                         </div>
                         <div class="col-12 form-actions text-right">
-                            <a href="{{route('admin.user.index')}}"
-                               class="btn btn-secondary">{{ trans('common.back') }}</a>
-                            <button type="submit" class="btn btn-success">{{ trans('common.submit') }}</button>
+                            <a class="btn btn-secondary" href="{{ route('admin.user.index') }}">{{ trans('common.back') }}</a>
+                            <button class="btn btn-success" type="submit">{{ trans('common.submit') }}</button>
                         </div>
                     </div>
                 </form>
@@ -348,30 +315,26 @@
     @isset($user)
         @can('admin.user.updateCredit')
             <!-- 余额充值 -->
-            <div class="modal fade" id="handle_user_credit" aria-hidden="true" role="dialog" tabindex="-1">
+            <div class="modal fade" id="handle_user_credit" role="dialog" aria-hidden="true" tabindex="-1">
                 <div class="modal-dialog modal-simple modal-center">
                     <div class="modal-content">
                         <div class="modal-header">
-                            <button type="button" class="close" data-dismiss="modal"
-                                    aria-label="{{ trans('common.close') }}">
+                            <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                                 <span aria-hidden="true">×</span>
                             </button>
                             <h4 class="modal-title">{{ trans('user.recharge') }}</h4>
                         </div>
-                        <form method="post" class="modal-body">
-                            <div class="alert alert-danger" style="display: none;" id="msg"></div>
+                        <form class="modal-body" method="post">
+                            <div class="alert alert-danger" id="msg" style="display: none;"></div>
                             <div class="form-group row">
-                                <label class="col-md-2 col-sm-3 col-form-label"
-                                       for="amount"> {{ trans('user.shop.change_amount') }} </label>
-                                <input type="number" class="col-sm-4 form-control" name="amount" id="amount"
-                                       placeholder="{{ trans('admin.user.info.recharge_placeholder') }}" step="0.01"/>
+                                <label class="col-md-2 col-sm-3 col-form-label" for="amount"> {{ trans('user.shop.change_amount') }} </label>
+                                <input class="col-sm-4 form-control" id="amount" name="amount" type="number"
+                                       placeholder="{{ trans('admin.user.info.recharge_placeholder') }}" step="0.01" />
                             </div>
                         </form>
                         <div class="modal-footer">
-                            <button data-dismiss="modal"
-                                    class="btn btn-danger mr-auto">{{ trans('common.close') }}</button>
-                            <button type="button" class="btn btn-primary"
-                                    onclick="handleUserCredit()">{{ trans('user.recharge') }}</button>
+                            <button class="btn btn-danger mr-auto" data-dismiss="modal">{{ trans('common.close') }}</button>
+                            <button class="btn btn-primary" type="button" onclick="handleUserCredit()">{{ trans('user.recharge') }}</button>
                         </div>
                     </div>
                 </div>
@@ -385,209 +348,227 @@
     <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-datepicker.js"></script>
     <script>
-      $(document).ready(function() {
-          @isset($user)
-          $('#nickname').val('{{$user->nickname}}');
-        $('#username').val('{{$user->username}}');
-        $('#level').selectpicker('val', '{{$user->level}}');
-        $('#group').selectpicker('val', '{{$user->user_group_id}}');
-        $('#invite_num').val('{{$user->invite_num}}');
-        $('#reset_time').val('{{$user->reset_date}}');
-        $('#expired_at').val('{{$user->expiration_date}}');
-        $("input[name='status'][value='{{$user->status}}']").click();
-        $('#wechat').val('{{$user->wechat}}');
-        $('#qq').val('{{$user->qq}}');
-        $('#remark').val('{{$user->remark}}');
-        $('#port').val('{{$user->port}}');
-        $('#passwd').val('{{$user->passwd}}');
-        $('#method').selectpicker('val', '{{$user->method}}');
-        $('#transfer_enable').val('{{$user->transfer_enable / GiB}}');
-        $("input[name='enable'][value='{{$user->enable}}']").click();
-        $('#protocol').selectpicker('val', '{{$user->protocol}}');
-        $('#obfs').selectpicker('val', '{{$user->obfs}}');
-        $('#speed_limit').val('{{$user->speed_limit}}');
-        $('#uuid').val('{{$user->vmess_id}}');
-        $('#roles').selectpicker('val', @json($user->roles()->pluck('name')));
-          @else
-          $('#level').selectpicker('val', '0');
-          @endisset
-      });
-
-      $('.input-daterange>input').datepicker({
-        format: 'yyyy-mm-dd',
-      });
+        $(document).ready(function() {
+            @isset($user)
+                $('#nickname').val('{{ $user->nickname }}');
+                $('#username').val('{{ $user->username }}');
+                $('#level').selectpicker('val', '{{ $user->level }}');
+                $('#group').selectpicker('val', '{{ $user->user_group_id }}');
+                $('#invite_num').val('{{ $user->invite_num }}');
+                $('#reset_time').val('{{ $user->reset_date }}');
+                $('#expired_at').val('{{ $user->expiration_date }}');
+                $("input[name='status'][value='{{ $user->status }}']").click();
+                $('#wechat').val('{{ $user->wechat }}');
+                $('#qq').val('{{ $user->qq }}');
+                $('#remark').val('{{ $user->remark }}');
+                $('#port').val('{{ $user->port }}');
+                $('#passwd').val('{{ $user->passwd }}');
+                $('#method').selectpicker('val', '{{ $user->method }}');
+                $('#transfer_enable').val('{{ $user->transfer_enable / GiB }}');
+                $("input[name='enable'][value='{{ $user->enable }}']").click();
+                $('#protocol').selectpicker('val', '{{ $user->protocol }}');
+                $('#obfs').selectpicker('val', '{{ $user->obfs }}');
+                $('#speed_limit').val('{{ $user->speed_limit }}');
+                $('#uuid').val('{{ $user->vmess_id }}');
+                $('#roles').selectpicker('val', @json($user->roles()->pluck('name')));
+            @else
+                $('#level').selectpicker('val', '0');
+            @endisset
+        });
 
-      @isset($user)
-      @can('admin.user.switch')
-      // 切换用户身份
-      function switchToUser() {
-        $.ajax({
-          url: '{{route('admin.user.switch', $user)}}',
-          data: {'_token': '{{csrf_token()}}'},
-          dataType: 'json',
-          method: 'POST',
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: ret.message,
-                icon: 'success',
-                timer: 1000,
-                showConfirmButton: false,
-              }).then(() => window.location.href = '/');
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
+        $('.input-daterange>input').datepicker({
+            format: 'yyyy-mm-dd',
         });
-      }
-      @endcan
 
-      @can('admin.user.updateCredit')
-      // 余额充值
-      function handleUserCredit() {
-        const amount = $('#amount').val();
-        const reg = /^(-?)\d+(\.\d+)?$/; //只可以是正负数字
+        @isset($user)
+            @can('admin.user.switch')
+                // 切换用户身份
+                function switchToUser() {
+                    $.ajax({
+                        url: '{{ route('admin.user.switch', $user) }}',
+                        data: {
+                            '_token': '{{ csrf_token() }}'
+                        },
+                        dataType: 'json',
+                        method: 'POST',
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.href = '/');
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                }).then(() => window.location.reload());
+                            }
+                        },
+                    });
+                }
+            @endcan
 
-        if (amount.trim() === '' || amount === 0 || !reg.test(amount)) {
-          $('#msg').show().html('{{ trans('user.shop.change_amount_help') }}');
-          $('#name').focus();
-          return false;
-        }
+            @can('admin.user.updateCredit')
+                // 余额充值
+                function handleUserCredit() {
+                    const amount = $('#amount').val();
+                    const reg = /^(-?)\d+(\.\d+)?$/; //只可以是正负数字
 
-        $.ajax({
-          url: '{{route('admin.user.updateCredit', $user)}}',
-          method: 'POST',
-          data: {_token: '{{csrf_token()}}', amount: amount},
-          beforeSend: function() {
-            $('#msg').show().html('{{ trans('user.recharging') }}');
-          },
-          success: function(ret) {
-            if (ret.status === 'fail') {
-              $('#msg').show().html(ret.message);
-              return false;
-            } else {
-              $('#handle_user_credit').modal('hide');
-              if (ret.status === 'success') {
-                swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => {
-                  window.location.reload();
-                });
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
-            }
-          },
-          error: function() {
-            $('#msg').show().html('{{ trans('common.request_failed') }}');
-          },
-          complete: function() {
-          },
-        });
-      }
-      @endcan
-      @endisset
+                    if (amount.trim() === '' || amount === 0 || !reg.test(amount)) {
+                        $('#msg').show().html('{{ trans('user.shop.change_amount_help') }}');
+                        $('#name').focus();
+                        return false;
+                    }
 
-      // ajax同步提交
-      function Submit() {
-        // 用途
-        let usage = '';
-        $.each($('input:checkbox[name=\'usage\']'), function() {
-          if (this.checked) {
-            usage += $(this).val() + ',';
-          }
-        });
+                    $.ajax({
+                        url: '{{ route('admin.user.updateCredit', $user) }}',
+                        method: 'POST',
+                        data: {
+                            _token: '{{ csrf_token() }}',
+                            amount: amount
+                        },
+                        beforeSend: function() {
+                            $('#msg').show().html('{{ trans('user.recharging') }}');
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'fail') {
+                                $('#msg').show().html(ret.message);
+                                return false;
+                            } else {
+                                $('#handle_user_credit').modal('hide');
+                                if (ret.status === 'success') {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'success',
+                                        timer: 1000,
+                                        showConfirmButton: false,
+                                    }).then(() => {
+                                        window.location.reload();
+                                    });
+                                } else {
+                                    swal.fire({
+                                        title: ret.message,
+                                        icon: 'error'
+                                    }).then(() => window.location.reload());
+                                }
+                            }
+                        },
+                        error: function() {
+                            $('#msg').show().html('{{ trans('common.request_failed') }}');
+                        },
+                        complete: function() {},
+                    });
+                }
+            @endcan
+        @endisset
 
-        $.ajax({
-          method: @isset($user)'PUT' @else 'POST' @endisset,
-          url: '{{isset($user)? route('admin.user.update', $user) : route('admin.user.store')}}',
-          dataType: 'json',
-          data: {
-            _token: '{{csrf_token()}}',
-            nickname: $('#nickname').val(),
-            username: $('#username').val(),
-            password: $('#password').val(),
-            port: $('#port').val(),
-            passwd: $('#passwd').val(),
-            uuid: $('#uuid').val(),
-            transfer_enable: $('#transfer_enable').val(),
-            enable: $('input:radio[name=\'enable\']:checked').val(),
-            method: $('#method option:selected').val(),
-            protocol: $('#protocol option:selected').val(),
-            obfs: $('#obfs option:selected').val(),
-            speed_limit: $('#speed_limit').val(),
-            wechat: $('#wechat').val(),
-            qq: $('#qq').val(),
-            expired_at: $('#expired_at').val(),
-            remark: $('#remark').val(),
-            level: $('#level').val(),
-            user_group_id: $('#group').val(),
-            roles: $('#roles').val(),
-            reset_time: $('#reset_time').val(),
-            invite_num: $('#invite_num').val(),
-            status: $('input:radio[name=\'status\']:checked').val(),
-          },
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: '{{ trans('admin.hint') }}',
-                text: '{{ trans('admin.user.update_help') }}',
-                icon: 'question',
-                showCancelButton: true,
-                cancelButtonText: '{{ trans('common.close') }}',
-                confirmButtonText: '{{ trans('common.confirm') }}',
-              }).then((result) => {
-                    if (result.value) {
-                      window.location.href = '{!! route('admin.user.index').(Request::getQueryString()?('?'.Request::getQueryString()):'') !!}';
+        // ajax同步提交
+        function Submit() {
+            // 用途
+            let usage = '';
+            $.each($('input:checkbox[name=\'usage\']'), function() {
+                if (this.checked) {
+                    usage += $(this).val() + ',';
+                }
+            });
+
+            $.ajax({
+                method: @isset($user)
+                    'PUT'
+                @else
+                    'POST'
+                @endisset ,
+                url: '{{ isset($user) ? route('admin.user.update', $user) : route('admin.user.store') }}',
+                dataType: 'json',
+                data: {
+                    _token: '{{ csrf_token() }}',
+                    nickname: $('#nickname').val(),
+                    username: $('#username').val(),
+                    password: $('#password').val(),
+                    port: $('#port').val(),
+                    passwd: $('#passwd').val(),
+                    uuid: $('#uuid').val(),
+                    transfer_enable: $('#transfer_enable').val(),
+                    enable: $('input:radio[name=\'enable\']:checked').val(),
+                    method: $('#method option:selected').val(),
+                    protocol: $('#protocol option:selected').val(),
+                    obfs: $('#obfs option:selected').val(),
+                    speed_limit: $('#speed_limit').val(),
+                    wechat: $('#wechat').val(),
+                    qq: $('#qq').val(),
+                    expired_at: $('#expired_at').val(),
+                    remark: $('#remark').val(),
+                    level: $('#level').val(),
+                    user_group_id: $('#group').val(),
+                    roles: $('#roles').val(),
+                    reset_time: $('#reset_time').val(),
+                    invite_num: $('#invite_num').val(),
+                    status: $('input:radio[name=\'status\']:checked').val(),
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: '{{ trans('admin.hint') }}',
+                            text: '{{ trans('admin.user.update_help') }}',
+                            icon: 'question',
+                            showCancelButton: true,
+                            cancelButtonText: '{{ trans('common.close') }}',
+                            confirmButtonText: '{{ trans('common.confirm') }}',
+                        }).then((result) => {
+                            if (result.value) {
+                                window.location.href = '{!! route('admin.user.index') . (Request::getQueryString() ? '?' . Request::getQueryString() : '') !!}';
+                            }
+                        }, );
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error',
+                            timer: 1000,
+                            showConfirmButton: false
+                        });
                     }
-                  },
-              );
-            } else {
-              swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false});
-            }
-          },
-          error: function(data) {
-            let str = '';
-            const errors = data.responseJSON;
-            if ($.isEmptyObject(errors) === false) {
-              $.each(errors.errors, function(index, value) {
-                str += '<li>' + value + '</li>';
-              });
-              swal.fire({
-                title: '{{ trans('admin.hint') }}',
-                html: str,
-                icon: 'error',
-                confirmButtonText: '{{ trans('common.confirm') }}',
-              });
-            }
-          },
-        });
+                },
+                error: function(data) {
+                    let str = '';
+                    const errors = data.responseJSON;
+                    if ($.isEmptyObject(errors) === false) {
+                        $.each(errors.errors, function(index, value) {
+                            str += '<li>' + value + '</li>';
+                        });
+                        swal.fire({
+                            title: '{{ trans('admin.hint') }}',
+                            html: str,
+                            icon: 'error',
+                            confirmButtonText: '{{ trans('common.confirm') }}',
+                        });
+                    }
+                },
+            });
 
-        return false;
-      }
+            return false;
+        }
 
-      // 生成随机端口
-      function makePort() {
-        $.get('{{route('getPort')}}', function(ret) {
-          $('#port').val(ret);
-        });
-      }
+        // 生成随机端口
+        function makePort() {
+            $.get('{{ route('getPort') }}', function(ret) {
+                $('#port').val(ret);
+            });
+        }
 
-      // 生成UUID
-      function makeUUID() {
-        $.get('{{route('createUUID')}}', function(ret) {
-          $('#uuid').val(ret);
-        });
-      }
+        // 生成UUID
+        function makeUUID() {
+            $.get('{{ route('createUUID') }}', function(ret) {
+                $('#uuid').val(ret);
+            });
+        }
 
-      // 生成随机密码
-      function makePasswd() {
-        $.get('{{route('createStr')}}', function(ret) {
-          $('#passwd').val(ret);
-        });
-      }
+        // 生成随机密码
+        function makePasswd() {
+            $.get('{{ route('createStr') }}', function(ret) {
+                $('#passwd').val(ret);
+            });
+        }
     </script>
 @endsection

+ 18 - 18
resources/views/admin/user/oauth.blade.php

@@ -11,25 +11,25 @@
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{ trans('model.user.attribute') }}</th>
-                        <th> {{ trans('model.oauth.type') }}</th>
-                        <th> {{ trans('model.oauth.identifier') }}</th>
-                        <th> {{trans('common.action')}}</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach ($list as $item)
                         <tr>
-                            <td> {{$item->id}} </td>
-                            <td> {{$item->user->username ?? $item->user->id}} </td>
-                            <td> {{$item->type}} </td>
-                            <td> {{$item->identifier}} </td>
-                            <td>
-                            </td>
+                            <th> #</th>
+                            <th> {{ trans('model.user.attribute') }}</th>
+                            <th> {{ trans('model.oauth.type') }}</th>
+                            <th> {{ trans('model.oauth.identifier') }}</th>
+                            <th> {{ trans('common.action') }}</th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($list as $item)
+                            <tr>
+                                <td> {{ $item->id }} </td>
+                                <td> {{ $item->user->username ?? $item->user->id }} </td>
+                                <td> {{ $item->type }} </td>
+                                <td> {{ $item->identifier }} </td>
+                                <td>
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -40,7 +40,7 @@
                     </div>
                     <div class="col-sm-8">
                         <nav class="Page navigation float-right">
-                            {{$list->links()}}
+                            {{ $list->links() }}
                         </nav>
                     </div>
                 </div>

+ 6 - 6
resources/views/auth/active.blade.php

@@ -1,13 +1,13 @@
 @extends('auth.layouts')
 @section('title', trans('common.active_item', ['attribute' => trans('common.account')]))
 @section('content')
-    @if(Session::has('errorMsg'))
-        <x-alert type="danger" :message="Session::pull('errorMsg')"/>
+    @if (Session::has('errorMsg'))
+        <x-alert type="danger" :message="Session::pull('errorMsg')" />
     @endif
-    @if(Session::has('successMsg'))
-        <x-alert type="success" :message="Session::pull('successMsg')"/>
+    @if (Session::has('successMsg'))
+        <x-alert type="success" :message="Session::pull('successMsg')" />
     @endif
-    <form action="{{url(Request::getRequestUri())}}" method="post">
-        <a href="{{route('login')}}" class="btn btn-lg btn-block btn-success">{{trans('auth.login')}}</a>
+    <form action="{{ url(Request::getRequestUri()) }}" method="post">
+        <a class="btn btn-lg btn-block btn-success" href="{{ route('login') }}">{{ trans('auth.login') }}</a>
     </form>
 @endsection

+ 13 - 13
resources/views/auth/activeUser.blade.php

@@ -2,31 +2,31 @@
 @section('title', trans('common.active_item', ['attribute' => trans('common.account')]))
 @section('content')
     @if (Session::has('successMsg'))
-        <x-alert type="success" :message="Session::pull('successMsg')"/>
+        <x-alert type="success" :message="Session::pull('successMsg')" />
     @endif
-    @if($errors->any())
-        <x-alert type="danger" :message="$errors->all()"/>
+    @if ($errors->any())
+        <x-alert type="danger" :message="$errors->all()" />
     @endif
-    <form action="{{route('active')}}" method="post">
+    <form action="{{ route('active') }}" method="post">
         @csrf
-        @if(sysConfig('is_activate_account'))
+        @if (sysConfig('is_activate_account'))
             <div class="form-title">
-                <span class="form-title">{{trans('common.active_item', ['attribute' => trans('common.account')])}}</span>
+                <span class="form-title">{{ trans('common.active_item', ['attribute' => trans('common.account')]) }}</span>
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="text" class="form-control" name="username" value="{{Request::query('username')}}" required/>
+                <input class="form-control" name="username" type="text" value="{{ Request::query('username') }}" required />
                 <label class="floating-label" for="username">
-                    {{sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username')}}
+                    {{ sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username') }}
                 </label>
             </div>
         @else
-            <x-alert type="danger" :message="trans('auth.active.error.disable')"/>
+            <x-alert type="danger" :message="trans('auth.active.error.disable')" />
         @endif
-        <a href="{{route('login')}}" class="btn btn-danger btn-lg {{sysConfig('is_activate_account')? 'float-left':'btn-block'}}">
-            {{trans('common.back')}}
+        <a class="btn btn-danger btn-lg {{ sysConfig('is_activate_account') ? 'float-left' : 'btn-block' }}" href="{{ route('login') }}">
+            {{ trans('common.back') }}
         </a>
-        @if(sysConfig('is_activate_account'))
-            <button type="submit" class="btn btn-lg btn-primary float-right">{{trans('auth.active.attribute')}}</button>
+        @if (sysConfig('is_activate_account'))
+            <button class="btn btn-lg btn-primary float-right" type="submit">{{ trans('auth.active.attribute') }}</button>
         @endif
     </form>
 @endsection

+ 13 - 8
resources/views/auth/captcha.blade.php

@@ -2,37 +2,42 @@
     @case(1)
         <!-- Default Captcha -->
         <div class="form-group form-material floating input-group" data-plugin="formMaterial">
-            <input type="text" class="form-control" name="captcha" required/>
-            <label class="floating-label" for="captcha">{{trans('auth.captcha.attribute')}}</label>
-            <img src="{{captcha_src()}}" class="float-right" onclick="this.src='/captcha/default?'+Math.random()" alt="{{trans('auth.captcha.attribute')}}"/>
+            <input class="form-control" name="captcha" type="text" required />
+            <label class="floating-label" for="captcha">{{ trans('auth.captcha.attribute') }}</label>
+            <img class="float-right" src="{{ captcha_src() }}" alt="{{ trans('auth.captcha.attribute') }}" onclick="this.src='/captcha/default?'+Math.random()" />
         </div>
-        @break
+    @break
+
     @case(2)
         <!-- Geetest -->
         <div class="form-group form-material floating w-p100" data-plugin="formMaterial">
             {!! Geetest::render() !!}
         </div>
-        @break
+    @break
+
     @case(3)
         <!-- Google reCaptcha -->
         <div class="form-group form-material floating vertical-align-middle mt-20" data-plugin="formMaterial">
             {!! NoCaptcha::display() !!}
             {!! NoCaptcha::renderJs(Session::get('locale')) !!}
         </div>
-        @break
+    @break
+
     @case(4)
         <!-- hCaptcha -->
         <div class="form-group form-material floating w-p100" data-plugin="formMaterial">
             {!! HCaptcha::display() !!}
             {!! HCaptcha::renderJs(Session::get('locale')) !!}
         </div>
-        @break
+    @break
+
     @case(5)
         <!-- Turnstile -->
         <div class="form-group form-material floating w-p100" data-plugin="formMaterial">
             {{ \romanzipp\Turnstile\Captcha::getScript() }}
             {{ \romanzipp\Turnstile\Captcha::getChallenge() }}
         </div>
-        @break
+    @break
+
     @default
 @endswitch

+ 4 - 4
resources/views/auth/error.blade.php

@@ -1,5 +1,5 @@
 @extends('_layout')
-@section('title', sysConfig('website_name').' - '.trans('errors.title'))
+@section('title', sysConfig('website_name') . ' - ' . trans('errors.title'))
 @section('layout_css')
     <link href="/assets/css/errors.min.css" rel="stylesheet">
 @endsection
@@ -8,10 +8,10 @@
     <div class="page vertical-align text-center" data-animsition-in="fade-in" data-animsition-out="fade-out">
         <div class="page-content vertical-align-middle">
             <header>
-                <h1 class="animation-slide-top">{{trans('errors.whoops')}}</h1>
+                <h1 class="animation-slide-top">{{ trans('errors.whoops') }}</h1>
             </header>
-            <h3>{{trans('errors.report')}}</h3>
+            <h3>{{ trans('errors.report') }}</h3>
             <code class="error-advise">{!! $message !!}</code>
         </div>
     </div>
-@endsection
+@endsection

+ 20 - 20
resources/views/auth/free.blade.php

@@ -1,38 +1,38 @@
 @extends('auth.layouts')
-@section('title',sysConfig('website_name'))
+@section('title', sysConfig('website_name'))
 @section('content')
-    <h4 class="caption-subject font-dark bold">{{ '['.trans('common.free').'] '.trans('auth.invite.attribute')}}</h4>
+    <h4 class="caption-subject font-dark bold">{{ '[' . trans('common.free') . '] ' . trans('auth.invite.attribute') }}</h4>
     <div class="table-responsive">
         <table class="table table-hover text-center">
-            @if(sysConfig('is_invite_register'))
-                @if(sysConfig('is_free_code'))
+            @if (sysConfig('is_invite_register'))
+                @if (sysConfig('is_free_code'))
                     <thead class="thead-default">
-                    <tr>
-                        <th> {{trans('auth.invite.attribute')}} </th>
-                        <th> {{trans('common.available_date')}} </th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    @foreach($inviteList as $invite)
                         <tr>
-                            <td>
-                                <a href="{{route('register', ['code' => $invite->code])}}" target="_blank">{{$invite->code}}</a>
-                            </td>
-                            <td> {{$invite->dateline}} </td>
+                            <th> {{ trans('auth.invite.attribute') }} </th>
+                            <th> {{ trans('common.available_date') }} </th>
                         </tr>
-                    @endforeach
+                    </thead>
+                    <tbody>
+                        @foreach ($inviteList as $invite)
+                            <tr>
+                                <td>
+                                    <a href="{{ route('register', ['code' => $invite->code]) }}" target="_blank">{{ $invite->code }}</a>
+                                </td>
+                                <td> {{ $invite->dateline }} </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 @endif
             @else
-                {{trans('auth.invite.not_required')}}
+                {{ trans('auth.invite.not_required') }}
             @endif
         </table>
     </div>
-    @if(sysConfig('is_invite_register') && sysConfig('is_free_code'))
+    @if (sysConfig('is_invite_register') && sysConfig('is_free_code'))
         <div class="mt-20">
-            <a href="{{route('login')}}" class="btn btn-danger btn-lg float-left">{{trans('common.back')}}</a>
+            <a class="btn btn-danger btn-lg float-left" href="{{ route('login') }}">{{ trans('common.back') }}</a>
             <nav class="Page navigation float-right">
-                {{$inviteList->links()}}
+                {{ $inviteList->links() }}
             </nav>
         </div>
     @endif

+ 50 - 41
resources/views/auth/login.blade.php

@@ -1,37 +1,37 @@
 @extends('auth.layouts')
-@section('title', sysConfig('website_name').' - '.trans('auth.login'))
+@section('title', sysConfig('website_name') . ' - ' . trans('auth.login'))
 @section('content')
-    <form action="{{request()->routeIs('login', 'admin.login')? Request::url() : route('login')}}" method="post" id="login-form">
+    <form id="login-form" action="{{ request()->routeIs('login', 'admin.login') ? Request::url() : route('login') }}" method="post">
         @csrf
-        @if($errors->any())
-            <x-alert type="danger" :message="$errors->all()"/>
+        @if ($errors->any())
+            <x-alert type="danger" :message="$errors->all()" />
         @endif
         @if (Session::has('successMsg'))
-            <x-alert type="success" :message="Session::pull('successMsg')"/>
+            <x-alert type="success" :message="Session::pull('successMsg')" />
         @endif
         <div class="form-group form-material floating" data-plugin="formMaterial">
-            <input type="text" class="form-control" name="username" value="{{old('username')}}" required/>
+            <input class="form-control" name="username" type="text" value="{{ old('username') }}" required />
             <label class="floating-label" for="username">
-                {{sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username')}}
+                {{ sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username') }}
             </label>
         </div>
         <div class="form-group form-material floating" data-plugin="formMaterial">
-            <input type="password" class="form-control" name="password" value="{{old('password')}}" autocomplete required/>
-            <label class="floating-label" for="password">{{trans('validation.attributes.password')}}</label>
+            <input class="form-control" name="password" type="password" value="{{ old('password') }}" autocomplete required />
+            <label class="floating-label" for="password">{{ trans('validation.attributes.password') }}</label>
         </div>
         @yield('captcha', view('auth.captcha'))
         <div class="form-group clearfix">
             <div class="checkbox-custom checkbox-inline checkbox-primary checkbox-lg float-left">
-                <input type="checkbox" id="inputCheckbox" name="remember">
-                <label for="inputCheckbox" for="remember">{{trans('auth.remember_me')}}</label>
+                <input id="inputCheckbox" name="remember" type="checkbox">
+                <label for="inputCheckbox" for="remember">{{ trans('auth.remember_me') }}</label>
             </div>
-            <a href="{{route('resetPasswd')}}" class="btn btn-xs bg-red-500 text-white float-right">
-                {{trans('auth.password.forget')}}
+            <a class="btn btn-xs bg-red-500 text-white float-right" href="{{ route('resetPasswd') }}">
+                {{ trans('auth.password.forget') }}
             </a>
         </div>
-        <button type="submit" class="btn btn-lg btn-block mt-40 bg-indigo-500 text-white">{{trans('auth.login')}}</button>
+        <button class="btn btn-lg btn-block mt-40 bg-indigo-500 text-white" type="submit">{{ trans('auth.login') }}</button>
     </form>
-    @if(sysConfig('oauth_path'))
+    @if (sysConfig('oauth_path'))
         <div class="pb-5">
             <div class="line">
                 <span> {{ trans('auth.one-click_login') }} </span>
@@ -39,46 +39,55 @@
             @foreach (json_decode(sysConfig('oauth_path')) as $provider)
                 @if ($provider === 'telegram')
                     <div>
-                        <script async src="https://telegram.org/js/telegram-widget.js?22" data-telegram-login="{{config('services.telegram.bot')}}" data-size="medium" data-auth-url="{{route('oauth.login', ['provider' => $provider])}}" data-request-access="write"></script>
+                        <script async src="https://telegram.org/js/telegram-widget.js?22" data-telegram-login="{{ config('services.telegram.bot') }}" data-size="medium"
+                                data-auth-url="{{ route('oauth.login', ['provider' => $provider]) }}" data-request-access="write"></script>
                     </div>
                 @else
-                    <a class="btn btn-icon btn-pure" href="{{route('oauth.route', ['provider' => $provider, 'operation' => 'login'])}}">
-                        <i class="fa-brands {{config('common.oauth.icon')[$provider]}} fa-lg" aria-hidden="true"></i>
+                    <a class="btn btn-icon btn-pure" href="{{ route('oauth.route', ['provider' => $provider, 'operation' => 'login']) }}">
+                        <i class="fa-brands {{ config('common.oauth.icon')[$provider] }} fa-lg" aria-hidden="true"></i>
                     </a>
                 @endif
             @endforeach
         </div>
     @endif
-    @if(sysConfig('is_register'))
+    @if (sysConfig('is_register'))
         <p>
-            {{trans('auth.register.promotion')}}
-            <a href="{{route('register')}}" class="btn btn-xs bg-purple-500 text-white">
-                {{trans('auth.register.attribute')}}<i class="icon wb-arrow-right" aria-hidden="true"></i>
+            {{ trans('auth.register.promotion') }}
+            <a class="btn btn-xs bg-purple-500 text-white" href="{{ route('register') }}">
+                {{ trans('auth.register.attribute') }}<i class="icon wb-arrow-right" aria-hidden="true"></i>
             </a>
         </p>
     @endif
 @endsection
 @section('javascript')
     <script>
-      $('#login-form').submit(function(event) {
-          @switch(sysConfig('is_captcha'))
-          @case(3)
-        // 先检查Google reCAPTCHA有没有进行验证
-        if ($('#g-recaptcha-response').val() === '') {
-          swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-          return false;
-        }
-          @break
-          @case(4)
-        // 先检查Google reCAPTCHA有没有进行验证
-        if ($('#h-captcha-response').val() === '') {
-          swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-          return false;
-        }
-          @break
-          @default
-          @endswitch
-      });
+        $('#login-form').submit(function(event) {
+            @switch(sysConfig('is_captcha'))
+                @case(3)
+                // 先检查Google reCAPTCHA有没有进行验证
+                if ($('#g-recaptcha-response').val() === '') {
+                    swal.fire({
+                        title: '{{ trans('auth.captcha.required') }}',
+                        icon: 'error'
+                    });
+                    return false;
+                }
+                @break
+
+                @case(4)
+                // 先检查Google reCAPTCHA有没有进行验证
+                if ($('#h-captcha-response').val() === '') {
+                    swal.fire({
+                        title: '{{ trans('auth.captcha.required') }}',
+                        icon: 'error'
+                    });
+                    return false;
+                }
+                @break
+
+                @default
+            @endswitch
+        });
     </script>
     @if(config('app.env') === 'demo')
         <script src="https://ad.ddo.jp/728x90.js.php?ddo_id=proxypanel&ddo_i={{(int) floor(time() / 60)}}" type="text/javascript" defer></script>

+ 20 - 20
resources/views/auth/maintenance.blade.php

@@ -1,11 +1,11 @@
 @extends('_layout')
 @section('title', trans('auth.maintenance'))
-@section('body_class','page-login-v3 layout-full')
+@section('body_class', 'page-login-v3 layout-full')
 @section('layout_content')
     <div class="page vertical-align text-center" data-animsition-in="fade-in" data-animsition-out="fade-out">
         <div class="page-content vertical-align-middle">
             <i class="icon wb-settings icon-spin font-size-70" aria-hidden="true"></i>
-            <h2>{{trans('auth.maintenance_tip')}}</h2>
+            <h2>{{ trans('auth.maintenance_tip') }}</h2>
             {!! $message !!}
             <footer class="page-copyright">
                 <p id="countdown"></p>
@@ -15,23 +15,23 @@
 @endsection
 @section('layout_javascript')
     <script>
-      // 每秒更新计时器
-      const countDownDate = new Date("{{$time}}").getTime();
-      const x = setInterval(function() {
-        const distance = countDownDate - new Date().getTime();
-        const days = Math.floor(distance / 86400000);
-        const hours = Math.floor(distance % 86400000 / 3600000);
-        const minutes = Math.floor(distance % 3600000 / 60000);
-        const seconds = Math.floor(distance % 60000 / 1000);
-        document.getElementById('countdown').innerHTML = '<h2>' + days + ' <span> ' +
-                @json(trans_choice('common.days.attribute', 1)) +' </span>: ' +
-            hours + ' <span>' + @json(trans_choice('common.hour', 1)) +'</span>: ' + minutes +
-            ' <span>{{trans('validation.attributes.minute')}} </span>: ' +
-            seconds + '<span> {{trans('validation.attributes.second')}}</span> </h2>';
-        if (distance <= 0) {
-          clearInterval(x);
-          document.getElementById('countdown').remove();
-        }
-      }, 1000);
+        // 每秒更新计时器
+        const countDownDate = new Date("{{ $time }}").getTime();
+        const x = setInterval(function() {
+            const distance = countDownDate - new Date().getTime();
+            const days = Math.floor(distance / 86400000);
+            const hours = Math.floor(distance % 86400000 / 3600000);
+            const minutes = Math.floor(distance % 3600000 / 60000);
+            const seconds = Math.floor(distance % 60000 / 1000);
+            document.getElementById('countdown').innerHTML = '<h2>' + days + ' <span> ' +
+                @json(trans_choice('common.days.attribute', 1)) + ' </span>: ' +
+                hours + ' <span>' + @json(trans_choice('common.hour', 1)) + '</span>: ' + minutes +
+                ' <span>{{ trans('validation.attributes.minute') }} </span>: ' +
+                seconds + '<span> {{ trans('validation.attributes.second') }}</span> </h2>';
+            if (distance <= 0) {
+                clearInterval(x);
+                document.getElementById('countdown').remove();
+            }
+        }, 1000);
     </script>
 @endsection

+ 158 - 139
resources/views/auth/register.blade.php

@@ -4,112 +4,112 @@
     <link href="/assets/global/vendor/bootstrap-select/bootstrap-select.min.css" rel="stylesheet">
 @endsection
 @section('content')
-    <form action="{{route('register')}}" method="post" id="register-form">
-        @if(sysConfig('is_register'))
-            @if($errors->any())
-                <x-alert type="danger" :message="$errors->all()"/>
+    <form id="register-form" action="{{ route('register') }}" method="post">
+        @if (sysConfig('is_register'))
+            @if ($errors->any())
+                <x-alert type="danger" :message="$errors->all()" />
             @endif
             @csrf
-            <input type="hidden" name="register_token" value="{{Session::get('register_token')}}"/>
-            <input type="hidden" name="aff" value="{{Request::query('aff')}}"/>
+            <input name="register_token" type="hidden" value="{{ Session::get('register_token') }}" />
+            <input name="aff" type="hidden" value="{{ Request::query('aff') }}" />
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="text" class="form-control" name="nickname" id="nickname"
-                       value="{{old('nickname') ? : Request::query('nickname')}}" autocomplete="off" required/>
-                <label class="floating-label" for="username">{{trans('model.user.nickname')}}</label>
+                <input class="form-control" id="nickname" name="nickname" type="text" value="{{ old('nickname') ?: Request::query('nickname') }}"
+                       autocomplete="off" required />
+                <label class="floating-label" for="username">{{ trans('model.user.nickname') }}</label>
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                @if($emailList)
+                @if ($emailList)
                     <div class="input-group">
-                        <input type="text" class="form-control" name="emailHead" id="emailHead" value="{{old('emailHead')}}" required/>
-                        <label class="floating-label" for="emailHead">{{trans('validation.attributes.email')}}</label>
+                        <input class="form-control" id="emailHead" name="emailHead" type="text" value="{{ old('emailHead') }}" required />
+                        <label class="floating-label" for="emailHead">{{ trans('validation.attributes.email') }}</label>
                         <div class="input-group-prepend">
                             <span class="input-group-text bg-indigo-600 text-white">@</span>
                         </div>
-                        <select class="form-control" name="emailTail" id="emailTail" data-plugin="selectpicker" data-style="btn-outline-primary">
-                            @foreach($emailList as $email)
-                                <option value="{{$email->words}}">{{$email->words}}</option>
+                        <select class="form-control" id="emailTail" name="emailTail" data-plugin="selectpicker" data-style="btn-outline-primary">
+                            @foreach ($emailList as $email)
+                                <option value="{{ $email->words }}">{{ $email->words }}</option>
                             @endforeach
                         </select>
-                        <input type="text" name="username" id="username" hidden/>
+                        <input id="username" name="username" type="text" hidden />
                     </div>
                 @else
-                    <input type="text" class="form-control" name="username" id="username" value="{{old('username')}}" required/>
+                    <input class="form-control" id="username" name="username" type="text" value="{{ old('username') }}" required />
                     <label class="floating-label" for="username">
-                        {{sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username')}}
+                        {{ sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username') }}
                     </label>
                 @endif
             </div>
-            @if(sysConfig('is_activate_account') == 1)
+            @if (sysConfig('is_activate_account') == 1)
                 <div class="form-group form-material floating" data-plugin="formMaterial">
                     <div class="input-group" data-plugin="inputGroupFile">
-                        <input type="text" class="form-control" name="verify_code" value="{{old('verify_code')}}" required/>
-                        <label class="floating-label" for="verify_code">{{trans('auth.captcha.attribute')}}</label>
+                        <input class="form-control" name="verify_code" type="text" value="{{ old('verify_code') }}" required />
+                        <label class="floating-label" for="verify_code">{{ trans('auth.captcha.attribute') }}</label>
                         <span class="input-group-btn">
                             <button class="btn btn-success" id="sendCode" onclick="sendVerifyCode()">
-                                {{trans('auth.request')}}
+                                {{ trans('auth.request') }}
                             </button>
                         </span>
                     </div>
                 </div>
             @endif
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="password" class="form-control" name="password" required/>
-                <label class="floating-label" for="password">{{trans('validation.attributes.password')}}</label>
+                <input class="form-control" name="password" type="password" required />
+                <label class="floating-label" for="password">{{ trans('validation.attributes.password') }}</label>
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="password" class="form-control" name="password_confirmation" required/>
-                <label class="floating-label" for="password_confirmation">{{trans('validation.attributes.password_confirmation')}}</label>
+                <input class="form-control" name="password_confirmation" type="password" required />
+                <label class="floating-label" for="password_confirmation">{{ trans('validation.attributes.password_confirmation') }}</label>
             </div>
-            @if(sysConfig('is_invite_register'))
+            @if (sysConfig('is_invite_register'))
                 <div class="form-group form-material floating" data-plugin="formMaterial">
-                    <input type="text" class="form-control" name="code" value="{{old('code') ?: Request::query('code')}}"
-                           @if(sysConfig('is_invite_register') == 2) required @endif/>
+                    <input class="form-control" name="code" type="text" value="{{ old('code') ?: Request::query('code') }}"
+                           @if (sysConfig('is_invite_register') == 2) required @endif />
                     <label class="floating-label" for="code">
-                        {{trans('auth.invite.attribute')}}@if(sysConfig('is_invite_register') == 1)
-                            ({{trans('auth.optional')}})
+                        {{ trans('auth.invite.attribute') }}@if (sysConfig('is_invite_register') == 1)
+                            ({{ trans('auth.optional') }})
                         @endif
                     </label>
                 </div>
-                @if(sysConfig('is_free_code'))
+                @if (sysConfig('is_free_code'))
                     <p class="hint">
-                        <a href="{{route('freeInvitationCode')}}" target="_blank">{{trans('auth.invite.get')}}</a>
+                        <a href="{{ route('freeInvitationCode') }}" target="_blank">{{ trans('auth.invite.get') }}</a>
                     </p>
                 @endif
             @endif
             @yield('captcha', view('auth.captcha'))
             <div class="form-group mt-20 mb-20">
                 <div class="checkbox-custom checkbox-primary">
-                    <input type="checkbox" name="term" id="term" {{old('term') ? 'checked':''}} />
-                    <label for="term">{{trans('auth.accept_term')}}
+                    <input id="term" name="term" type="checkbox" {{ old('term') ? 'checked' : '' }} />
+                    <label for="term">{{ trans('auth.accept_term') }}
                         <button class="btn btn-xs btn-primary" data-target="#tos" data-toggle="modal" type="button">
-                            {{trans('auth.tos')}}
+                            {{ trans('auth.tos') }}
                         </button>
                         &
                         <button class="btn btn-xs btn-primary" data-target="#aup" data-toggle="modal" type="button">
-                            {{trans('auth.aup')}}
+                            {{ trans('auth.aup') }}
                         </button>
                     </label>
                 </div>
             </div>
         @else
-            <x-alert type="danger" :message="trans('auth.register.error.disable')"/>
+            <x-alert type="danger" :message="trans('auth.register.error.disable')" />
         @endif
-        <a href="{{route('login')}}" class="btn btn-danger btn-lg {{sysConfig('is_register')? 'float-left': 'btn-block'}}">
-            {{trans('common.back')}}
+        <a class="btn btn-danger btn-lg {{ sysConfig('is_register') ? 'float-left' : 'btn-block' }}" href="{{ route('login') }}">
+            {{ trans('common.back') }}
         </a>
-        @if(sysConfig('is_register'))
-            <button type="submit" class="btn btn-primary btn-lg float-right">{{trans('auth.register.attribute')}}</button>
+        @if (sysConfig('is_register'))
+            <button class="btn btn-primary btn-lg float-right" type="submit">{{ trans('auth.register.attribute') }}</button>
         @endif
     </form>
-    @if(sysConfig('is_register') && sysConfig('oauth_path') && sysConfig('is_invite_register') != 2)
+    @if (sysConfig('is_register') && sysConfig('oauth_path') && sysConfig('is_invite_register') != 2)
         <div class="pt-20" style="display: inline-block;">
             <div class="line">
-                <span> {{trans('auth.oauth.register')}} </span>
+                <span> {{ trans('auth.oauth.register') }} </span>
             </div>
             @foreach (json_decode(sysConfig('oauth_path')) as $provider)
                 @if ($provider !== 'telegram')
-                    <a class="btn btn-icon btn-pure" href="{{route('oauth.route', ['provider' => $provider, 'operation' => 'register'])}}">
-                        <i class="fa-brands {{config('common.oauth.icon')[$provider]}} fa-lg" aria-hidden="true"></i>
+                    <a class="btn btn-icon btn-pure" href="{{ route('oauth.route', ['provider' => $provider, 'operation' => 'register']) }}">
+                        <i class="fa-brands {{ config('common.oauth.icon')[$provider] }} fa-lg" aria-hidden="true"></i>
                     </a>
                 @endif
             @endforeach
@@ -117,149 +117,168 @@
     @endif
 @endsection
 @section('modal')
-    <div class="modal fade modal-info text-left" id="tos" aria-hidden="true" aria-labelledby="tos" role="dialog"
-         tabindex="-1">
+    <div class="modal fade modal-info text-left" id="tos" role="dialog" aria-hidden="true" aria-labelledby="tos" tabindex="-1">
         <div class="modal-dialog modal-simple modal-sidebar modal-lg">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close mr-15" data-dismiss="modal" aria-label="{{ trans('common.close') }}" style="position:absolute;">
+                    <button class="close mr-15" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}" style="position:absolute;">
                         <span aria-hidden="true">×</span>
                     </button>
-                    <h4 class="modal-title">{{sysConfig('website_name')}}- {{trans('auth.tos')}}
-                        <small>2019年11月28日10:49</small></h4>
+                    <h4 class="modal-title">{{ sysConfig('website_name') }}- {{ trans('auth.tos') }}
+                        <small>2019年11月28日10:49</small>
+                    </h4>
                 </div>
                 <div class="modal-body">
                     @include('auth.docs.tos')
                 </div>
                 <div class="modal-footer">
-                    <button type="button" class="btn btn-block bg-red-500 text-white mb-25" data-dismiss="modal">{{trans('common.close')}}</button>
+                    <button class="btn btn-block bg-red-500 text-white mb-25" data-dismiss="modal" type="button">{{ trans('common.close') }}</button>
                 </div>
             </div>
         </div>
     </div>
-    <div class="modal fade modal-info text-left" id="aup" aria-hidden="true" aria-labelledby="aup" role="dialog"
-         tabindex="-1">
+    <div class="modal fade modal-info text-left" id="aup" role="dialog" aria-hidden="true" aria-labelledby="aup" tabindex="-1">
         <div class="modal-dialog modal-simple modal-sidebar modal-lg">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close mr-15" data-dismiss="modal" aria-label="{{ trans('common.close') }}" style="position:absolute;">
+                    <button class="close mr-15" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}" style="position:absolute;">
                         <span aria-hidden="true">×</span>
                     </button>
-                    <h4 class="modal-title">{{sysConfig('website_name')}}- {{trans('auth.aup')}}
-                        <small>2019年11月28日10:49</small></h4>
+                    <h4 class="modal-title">{{ sysConfig('website_name') }}- {{ trans('auth.aup') }}
+                        <small>2019年11月28日10:49</small>
+                    </h4>
                 </div>
                 <div class="modal-body">
                     @include('auth.docs.aup')
                 </div>
                 <div class="modal-footer">
-                    <button type="button" class="btn btn-block bg-red-500 text-white mb-25" data-dismiss="modal">{{trans('common.close')}}</button>
+                    <button class="btn btn-block bg-red-500 text-white mb-25" data-dismiss="modal" type="button">{{ trans('common.close') }}</button>
                 </div>
             </div>
         </div>
     </div>
-    @endsection
+@endsection
 @section('javascript')
-	<!--[if lt IE 11]>
-    <script src="/assets/custom/sweetalert2/polyfill.min.js"></script>
-    <![endif]-->
     <script src="/assets/custom/sweetalert2/sweetalert2.all.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js"></script>
     <script src="/assets/global/js/Plugin/bootstrap-select.js"></script>
     <script>
-        @if($emailList)
-        function getEmail() {
-          let email = $('#emailHead').val().trim();
-          const emailTail = $('#emailTail').val();
-          if (email === '') {
-            swal.fire({
-              title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.email')])}}',
-              icon: 'warning',
-              timer: 1500,
-            });
-            return false;
-          }
-          email += '@' + emailTail;
-          $('#username').val(email);
-          return email;
-        }
+        @if ($emailList)
+            function getEmail() {
+                let email = $('#emailHead').val().trim();
+                const emailTail = $('#emailTail').val();
+                if (email === '') {
+                    swal.fire({
+                        title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.email')]) }}',
+                        icon: 'warning',
+                        timer: 1500,
+                    });
+                    return false;
+                }
+                email += '@' + emailTail;
+                $('#username').val(email);
+                return email;
+            }
         @endif
 
         // 发送注册验证码
         function sendVerifyCode() {
-          let flag = true; // 请求成功与否标记
-          let email = $('#username').val().trim();
-            @if($emailList)
+            let flag = true; // 请求成功与否标记
+            let email = $('#username').val().trim();
+            @if ($emailList)
                 email = getEmail();
             @endif
 
             if (email === '') {
-              swal.fire({
-                title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.email')])}}',
-                icon: 'warning',
-                timer: 1500,
-              });
-              return false;
+                swal.fire({
+                    title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.email')]) }}',
+                    icon: 'warning',
+                    timer: 1500,
+                });
+                return false;
             }
 
-          $.ajax({
-            method: 'POST',
-            url: '{{route('sendVerificationCode')}}',
-            dataType: 'json',
-            data: {_token: '{{csrf_token()}}', username: email},
-            success: function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({title: ret.message, icon: 'success'});
-                $('#sendCode').attr('disabled', true);
-                flag = true;
-              } else {
-                swal.fire({title: ret.message, icon: 'error', timer: 1000, showConfirmButton: false});
-                $('#sendCode').attr('disabled', false);
-                flag = false;
-              }
-            },
-            error: function() {
-              swal.fire({title: '发送失败', icon: 'error'});
-              flag = false;
-            },
-          });
+            $.ajax({
+                method: 'POST',
+                url: '{{ route('sendVerificationCode') }}',
+                dataType: 'json',
+                data: {
+                    _token: '{{ csrf_token() }}',
+                    username: email
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success'
+                        });
+                        $('#sendCode').attr('disabled', true);
+                        flag = true;
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error',
+                            timer: 1000,
+                            showConfirmButton: false
+                        });
+                        $('#sendCode').attr('disabled', false);
+                        flag = false;
+                    }
+                },
+                error: function() {
+                    swal.fire({
+                        title: '发送失败',
+                        icon: 'error'
+                    });
+                    flag = false;
+                },
+            });
 
-          // 请求成功才开始倒计时
-          if (flag) {
-            // 60秒后才能重新申请发送
-            let left_time = 60;
-            const tt = window.setInterval(function() {
-              left_time--;
-              if (left_time <= 0) {
-                window.clearInterval(tt);
-                $('#sendCode').removeAttr('disabled').text('{{trans('auth.request')}}');
-              } else {
-                $('#sendCode').text(left_time + ' s');
-              }
-            }, 1000);
-          }
+            // 请求成功才开始倒计时
+            if (flag) {
+                // 60秒后才能重新申请发送
+                let left_time = 60;
+                const tt = window.setInterval(function() {
+                    left_time--;
+                    if (left_time <= 0) {
+                        window.clearInterval(tt);
+                        $('#sendCode').removeAttr('disabled').text('{{ trans('auth.request') }}');
+                    } else {
+                        $('#sendCode').text(left_time + ' s');
+                    }
+                }, 1000);
+            }
         }
 
         $('#register-form').submit(function(event) {
-            @if($emailList)
-            getEmail();
+            @if ($emailList)
+                getEmail();
             @endif
 
             @switch(sysConfig('is_captcha'))
-            @case(3)
-          // 先检查Google reCAPTCHA有没有进行验证
-          if ($('#g-recaptcha-response').val() === '') {
-            swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-            return false;
-          }
-            @break
-            @case(4)
-          // 先检查Google reCAPTCHA有没有进行验证
-          if ($('#h-captcha-response').val() === '') {
-            swal.fire({title: '{{trans('auth.captcha.required')}}', icon: 'error'});
-            return false;
-          }
-            @break
-            @default
+                @case(3)
+                // 先检查Google reCAPTCHA有没有进行验证
+                if ($('#g-recaptcha-response').val() === '') {
+                    swal.fire({
+                        title: '{{ trans('auth.captcha.required') }}',
+                        icon: 'error'
+                    });
+                    return false;
+                }
+                @break
+
+                @case(4)
+                // 先检查Google reCAPTCHA有没有进行验证
+                if ($('#h-captcha-response').val() === '') {
+                    swal.fire({
+                        title: '{{ trans('auth.captcha.required') }}',
+                        icon: 'error'
+                    });
+                    return false;
+                }
+                @break
+
+                @default
             @endswitch
         });
     </script>

+ 12 - 13
resources/views/auth/reset.blade.php

@@ -1,30 +1,29 @@
 @extends('auth.layouts')
 @section('title', trans('auth.password.reset.attribute'))
 @section('content')
-    <form action="{{url(Request::getRequestUri())}}" method="post" class="register-form">
+    <form class="register-form" action="{{ url(Request::getRequestUri()) }}" method="post">
         @csrf
-        @if(Session::has('successMsg'))
-            <x-alert type="success" :message="Session::pull('successMsg')"/>
+        @if (Session::has('successMsg'))
+            <x-alert type="success" :message="Session::pull('successMsg')" />
         @endif
-        @if($errors->any())
-            <x-alert type="danger" :message="$errors->all()"/>
+        @if ($errors->any())
+            <x-alert type="danger" :message="$errors->all()" />
         @else
             <div class="form-title">
-                {{trans('auth.password.reset.attribute')}}
+                {{ trans('auth.password.reset.attribute') }}
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input class="form-control" type="password" autocomplete="off" name="password" required/>
-                <label class="floating-label" for="password">{{trans('auth.password.new')}}</label>
+                <input class="form-control" name="password" type="password" autocomplete="off" required />
+                <label class="floating-label" for="password">{{ trans('auth.password.new') }}</label>
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input class="form-control" type="password" autocomplete="off" name="password_confirmation" required/>
-                <label class="floating-label" for="password_confirmation">{{trans('validation.attributes.password_confirmation')}}</label>
+                <input class="form-control" name="password_confirmation" type="password" autocomplete="off" required />
+                <label class="floating-label" for="password_confirmation">{{ trans('validation.attributes.password_confirmation') }}</label>
             </div>
         @endif
-        <a href="{{route('login')}}"
-           class="btn btn-danger btn-lg {{$verify->status=== 0? 'float-left': 'btn-block'}}">{{trans('common.back')}}</a>
+        <a class="btn btn-danger btn-lg {{ $verify->status === 0 ? 'float-left' : 'btn-block' }}" href="{{ route('login') }}">{{ trans('common.back') }}</a>
         @if ($verify->status === 0)
-            <button type="submit" class="btn btn-primary btn-lg float-right">{{trans('common.submit')}}</button>
+            <button class="btn btn-primary btn-lg float-right" type="submit">{{ trans('common.submit') }}</button>
         @endif
     </form>
 @endsection

+ 13 - 13
resources/views/auth/resetPassword.blade.php

@@ -2,31 +2,31 @@
 @section('title', trans('auth.password.reset.attribute'))
 @section('content')
     @if (Session::has('successMsg'))
-        <x-alert type="success" :message="Session::pull('successMsg')"/>
+        <x-alert type="success" :message="Session::pull('successMsg')" />
     @endif
-    @if($errors->any())
-        <x-alert type="danger" :message="$errors->all()"/>
+    @if ($errors->any())
+        <x-alert type="danger" :message="$errors->all()" />
     @endif
-    <form method="post" action="{{route('resetPasswd')}}">
+    <form method="post" action="{{ route('resetPasswd') }}">
         @csrf
-        @if(sysConfig('password_reset_notification'))
+        @if (sysConfig('password_reset_notification'))
             <div class="form-title">
-                {{trans('auth.password.reset.attribute')}}
+                {{ trans('auth.password.reset.attribute') }}
             </div>
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input type="text" class="form-control" name="username" value="{{old('username')}}" autofocus required/>
+                <input class="form-control" name="username" type="text" value="{{ old('username') }}" autofocus required />
                 <label class="floating-label" for="username">
-                    {{sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username')}}
+                    {{ sysConfig('username_type') === 'email' || sysConfig('username_type') === null ? trans('validation.attributes.email') : trans('model.user.username') }}
                 </label>
             </div>
         @else
-            <x-alert type="danger" :message="trans('auth.password.reset.error.disabled' ,['email' => sysConfig('webmaster_email')])"/>
+            <x-alert type="danger" :message="trans('auth.password.reset.error.disabled', ['email' => sysConfig('webmaster_email')])" />
         @endif
-        <a href="{{route('login')}}" class="btn btn-danger btn-lg {{sysConfig('password_reset_notification')? 'float-left':'btn-block'}}">
-            {{trans('common.back')}}
+        <a class="btn btn-danger btn-lg {{ sysConfig('password_reset_notification') ? 'float-left' : 'btn-block' }}" href="{{ route('login') }}">
+            {{ trans('common.back') }}
         </a>
-        @if(sysConfig('password_reset_notification'))
-            <button type="submit" class="btn btn-primary btn-lg float-right">{{trans('common.submit')}}</button>
+        @if (sysConfig('password_reset_notification'))
+            <button class="btn btn-primary btn-lg float-right" type="submit">{{ trans('common.submit') }}</button>
         @endif
     </form>
 @endsection

+ 4 - 5
resources/views/auth/safe.blade.php

@@ -1,16 +1,15 @@
 @extends('auth.layouts')
-@section('title', sysConfig('website_name').' - '.trans('errors.safe_enter'))
+@section('title', sysConfig('website_name') . ' - ' . trans('errors.safe_enter'))
 @section('content')
     <form role="form" action="/login?securityCode=">
         <div class="form-group">
             <div class="form-group form-material floating" data-plugin="formMaterial">
-                <input class="form-control" id="securityCode" name="securityCode"
-                       placeholder="" type="text">
-                <label class="floating-label" for="securityCode">{{trans('errors.safe_code')}}</label>
+                <input class="form-control" id="securityCode" name="securityCode" type="text" placeholder="">
+                <label class="floating-label" for="securityCode">{{ trans('errors.safe_code') }}</label>
             </div>
         </div>
         <div class="text-center">
-            <button type="submit" class="btn btn-lg btn-block mt-40 bg-indigo-500 text-white">{{trans('common.confirm')}}</button>
+            <button class="btn btn-lg btn-block mt-40 bg-indigo-500 text-white" type="submit">{{ trans('common.confirm') }}</button>
         </div>
     </form>
 @endsection

+ 7 - 7
resources/views/components/alert.blade.php

@@ -1,18 +1,18 @@
-<div {{ $attributes->merge(['class' => 'alert  alert-dismissible alert-'.$type]) }} role="alert">
+<div role="alert" {{ $attributes->merge(['class' => 'alert  alert-dismissible alert-' . $type]) }}>
     <button class="close" data-dismiss="alert" aria-label="{{ trans('common.close') }}">
-        <span aria-hidden="true">&times;</span><span class="sr-only">{{trans('common.close')}}</span>
+        <span aria-hidden="true">&times;</span><span class="sr-only">{{ trans('common.close') }}</span>
     </button>
-    @if(is_array($message))
-        @if(count($message) > 1)
+    @if (is_array($message))
+        @if (count($message) > 1)
             <ul>
-                @foreach($message as $data)
+                @foreach ($message as $data)
                     <li>{!! $data !!}</li>
                 @endforeach
             </ul>
         @else
-            {!! $message[0]!!}
+            {!! $message[0] !!}
         @endif
     @else
         {!! $message !!}
     @endif
-</div>
+</div>

+ 1 - 1
resources/views/components/message.blade.php

@@ -1,6 +1,6 @@
 @extends('_layout')
 @section('title', sysConfig('website_name'))
-@section('body_class','page-login-v3 layout-full')
+@section('body_class', 'page-login-v3 layout-full')
 @section('layout_css')
     <style>
         .layout-full {

+ 5 - 7
resources/views/components/payment/detail.blade.php

@@ -1,6 +1,6 @@
 @extends('_layout')
 @section('title', sysConfig('website_name'))
-@section('body_class','page-login-v3 layout-full')
+@section('body_class', 'page-login-v3 layout-full')
 @section('layout_css')
     <style>
         .layout-full {
@@ -26,11 +26,10 @@
         <div class="page-content container vertical-align-middle">
             <div class="row">
                 <div class="col-md-6">
-                    <div class="panel panel-line @if( $order->status === 2 ) panel-success @else panel-danger @endif">
+                    <div class="panel panel-line @if ($order->status === 2) panel-success @else panel-danger @endif">
                         <div class="panel-heading">
                             <h3 class="panel-title">
-                                <i class="icon wb-shopping-cart"
-                                   aria-hidden="true"></i> {{trans('user.invoice.detail')}}
+                                <i class="icon wb-shopping-cart" aria-hidden="true"></i> {{ trans('user.invoice.detail') }}
                             </h3>
                         </div>
                         <div class="panel-body">
@@ -48,7 +47,7 @@
                                 <li class="list-group-item">
                                     {{ trans('user.bought_at') }}: {{ $order->created_at }}
                                 </li>
-                                @if($order->expired_at)
+                                @if ($order->expired_at)
                                     <li class="list-group-item">
                                         {{ trans('common.expired_at') }}: {{ $order->expired_at }}
                                     </li>
@@ -64,8 +63,7 @@
                     <div class="panel panel-line panel-default">
                         <div class="panel-heading">
                             <h3 class="panel-title">
-                                <i class="icon wb-user-circle"
-                                   aria-hidden="true"></i> {{ trans('admin.ticket.user_info') }}
+                                <i class="icon wb-user-circle" aria-hidden="true"></i> {{ trans('admin.ticket.user_info') }}
                             </h3>
                         </div>
                         <div class="panel-body">

+ 3 - 3
resources/views/components/system/input-file.blade.php

@@ -2,10 +2,10 @@
 
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-form-label col-md-3" for="{{$code}}">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-form-label col-md-3" for="{{ $code }}">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-8">
-            <input type="file" name="{{$code}}" data-plugin="dropify" data-default-file="{{asset($value ?? '/assets/images/default.png')}}"/>
-            <button type="submit" class="btn btn-success float-right mt-10">{{ trans('common.submit') }}</button>
+            <input name="{{ $code }}" data-plugin="dropify" data-default-file="{{ asset($value ?? '/assets/images/default.png') }}" type="file" />
+            <button class="btn btn-success float-right mt-10" type="submit">{{ trans('common.submit') }}</button>
         </div>
     </div>
 </div>

+ 14 - 14
resources/views/components/system/input-limit.blade.php

@@ -2,40 +2,40 @@
 
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-md-3 col-form-label">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-md-3 col-form-label">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-7">
             @isset($hcode)
                 <div class="input-group">
-                    <label for="{{$code}}"></label>
-                    <input type="number" class="form-control" id="{{$code}}" value="{{$value}}"
-                           onchange="updateFromInput('{{$code}}', {{$min}},{{$max}})"/>
+                    <label for="{{ $code }}"></label>
+                    <input class="form-control" id="{{ $code }}" type="number" value="{{ $value }}"
+                           onchange="updateFromInput('{{ $code }}', {{ $min }},{{ $max }})" />
                     <div class="input-group-prepend">
                         <span class="input-group-text"> ~ </span>
                     </div>
-                    <label for="{{$hcode}}"></label>
-                    <input type="number" class="form-control" id="{{$hcode}}" value="{{$hvalue}}"
-                           onchange="updateFromInput('{{$hcode}}',{{$hmin}},{{$hmax}})"/>
+                    <label for="{{ $hcode }}"></label>
+                    <input class="form-control" id="{{ $hcode }}" type="number" value="{{ $hvalue }}"
+                           onchange="updateFromInput('{{ $hcode }}',{{ $hmin }},{{ $hmax }})" />
                     @isset($unit)
                         <div class="input-group-prepend">
-                            <span class="input-group-text"> {{$unit}} </span>
+                            <span class="input-group-text"> {{ $unit }} </span>
                         </div>
                     @endisset
                 </div>
             @else
                 <div class="input-group">
-                    <input type="number" class="form-control" id="{{$code}}" value="{{$value}}"/>
+                    <input class="form-control" id="{{ $code }}" type="number" value="{{ $value }}" />
                     <div class="input-group-append">
                         @isset($unit)
-                            <span class="input-group-text">{{$unit}}</span>
+                            <span class="input-group-text">{{ $unit }}</span>
                         @endisset
                         <button class="btn btn-primary" type="button"
-                                onclick="updateFromInput('{{$code}}', {{$min}}, {{$max}})">{{trans('common.update')}}</button>
+                                onclick="updateFromInput('{{ $code }}', {{ $min }}, {{ $max }})">{{ trans('common.update') }}</button>
                     </div>
                 </div>
             @endisset
-            @if(trans('admin.system.hint.'.$code) !== 'admin.system.hint.'.$code)
-                <span class="text-help"> {!! trans('admin.system.hint.'.$code) !!} </span>
+            @if (trans('admin.system.hint.' . $code) !== 'admin.system.hint.' . $code)
+                <span class="text-help"> {!! trans('admin.system.hint.' . $code) !!} </span>
             @endisset
-        </div>
     </div>
 </div>
+</div>

+ 8 - 7
resources/views/components/system/input-test.blade.php

@@ -1,18 +1,19 @@
 @props(['type' => 'text', 'code', 'value', 'holder' => null, 'test'])
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-md-3 col-form-label" for="{{$code}}">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-md-3 col-form-label" for="{{ $code }}">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-6">
             <div class="input-group">
-                <input type="{{$type}}" class="form-control" id="{{$code}}" value="{{$value}}" placeholder="{!! $holder !!}"/>
+                <input class="form-control" id="{{ $code }}" type="{{ $type }}" value="{{ $value }}" placeholder="{!! $holder !!}" />
                 <span class="input-group-append">
-                    <button class="btn btn-primary" type="button" onclick="update('{{$code}}')">{{trans('common.update')}}</button>
+                    <button class="btn btn-primary" type="button" onclick="update('{{ $code }}')">{{ trans('common.update') }}</button>
                 </span>
             </div>
-            @if(trans('admin.system.hint.'.$code) !== 'admin.system.hint.'.$code)
-                <span class="text-help"> {!! trans('admin.system.hint.'.$code) !!} @can('admin.test.notify')
-                        <a href="javascript:sendTestNotification('{{$test}}');">[{{ trans('admin.system.notification.send_test') }}]</a>
-                    @endcan</span>
+            @if (trans('admin.system.hint.' . $code) !== 'admin.system.hint.' . $code)
+                <span class="text-help"> {!! trans('admin.system.hint.' . $code) !!} @can('admin.test.notify')
+                        <a href="javascript:sendTestNotification('{{ $test }}');">[{{ trans('admin.system.notification.send_test') }}]</a>
+                    @endcan
+                </span>
             @endisset
         </div>
     </div>

+ 7 - 7
resources/views/components/system/input.blade.php

@@ -2,20 +2,20 @@
 
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-md-3 col-form-label" for="{{$code}}">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-md-3 col-form-label" for="{{ $code }}">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-6">
             <div class="input-group">
-                <input type="{{$type}}" class="form-control" id="{{$code}}" value="{{$value}}" placeholder="{{$holder}}"/>
+                <input class="form-control" id="{{ $code }}" type="{{ $type }}" value="{{ $value }}" placeholder="{{ $holder }}" />
                 <span class="input-group-append">
-                    <button class="btn btn-primary" type="button" onclick="update('{{$code}}')">{{trans('common.update')}}</button>
+                    <button class="btn btn-primary" type="button" onclick="update('{{ $code }}')">{{ trans('common.update') }}</button>
                 </span>
             </div>
-            @if(trans('admin.system.hint.'.$code) !== 'admin.system.hint.'.$code)
+            @if (trans('admin.system.hint.' . $code) !== 'admin.system.hint.' . $code)
                 <span class="text-help">
-                     @if(isset($url))
-                        {!! trans('admin.system.hint.'.$code, ['url' => $url]) !!}
+                    @if (isset($url))
+                        {!! trans('admin.system.hint.' . $code, ['url' => $url]) !!}
                     @else
-                        {!! trans('admin.system.hint.'.$code) !!}
+                        {!! trans('admin.system.hint.' . $code) !!}
                     @endif
                 </span>
             @endif

+ 7 - 6
resources/views/components/system/select.blade.php

@@ -2,16 +2,17 @@
 
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-md-3 col-form-label" for="{{$code}}">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-md-3 col-form-label" for="{{ $code }}">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-9">
-            <select id="{{$code}}" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','{{$code}}')" @if ($multiple) multiple @endif>
+            <select id="{{ $code }}" data-plugin="selectpicker" data-style="btn-outline btn-primary"
+                    onchange="updateFromOther('select','{{ $code }}')" @if ($multiple) multiple @endif>
                 @foreach ($list as $key => $value)
-                    <option value="{{$value}}">{{$key}}</option>
+                    <option value="{{ $value }}">{{ $key }}</option>
                 @endforeach
             </select>
-            @if(trans('admin.system.hint.'.$code) !== 'admin.system.hint.'.$code)
-                <span class="text-help"> {!! trans('admin.system.hint.'.$code) !!} </span>
+            @if (trans('admin.system.hint.' . $code) !== 'admin.system.hint.' . $code)
+                <span class="text-help"> {!! trans('admin.system.hint.' . $code) !!} </span>
             @endisset
-        </div>
     </div>
 </div>
+</div>

+ 7 - 6
resources/views/components/system/switch.blade.php

@@ -2,15 +2,16 @@
 
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-md-3 col-form-label" for="{{$code}}">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-md-3 col-form-label" for="{{ $code }}">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-9">
-            <input type="checkbox" id="{{$code}}" data-plugin="switchery" @if($check) checked @endif onchange="updateFromOther('switch','{{$code}}')">
-            @if(trans('admin.system.hint.'.$code) !== 'admin.system.hint.'.$code)
+            <input id="{{ $code }}" data-plugin="switchery" type="checkbox" @if ($check) checked @endif
+                   onchange="updateFromOther('switch','{{ $code }}')">
+            @if (trans('admin.system.hint.' . $code) !== 'admin.system.hint.' . $code)
                 <span class="text-help">
-                     @if(isset($url))
-                        {!! trans('admin.system.hint.'.$code, ['url' => $url]) !!}
+                    @if (isset($url))
+                        {!! trans('admin.system.hint.' . $code, ['url' => $url]) !!}
                     @else
-                        {!! trans('admin.system.hint.'.$code) !!}
+                        {!! trans('admin.system.hint.' . $code) !!}
                     @endif
                 </span>
             @endif

+ 2 - 2
resources/views/components/system/tab-pane.blade.php

@@ -1,7 +1,7 @@
 @props(['active' => false, 'id', 'slot'])
 
-<div class="tab-pane {{$active ? 'active' : ''}}" id="{{$id}}" role="tabpanel">
+<div class="tab-pane {{ $active ? 'active' : '' }}" id="{{ $id }}" role="tabpanel">
     <div class="form-row">
-        {{$slot}}
+        {{ $slot }}
     </div>
 </div>

+ 6 - 6
resources/views/components/system/textarea.blade.php

@@ -2,17 +2,17 @@
 
 <div class="form-group col-lg-6">
     <div class="row">
-        <label class="col-md-3 col-form-label" for="{{$code}}">{{ trans('admin.system.'.$code) }}</label>
+        <label class="col-md-3 col-form-label" for="{{ $code }}">{{ trans('admin.system.' . $code) }}</label>
         <div class="col-md-8">
             <div class="input-group">
-                <textarea class="form-control" rows={{$row}} id="{{$code}}">{{$value}}</textarea>
+                <textarea class="form-control" id="{{ $code }}" rows={{ $row }}>{{ $value }}</textarea>
                 <span class="input-group-append">
-                    <button class="btn btn-primary" type="button" onclick="update('{{$code}}')">{{trans('common.update')}}</button>
+                    <button class="btn btn-primary" type="button" onclick="update('{{ $code }}')">{{ trans('common.update') }}</button>
                 </span>
             </div>
-            @if(trans('admin.system.hint.'.$code) !== 'admin.system.hint.'.$code)
-                <span class="text-help"> {!! trans('admin.system.hint.'.$code) !!} </span>
+            @if (trans('admin.system.hint.' . $code) !== 'admin.system.hint.' . $code)
+                <span class="text-help"> {!! trans('admin.system.hint.' . $code) !!} </span>
             @endisset
-        </div>
     </div>
 </div>
+</div>

+ 0 - 2
resources/views/mail/custom.blade.php

@@ -1,5 +1,3 @@
 @component('mail::message')
-
     {!! $content !!}
-
 @endcomponent

+ 2 - 3
resources/views/mail/simpleMarkdown.blade.php

@@ -1,10 +1,9 @@
 @component('mail::message')
-    # {{$title}}
+    # {{ $title }}
 
     {!! $content !!}
 
     @component('mail::button', ['url' => $url])
-        {{trans('notification.view_web')}}
+        {{ trans('notification.view_web') }}
     @endcomponent
 @endcomponent
-

+ 16 - 17
resources/views/user/components/notification.blade.php

@@ -1,24 +1,23 @@
 <li class="nav-item dropdown">
-    <a class="nav-link" data-toggle="dropdown" href="javascript:void(0)" title="Notifications"
-       aria-expanded="false" data-animation="scale-up" role="button">
+    <a class="nav-link" data-toggle="dropdown" data-animation="scale-up" href="javascript:void(0)" title="Notifications" role="button" aria-expanded="false">
         <i class="icon wb-bell" aria-hidden="true"></i>
         @if ($unreadCount = auth()->user()->unreadNotifications->count())
-            <span class="badge badge-pill badge-danger up">{{$unreadCount}}</span>
+            <span class="badge badge-pill badge-danger up">{{ $unreadCount }}</span>
         @endif
     </a>
     <div class="dropdown-menu dropdown-menu-right dropdown-menu-media" role="menu">
         <div class="dropdown-menu-header">
-            <h5>{{trans('notification.attribute')}}</h5>
+            <h5>{{ trans('notification.attribute') }}</h5>
             @if ($unreadCount)
-                <span class="badge badge-round badge-danger">{{trans_choice('notification.new', $unreadCount, ['num' => $unreadCount])}}</span>
+                <span class="badge badge-round badge-danger">{{ trans_choice('notification.new', $unreadCount, ['num' => $unreadCount]) }}</span>
             @endif
         </div>
         @if ($unreadCount)
             <div class="list-group">
                 <div data-role="container">
                     <div data-role="content">
-                        @foreach(tap(auth()->user()->unreadNotifications)->markAsRead() as $notification)
-                            @include('user.components.notifications.'.Str::camel(class_basename($notification->type)))
+                        @foreach (tap(auth()->user()->unreadNotifications)->markAsRead() as $notification)
+                            @include('user.components.notifications.' . Str::camel(class_basename($notification->type)))
                         @endforeach
                     </div>
                 </div>
@@ -31,21 +30,21 @@
                             <i class="icon wb-inbox bg-grey-600 white icon-circle" aria-hidden="true"></i>
                         </div>
                         <div class="media-body">
-                            <h6 class="media-heading">{{trans('notification.empty')}}</h6>
+                            <h6 class="media-heading">{{ trans('notification.empty') }}</h6>
 
-                            <time class="media-meta" datetime="{{now()}}">{{now()}}</time>
+                            <time class="media-meta" datetime="{{ now() }}">{{ now() }}</time>
                         </div>
                     </div>
                 </div>
             </div>
         @endif
-        {{--        <div class="dropdown-menu-footer">--}}
-        {{--            <a class="dropdown-menu-footer-btn" href="javascript:void(0)" role="button">--}}
-        {{--                <i class="icon wb-settings" aria-hidden="true"></i>--}}
-        {{--            </a>--}}
-        {{--            <a class="dropdown-item" href="javascript:void(0)" role="menuitem">--}}
-        {{--                All notifications--}}
-        {{--            </a>--}}
-        {{--        </div>--}}
+        {{--        <div class="dropdown-menu-footer"> --}}
+        {{--            <a class="dropdown-menu-footer-btn" href="javascript:void(0)" role="button"> --}}
+        {{--                <i class="icon wb-settings" aria-hidden="true"></i> --}}
+        {{--            </a> --}}
+        {{--            <a class="dropdown-item" href="javascript:void(0)" role="menuitem"> --}}
+        {{--                All notifications --}}
+        {{--            </a> --}}
+        {{--        </div> --}}
     </div>
 </li>

+ 3 - 3
resources/views/user/components/notifications/accountExpire.blade.php

@@ -5,9 +5,9 @@
         </div>
         <div class="media-body">
             <h6 class="media-heading text-break">
-                {{trans('notification.account_expired_blade', ['days' => $notification->data['days']])}}
+                {{ trans('notification.account_expired_blade', ['days' => $notification->data['days']]) }}
             </h6>
-            <time class="media-meta" datetime="{{$notification->created_at}}">{{$notification->created_at->diffForHumans()}}</time>
+            <time class="media-meta" datetime="{{ $notification->created_at }}">{{ $notification->created_at->diffForHumans() }}</time>
         </div>
     </div>
-</a>
+</a>

+ 3 - 3
resources/views/user/components/notifications/dataExhaust.blade.php

@@ -5,9 +5,9 @@
         </div>
         <div class="media-body">
             <h6 class="media-heading text-break">
-                {{trans('notification.traffic_remain', ['percent' => $notification->data['percent']])}}
+                {{ trans('notification.traffic_remain', ['percent' => $notification->data['percent']]) }}
             </h6>
-            <time class="media-meta" datetime="{{$notification->created_at}}">{{$notification->created_at->diffForHumans()}}</time>
+            <time class="media-meta" datetime="{{ $notification->created_at }}">{{ $notification->created_at->diffForHumans() }}</time>
         </div>
     </div>
-</a>
+</a>

+ 4 - 4
resources/views/user/components/notifications/paymentReceived.blade.php

@@ -1,13 +1,13 @@
-<a class="list-group-item dropdown-item" href="{{route('invoiceInfo', $notification->data['sn'])}}" role="menuitem">
+<a class="list-group-item dropdown-item" href="{{ route('invoiceInfo', $notification->data['sn']) }}" role="menuitem">
     <div class="media">
         <div class="pr-10">
             <i class="icon wb-order bg-primary-600 white icon-circle" aria-hidden="true"></i>
         </div>
         <div class="media-body">
             <h6 class="media-heading text-break">
-                {{trans('notification.payment_received', ['order' => '#'.$notification->data['sn'], 'amount'=>$notification->data['amount']])}}
+                {{ trans('notification.payment_received', ['order' => '#' . $notification->data['sn'], 'amount' => $notification->data['amount']]) }}
             </h6>
-            <time class="media-meta" datetime="{{$notification->created_at}}">{{$notification->created_at->diffForHumans()}}</time>
+            <time class="media-meta" datetime="{{ $notification->created_at }}">{{ $notification->created_at->diffForHumans() }}</time>
         </div>
     </div>
-</a>
+</a>

+ 50 - 38
resources/views/user/components/payment/default.blade.php

@@ -4,7 +4,7 @@
         <div class="panel panel-bordered">
             <div class="panel-heading">
                 <h1 class="panel-title cyan-600">
-                    <i class="icon wb-payment" aria-hidden="true"></i>{{sysConfig('website_name').' - '.trans('user.shop.pay_online')}}
+                    <i class="icon wb-payment" aria-hidden="true"></i>{{ sysConfig('website_name') . ' - ' . trans('user.shop.pay_online') }}
                 </h1>
             </div>
             <div class="panel-body border-primary ml-auto mr-auto w-p75">
@@ -14,19 +14,19 @@
                 <div class="row">
                     <div class="col-md-6">
                         <ul class="list-group list-group-dividered">
-                            <li class="list-group-item">{{trans('user.shop.service').': '.$name}}</li>
-                            <li class="list-group-item">{{trans('user.shop.price').': '.$payment->amount_tag}}</li>
-                            @if($days !== 0)
-                                <li class="list-group-item">{{trans('common.available_date').': '.$days.trans_choice('common.days.attribute', 1)}}</li>
+                            <li class="list-group-item">{{ trans('user.shop.service') . ': ' . $name }}</li>
+                            <li class="list-group-item">{{ trans('user.shop.price') . ': ' . $payment->amount_tag }}</li>
+                            @if ($days !== 0)
+                                <li class="list-group-item">{{ trans('common.available_date') . ': ' . $days . trans_choice('common.days.attribute', 1) }}</li>
                             @endif
                             <li class="list-group-item"> {!! trans('user.payment.close_tips', ['minutes' => config('tasks.close.orders')]) !!}</li>
                         </ul>
                     </div>
                     <div class="col-auto mx-auto">
-                        @if($payment->qr_code && $payment->url)
-                            <div id="qrcode" class=" w-p100 h-p100"></div>
+                        @if ($payment->qr_code && $payment->url)
+                            <div class=" w-p100 h-p100" id="qrcode"></div>
                         @else
-                            <img class="h-250 w-250" src="{{$payment->qr_code}}" alt="{{trans('common.qrcode', ['attribute' => trans('user.pay')])}}">
+                            <img class="h-250 w-250" src="{{ $payment->qr_code }}" alt="{{ trans('common.qrcode', ['attribute' => trans('user.pay')]) }}">
                         @endif
                     </div>
                 </div>
@@ -38,42 +38,54 @@
     </div>
 @endsection
 @section('javascript')
-    @if($payment->qr_code && $payment->url)
+    @if ($payment->qr_code && $payment->url)
         <script src="/assets/custom/easy.qrcode.min.js"></script>
         <script>
-          // Options
-          const options = {
-            text: @json($payment->url),
-            backgroundImage: '{{asset($pay_type_icon)}}',
-            autoColor: true,
-          };
+            // Options
+            const options = {
+                text: @json($payment->url),
+                backgroundImage: '{{ asset($pay_type_icon) }}',
+                autoColor: true,
+            };
 
-          // Create QRCode Object
-          new QRCode(document.getElementById('qrcode'), options);
+            // Create QRCode Object
+            new QRCode(document.getElementById('qrcode'), options);
         </script>
     @endif
 
     <script>
-      // 检查支付单状态
-      const r = window.setInterval(function() {
-        $.ajax({
-          method: 'GET',
-          url: '{{route('orderStatus')}}',
-          data: {trade_no: '{{$payment->trade_no}}'},
-          dataType: 'json',
-          success: function(ret) {
-            window.clearInterval();
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success', timer: 1500, showConfirmButton: false}).then(() => {
-                window.location.href = '{{route('invoice')}}';
-              });
-            } else if (ret.status === 'error') {
-              swal.fire({title: ret.message, icon: 'error', timer: 1500, showConfirmButton: false}).then(() => {
-                window.location.href = '{{route('invoice')}}';
-              });
-            }
-          },
-        });
-      }, 3000);
+        // 检查支付单状态
+        const r = window.setInterval(function() {
+            $.ajax({
+                method: 'GET',
+                url: '{{ route('orderStatus') }}',
+                data: {
+                    trade_no: '{{ $payment->trade_no }}'
+                },
+                dataType: 'json',
+                success: function(ret) {
+                    window.clearInterval();
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success',
+                            timer: 1500,
+                            showConfirmButton: false
+                        }).then(() => {
+                            window.location.href = '{{ route('invoice') }}';
+                        });
+                    } else if (ret.status === 'error') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error',
+                            timer: 1500,
+                            showConfirmButton: false
+                        }).then(() => {
+                            window.location.href = '{{ route('invoice') }}';
+                        });
+                    }
+                },
+            });
+        }, 3000);
     </script>
 @endsection

+ 113 - 108
resources/views/user/components/payment/manual.blade.php

@@ -53,7 +53,7 @@
             max-width: 300px;
         }
 
-        #ad > button {
+        #ad>button {
             position: absolute;
             right: 0;
             top: 0;
@@ -64,13 +64,13 @@
 @section('content')
     <div id="ad">
         <button class="btn btn-pure btn-outline-light icon wb-close" type="button" onclick="document.getElementById('ad').style.display = 'none'"></button>
-        <img src="{{asset('assets/images/help/作者要饭求放过.PNG')}}" alt="{{ trans('user.manual.red_packet') }}">
+        <img src="{{ asset('assets/images/help/作者要饭求放过.PNG') }}" alt="{{ trans('user.manual.red_packet') }}">
     </div>
     <div class="page-content container">
         <div class="panel panel-bordered">
             <div class="panel-heading">
                 <h1 class="panel-title cyan-600">
-                    <i class="icon wb-payment"></i>{{sysConfig('website_name').' '.trans('common.payment.manual')}}
+                    <i class="icon wb-payment"></i>{{ sysConfig('website_name') . ' ' . trans('common.payment.manual') }}
                 </h1>
             </div>
             <div class="panel-body">
@@ -101,13 +101,13 @@
                     </div>
                 </div>
 
-                <div id="payment-group" class="w-p100 text-center mb-20">
+                <div class="w-p100 text-center mb-20" id="payment-group">
                     <div class="w-md-p50 w-p100 mx-auto btn-group">
-                        @if(sysConfig('wechat_qrcode'))
-                            <button id="btn-wechat" class="btn btn-lg btn-block" onclick="show(0)">{{trans('common.payment.wechat')}}</button>
+                        @if (sysConfig('wechat_qrcode'))
+                            <button class="btn btn-lg btn-block" id="btn-wechat" onclick="show(0)">{{ trans('common.payment.wechat') }}</button>
                         @endif
-                        @if(sysConfig('alipay_qrcode'))
-                            <button id="btn-alipay" class="btn mt-0 btn-lg btn-block" onclick="show(1)">{{trans('common.payment.alipay')}}</button>
+                        @if (sysConfig('alipay_qrcode'))
+                            <button class="btn mt-0 btn-lg btn-block" id="btn-alipay" onclick="show(1)">{{ trans('common.payment.alipay') }}</button>
                         @endif
                     </div>
                 </div>
@@ -115,17 +115,17 @@
                     <div class="wechat hide">
                         <div class="mx-auto text-center">
                             <h4>{{ trans('user.manual.remark') }}</h4>
-                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_wechat1.png')}}" alt=""/>
+                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{ asset('assets/images/help/manual_wechat1.png') }}" alt="" />
                             <h4>{{ trans('user.manual.remark_content') }}</h4>
-                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_wechat2.png')}}" alt=""/>
+                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{ asset('assets/images/help/manual_wechat2.png') }}" alt="" />
                         </div>
                     </div>
                     <div class="alipay hide">
                         <div class="mx-auto text-center">
                             <h4>{{ trans('user.manual.remark') }}</h4>
-                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_alipay1.png')}}" alt=""/>
+                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{ asset('assets/images/help/manual_alipay1.png') }}" alt="" />
                             <h4>{{ trans('user.manual.remark_content') }}</h4>
-                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_alipay2.png')}}" alt=""/>
+                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{ asset('assets/images/help/manual_alipay2.png') }}" alt="" />
                         </div>
                     </div>
                 </div>
@@ -136,7 +136,7 @@
                             <div class="alert alert-info">
                                 {!! trans('user.payment.qrcode_tips', ['software' => trans('common.payment.wechat')]) !!}
                             </div>
-                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset(sysConfig('wechat_qrcode'))}}" alt=""/>
+                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{ asset(sysConfig('wechat_qrcode')) }}" alt="" />
                         </div>
                     </div>
                     <div class="alipay hide">
@@ -144,7 +144,7 @@
                             <div class="alert alert-info">
                                 {!! trans('user.payment.qrcode_tips', ['software' => trans('common.payment.alipay')]) !!}
                             </div>
-                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset(sysConfig('alipay_qrcode'))}}" alt=""/>
+                            <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{ asset(sysConfig('alipay_qrcode')) }}" alt="" />
                         </div>
                     </div>
                     <div class="alert alert-danger text-center">
@@ -158,18 +158,18 @@
                     </div>
                     <div class="mx-auto w-md-p50 w-lg-p25">
                         <ul class="list-group list-group-dividered">
-                            <li class="list-group-item">{{trans('user.shop.service').': '.$name}}</li>
-                            <li class="list-group-item">{{trans('user.shop.price').': '.$payment->amount_tag}}</li>
-                            @if($days !== 0)
-                                <li class="list-group-item">{{trans('common.available_date').': '.$days.trans_choice('common.days.attribute', 1)}}</li>
+                            <li class="list-group-item">{{ trans('user.shop.service') . ': ' . $name }}</li>
+                            <li class="list-group-item">{{ trans('user.shop.price') . ': ' . $payment->amount_tag }}</li>
+                            @if ($days !== 0)
+                                <li class="list-group-item">{{ trans('common.available_date') . ': ' . $days . trans_choice('common.days.attribute', 1) }}</li>
                             @endif
                         </ul>
                     </div>
                 </div>
 
                 <div class="clearfix">
-                    <button type="button" class="btn btn-lg btn-default float-left" id="prevBtn" onclick="nextPrev(-1)">{{ trans('user.manual.pre') }}</button>
-                    <button type="button" class="btn btn-lg btn-primary float-right" id="nextBtn" onclick="nextPrev(1)">{{ trans('user.manual.next') }}</button>
+                    <button class="btn btn-lg btn-default float-left" id="prevBtn" type="button" onclick="nextPrev(-1)">{{ trans('user.manual.pre') }}</button>
+                    <button class="btn btn-lg btn-primary float-right" id="nextBtn" type="button" onclick="nextPrev(1)">{{ trans('user.manual.next') }}</button>
                 </div>
             </div>
         </div>
@@ -178,104 +178,109 @@
 
 @section('javascript')
     <script>
-      let currentTab = 0; // Current tab is set to be the first tab (0)
-      showTab(currentTab); // Display the current tab
-      show({{sysConfig('wechat_qrcode')? 0 : 1}});
+        let currentTab = 0; // Current tab is set to be the first tab (0)
+        showTab(currentTab); // Display the current tab
+        show({{ sysConfig('wechat_qrcode') ? 0 : 1 }});
 
-      function showTab(n) {
-        // This function will display the specified tab of the form ...
-        const x = document.getElementsByClassName('tab');
-        x[n].style.display = 'block';
-        // ... and fix the Previous/Next buttons:
-        if (n === 0) {
-          document.getElementById('prevBtn').style.display = 'none';
-        } else {
-          document.getElementById('prevBtn').style.display = 'inline';
-        }
-
-        if (n === x.length - 1) {
-          document.getElementById('payment-group').style.display = 'none';
-          document.getElementById('nextBtn').classList.remove('btn-primary');
-          document.getElementById('nextBtn').classList.add('btn-success');
-          document.getElementById('nextBtn').innerHTML = '{{trans('common.submit')}}';
-        } else {
-          document.getElementById('payment-group').style.display = 'inline-flex';
-          document.getElementById('nextBtn').innerHTML = '下一步';
-          document.getElementById('nextBtn').classList.remove('btn-success');
-          document.getElementById('nextBtn').classList.add('btn-primary');
-          document.getElementById('nextBtn').style.display = 'inline';
-        }
-
-        fixStepIndicator(n);
-      }
+        function showTab(n) {
+            // This function will display the specified tab of the form ...
+            const x = document.getElementsByClassName('tab');
+            x[n].style.display = 'block';
+            // ... and fix the Previous/Next buttons:
+            if (n === 0) {
+                document.getElementById('prevBtn').style.display = 'none';
+            } else {
+                document.getElementById('prevBtn').style.display = 'inline';
+            }
 
-      function nextPrev(n) {
-        // This function will figure out which tab to display
-        const x = document.getElementsByClassName('tab');
-        // if you have reached the end of the form... :
-        if (currentTab === x.length - 1 && n === 1) {
-          //...the form gets submitted:
-          $.post('{{route('manual.inform', ['payment' => $payment->trade_no])}}', {_token: '{{csrf_token()}}'}, function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({
-                title: '已受理',
-                text: ret.message,
-                icon: 'success',
-              }).then(() => window.location.href = '{{route('invoice')}}');
+            if (n === x.length - 1) {
+                document.getElementById('payment-group').style.display = 'none';
+                document.getElementById('nextBtn').classList.remove('btn-primary');
+                document.getElementById('nextBtn').classList.add('btn-success');
+                document.getElementById('nextBtn').innerHTML = '{{ trans('common.submit') }}';
             } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
+                document.getElementById('payment-group').style.display = 'inline-flex';
+                document.getElementById('nextBtn').innerHTML = '下一步';
+                document.getElementById('nextBtn').classList.remove('btn-success');
+                document.getElementById('nextBtn').classList.add('btn-primary');
+                document.getElementById('nextBtn').style.display = 'inline';
             }
-          });
-          return false;
-        } else {
-          x[currentTab].style.display = 'none';// Hide the current tab:
-          currentTab += n;// Increase or decrease the current tab by 1:
+
+            fixStepIndicator(n);
         }
 
-        showTab(currentTab);
-      }
+        function nextPrev(n) {
+            // This function will figure out which tab to display
+            const x = document.getElementsByClassName('tab');
+            // if you have reached the end of the form... :
+            if (currentTab === x.length - 1 && n === 1) {
+                //...the form gets submitted:
+                $.post('{{ route('manual.inform', ['payment' => $payment->trade_no]) }}', {
+                    _token: '{{ csrf_token() }}'
+                }, function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: '已受理',
+                            text: ret.message,
+                            icon: 'success',
+                        }).then(() => window.location.href = '{{ route('invoice') }}');
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        }).then(() => window.location.reload());
+                    }
+                });
+                return false;
+            } else {
+                x[currentTab].style.display = 'none'; // Hide the current tab:
+                currentTab += n; // Increase or decrease the current tab by 1:
+            }
 
-      function fixStepIndicator(n) {
-        // This function removes the "current" class of all steps...
-        let i, x = document.getElementsByClassName('step');
-        for (i = 0; i < x.length; i++) {
-          x[i].className = x[i].className.replace(' current', ' ');
+            showTab(currentTab);
         }
-        //... and adds the "active" class to the current step:
-        x[n].className += ' current';
-      }
 
-      function show(check) {
-          @if(sysConfig('wechat_qrcode'))
-        const $wechat = document.getElementsByClassName('wechat');
-        const $btn_wechat = document.getElementById('btn-wechat');
-        if (check) {
-          for (let i = 0; i < $wechat.length; i++) {
-            $wechat[i].style.display = 'none';
-          }
-          $btn_wechat.classList.remove('btn-success');
-        } else {
-          for (let i = 0; i < $wechat.length; i++) {
-            $wechat[i].style.display = 'inline';
-          }
-          $btn_wechat.classList.add('btn-success');
+        function fixStepIndicator(n) {
+            // This function removes the "current" class of all steps...
+            let i, x = document.getElementsByClassName('step');
+            for (i = 0; i < x.length; i++) {
+                x[i].className = x[i].className.replace(' current', ' ');
+            }
+            //... and adds the "active" class to the current step:
+            x[n].className += ' current';
         }
-          @endif
-          @if(sysConfig('alipay_qrcode'))
-        const $alipay = document.getElementsByClassName('alipay');
-        const $btn_alipay = document.getElementById('btn-alipay');
-        if (check) {
-          for (let i = 0; i < $alipay.length; i++) {
-            $alipay[i].style.display = 'inline';
-          }
-          $btn_alipay.classList.add('btn-primary');
-        } else {
-          for (let i = 0; i < $alipay.length; i++) {
-            $alipay[i].style.display = 'none';
-          }
-          $btn_alipay.classList.remove('btn-primary');
+
+        function show(check) {
+            @if (sysConfig('wechat_qrcode'))
+                const $wechat = document.getElementsByClassName('wechat');
+                const $btn_wechat = document.getElementById('btn-wechat');
+                if (check) {
+                    for (let i = 0; i < $wechat.length; i++) {
+                        $wechat[i].style.display = 'none';
+                    }
+                    $btn_wechat.classList.remove('btn-success');
+                } else {
+                    for (let i = 0; i < $wechat.length; i++) {
+                        $wechat[i].style.display = 'inline';
+                    }
+                    $btn_wechat.classList.add('btn-success');
+                }
+            @endif
+            @if (sysConfig('alipay_qrcode'))
+                const $alipay = document.getElementsByClassName('alipay');
+                const $btn_alipay = document.getElementById('btn-alipay');
+                if (check) {
+                    for (let i = 0; i < $alipay.length; i++) {
+                        $alipay[i].style.display = 'inline';
+                    }
+                    $btn_alipay.classList.add('btn-primary');
+                } else {
+                    for (let i = 0; i < $alipay.length; i++) {
+                        $alipay[i].style.display = 'none';
+                    }
+                    $btn_alipay.classList.remove('btn-primary');
+                }
+            @endif
         }
-          @endif
-      }
     </script>
 @endsection

+ 6 - 4
resources/views/user/components/payment/stripe.blade.php

@@ -1,10 +1,10 @@
 @extends('_layout')
 @section('title', sysConfig('website_name'))
-@section('body_class','page-login-v3 layout-full')
+@section('body_class', 'page-login-v3 layout-full')
 @section('layout_content')
     <div class="page vertical-align text-center" data-animsition-in="fade-in" data-animsition-out="fade-out">
         <div class="page-content vertical-align-middle">
-            <h2>{{trans('user.payment.redirect_stripe')}}</h2>
+            <h2>{{ trans('user.payment.redirect_stripe') }}</h2>
             <i class="mt-30 loader loader-ellipsis" aria-hidden="true"></i>
         </div>
     </div>
@@ -13,7 +13,9 @@
 @section('layout_javascript')
     <script src="https://js.stripe.com/v3/"></script>
     <script>
-      let stripe = Stripe('{{ sysConfig('stripe_public_key') }}');
-      let redirectData = stripe.redirectToCheckout({sessionId: '{{ $session_id  }}'});
+        let stripe = Stripe('{{ sysConfig('stripe_public_key') }}');
+        let redirectData = stripe.redirectToCheckout({
+            sessionId: '{{ $session_id }}'
+        });
     </script>
 @endsection

+ 19 - 19
resources/views/user/components/purchase.blade.php

@@ -1,39 +1,39 @@
-@if(sysConfig('is_AliPay'))
-    <button class="btn btn-round btn-outline-default mt-2" onclick="pay('{{sysConfig('is_AliPay')}}','1')">
-        <img src="/assets/images/payment/alipay.svg" height="36px" alt="{{ trans('common.payment.alipay') }}"/>
+@if (sysConfig('is_AliPay'))
+    <button class="btn btn-round btn-outline-default mt-2" onclick="pay('{{ sysConfig('is_AliPay') }}','1')">
+        <img src="/assets/images/payment/alipay.svg" alt="{{ trans('common.payment.alipay') }}" height="36px" />
     </button>
 @endif
-@if(sysConfig('is_QQPay'))
-    <button class="btn btn-round btn-outline-default mt-2" onclick="pay('{{sysConfig('is_QQPay')}}','2')">
-        <img src="/assets/images/payment/qqpay.svg" height="36px" alt="{{ trans('common.payment.alipay') }}"/>
+@if (sysConfig('is_QQPay'))
+    <button class="btn btn-round btn-outline-default mt-2" onclick="pay('{{ sysConfig('is_QQPay') }}','2')">
+        <img src="/assets/images/payment/qqpay.svg" alt="{{ trans('common.payment.alipay') }}" height="36px" />
     </button>
 @endif
-@if(sysConfig('is_WeChatPay'))
-    <button class="btn btn-round btn-outline-default mt-2" onclick="pay('{{sysConfig('is_WeChatPay')}}','3')">
-        <img src="/assets/images/payment/wechatpay.svg" height="36px" alt="{{ trans('common.payment.wechat') }}"/>
+@if (sysConfig('is_WeChatPay'))
+    <button class="btn btn-round btn-outline-default mt-2" onclick="pay('{{ sysConfig('is_WeChatPay') }}','3')">
+        <img src="/assets/images/payment/wechatpay.svg" alt="{{ trans('common.payment.wechat') }}" height="36px" />
     </button>
 @endif
-@if(sysConfig('is_otherPay'))
-    @if(str_contains(sysConfig('is_otherPay'), 'bitpayx'))
+@if (sysConfig('is_otherPay'))
+    @if (str_contains(sysConfig('is_otherPay'), 'bitpayx'))
         <button class="btn btn-round btn-outline-default mt-2" onclick="pay('bitpayx','4')">
-            <img src="/assets/images/payment/btc.svg" height="36px" alt="{{ trans('common.payment.crypto') }}"/>
+            <img src="/assets/images/payment/btc.svg" alt="{{ trans('common.payment.crypto') }}" height="36px" />
             <span class="font-size-24 black"> {{ trans('common.payment.crypto') }} </span>
         </button>
     @endif
-    @if(str_contains(sysConfig('is_otherPay'), 'paypal'))
+    @if (str_contains(sysConfig('is_otherPay'), 'paypal'))
         <button class="btn btn-round btn-outline-default mt-2" onclick="pay('paypal','5')">
-            <img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-150px.png" height="32px" alt="PayPal"/>
+            <img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-150px.png" alt="PayPal" loading="lazy" height="32px" />
         </button>
     @endif
-    @if(str_contains(sysConfig('is_otherPay'), 'stripe'))
+    @if (str_contains(sysConfig('is_otherPay'), 'stripe'))
         <button class="btn btn-round btn-outline-default mt-2" onclick="pay('stripe','6')">
-            <img src="/assets/images/payment/stripe.svg" height="40px" alt="Stripe"/>
+            <img src="/assets/images/payment/stripe.svg" alt="Stripe" height="40px" />
         </button>
     @endif
 @endif
-@if(sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
+@if (sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
     <button class="btn btn-round btn-outline-default mt-2" onclick="pay('manual','7')">
-        <img src="/assets/images/payment/pay.svg" height="40px" alt="{{ trans('common.payment.manual') }}"/>
-        <span class="font-size-18 font-weight-bold"> {{ trans('common.payment.manual' )}} </span>
+        <img src="/assets/images/payment/pay.svg" alt="{{ trans('common.payment.manual') }}" height="40px" />
+        <span class="font-size-18 font-weight-bold"> {{ trans('common.payment.manual') }} </span>
     </button>
 @endif

+ 71 - 61
resources/views/user/invite.blade.php

@@ -5,21 +5,22 @@
 @section('content')
     <div class="page-header">
         <h1 class="page-title cyan-600">
-            <i class="icon wb-extension"></i>{{trans('user.menu.invites')}}
+            <i class="icon wb-extension"></i>{{ trans('user.menu.invites') }}
         </h1>
     </div>
     <div class="page-content container-fluid">
-        <x-alert type="info" :message="trans('user.invite.promotion', ['traffic' => $referral_traffic, 'referral_percent' => $referral_percent * 100])"/>
+        <x-alert type="info" :message="trans('user.invite.promotion', ['traffic' => $referral_traffic, 'referral_percent' => $referral_percent * 100])" />
         <div class="row">
             <div class="col-xxl-3 col-lg-4">
                 <div class="card">
                     <div class="card-block">
                         <h4 class="card-title cyan-600">
-                            <i class="icon wb-plus"></i> {{trans('common.generate_item', ['attribute' => trans('user.invite.attribute')])}}
+                            <i class="icon wb-plus"></i> {{ trans('common.generate_item', ['attribute' => trans('user.invite.attribute')]) }}
                         </h4>
-                        <x-alert type="info" :message="trans('user.invite.tips', ['num' => $num, 'days' => sysConfig('user_invite_days')])"/>
-                        <button type="button" class="btn btn-primary btn-animate btn-animate-side" onclick="makeInvite()" @if(!$num) disabled @endif>
-                            <i class="icon wb-plus"></i> {{trans('common.generate')}}
+                        <x-alert type="info" :message="trans('user.invite.tips', ['num' => $num, 'days' => sysConfig('user_invite_days')])" />
+                        <button class="btn btn-primary btn-animate btn-animate-side" type="button" onclick="makeInvite()"
+                                @if (!$num) disabled @endif>
+                            <i class="icon wb-plus"></i> {{ trans('common.generate') }}
                         </button>
                     </div>
                 </div>
@@ -28,33 +29,34 @@
                 <div class="card">
                     <div class="card-block">
                         <h4 class="card-title cyan-600">
-                            <i class="icon wb-extension"></i>{{trans('user.invite.attribute')}}
+                            <i class="icon wb-extension"></i>{{ trans('user.invite.attribute') }}
                         </h4>
                         <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                             <thead class="thead-default">
-                            <tr>
-                                <th data-cell-style="cellStyle"> #</th>
-                                <th> {{ trans('user.invite.attribute') }} </th>
-                                <th> {{ trans('common.available_date') }} </th>
-                                <th> {{ trans('common.status.attribute') }} </th>
-                                <th> {{ trans('user.invitee') }} </th>
-                            </tr>
-                            </thead>
-                            <tbody>
-                            @foreach($inviteList as $invite)
                                 <tr>
-                                    <td> {{$loop->iteration}} </td>
-                                    <td>
-                                        <a href="javascript:void(0)" class="mt-clipboard" data-clipboard-action="copy"
-                                           data-clipboard-text="{{route('register', ['code' => $invite->code])}}">{{$invite->code}}</a>
-                                    </td>
-                                    <td> {{$invite->dateline}} </td>
-                                    <td>
-                                        {!! $invite->status_label !!}
-                                    </td>
-                                    {{$invite->status === 1 ? ($invite->invitee->username ?? '【'.trans('common.deleted_item', ['attribute' => trans('common.account')]).'】') : ''}}
+                                    <th data-cell-style="cellStyle"> #</th>
+                                    <th> {{ trans('user.invite.attribute') }} </th>
+                                    <th> {{ trans('common.available_date') }} </th>
+                                    <th> {{ trans('common.status.attribute') }} </th>
+                                    <th> {{ trans('user.invitee') }} </th>
                                 </tr>
-                            @endforeach
+                            </thead>
+                            <tbody>
+                                @foreach ($inviteList as $invite)
+                                    <tr>
+                                        <td> {{ $loop->iteration }} </td>
+                                        <td>
+                                            <a class="mt-clipboard" data-clipboard-action="copy"
+                                               data-clipboard-text="{{ route('register', ['code' => $invite->code]) }}"
+                                               href="javascript:void(0)">{{ $invite->code }}</a>
+                                        </td>
+                                        <td> {{ $invite->dateline }} </td>
+                                        <td>
+                                            {!! $invite->status_label !!}
+                                        </td>
+                                        {{ $invite->status === 1 ? $invite->invitee->username ?? '【' . trans('common.deleted_item', ['attribute' => trans('common.account')]) . '】' : '' }}
+                                    </tr>
+                                @endforeach
                             </tbody>
                         </table>
                     </div>
@@ -65,7 +67,7 @@
                             </div>
                             <div class="col-md-8">
                                 <nav class="Page navigation float-right">
-                                    {{$inviteList->links()}}
+                                    {{ $inviteList->links() }}
                                 </nav>
                             </div>
                         </div>
@@ -80,40 +82,48 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      // 生成邀请码
-      function makeInvite() {
-        $.ajax({
-          method: 'POST',
-          dataType: 'json',
-          url: '{{route('createInvite')}}',
-          data: {_token: '{{csrf_token()}}'},
-          success: function(ret) {
-            if (ret.status === 'success') {
-              swal.fire({title: ret.message, icon: 'success'}).then(() => window.location.reload());
-            } else {
-              swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-            }
-          },
-        });
-        return false;
-      }
+        // 生成邀请码
+        function makeInvite() {
+            $.ajax({
+                method: 'POST',
+                dataType: 'json',
+                url: '{{ route('createInvite') }}',
+                data: {
+                    _token: '{{ csrf_token() }}'
+                },
+                success: function(ret) {
+                    if (ret.status === 'success') {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'success'
+                        }).then(() => window.location.reload());
+                    } else {
+                        swal.fire({
+                            title: ret.message,
+                            icon: 'error'
+                        }).then(() => window.location.reload());
+                    }
+                },
+            });
+            return false;
+        }
 
-      const clipboard = new ClipboardJS('.mt-clipboard');
-      clipboard.on('success', function() {
-        swal.fire({
-          title: '{{ trans('common.copy.success') }}',
-          icon: 'success',
-          timer: 1300,
-          showConfirmButton: false,
+        const clipboard = new ClipboardJS('.mt-clipboard');
+        clipboard.on('success', function() {
+            swal.fire({
+                title: '{{ trans('common.copy.success') }}',
+                icon: 'success',
+                timer: 1300,
+                showConfirmButton: false,
+            });
         });
-      });
-      clipboard.on('error', function() {
-        swal.fire({
-          title: '{{ trans('common.copy.failed') }}',
-          icon: 'error',
-          timer: 1500,
-          showConfirmButton: false,
+        clipboard.on('error', function() {
+            swal.fire({
+                title: '{{ trans('common.copy.failed') }}',
+                icon: 'error',
+                timer: 1500,
+                showConfirmButton: false,
+            });
         });
-      });
     </script>
 @endsection

+ 47 - 46
resources/views/user/invoiceDetail.blade.php

@@ -9,71 +9,72 @@
                 <div class="row">
                     <div class="col-lg-3">
                         <h3>
-                            <img src="{{sysConfig('website_logo')? asset(sysConfig('website_logo')) :'/assets/images/logo.png'}}" class="navbar-brand-logo" alt="logo">
-                            {{sysConfig('website_name')}}
+                            <img class="navbar-brand-logo" src="{{ sysConfig('website_logo') ? asset(sysConfig('website_logo')) : '/assets/images/logo.png' }}"
+                                 alt="logo" />
+                            {{ sysConfig('website_name') }}
                         </h3>
                     </div>
                     <div class="col-lg-3 offset-lg-6 text-right">
-                        <h4>{{trans('user.invoice.detail')}}</h4>
+                        <h4>{{ trans('user.invoice.detail') }}</h4>
                         <p>{{ trans('model.order.id') }}
-                            :<a class="font-size-20" href="javascript:void(0)">{{$order->sn}}</a>
+                            :<a class="font-size-20" href="javascript:void(0)">{{ $order->sn }}</a>
                         </p>
-                        <p>{{trans('user.payment_method')}}
-                            : {{$order->pay_way === 1 ? trans('user.shop.pay_credit') : trans('user.shop.pay_online')}}</p>
-                        <p>{{trans('user.bought_at')}}: {{$order->created_at}}</p>
-                        @if($order->expired_at)
-                            <p>{{trans('common.expired_at')}}: {{$order->expired_at}}</p>
+                        <p>{{ trans('user.payment_method') }}
+                            : {{ $order->pay_way === 1 ? trans('user.shop.pay_credit') : trans('user.shop.pay_online') }}</p>
+                        <p>{{ trans('user.bought_at') }}: {{ $order->created_at }}</p>
+                        @if ($order->expired_at)
+                            <p>{{ trans('common.expired_at') }}: {{ $order->expired_at }}</p>
                         @endif
                     </div>
                 </div>
                 <div class="page-invoice-table table-responsive">
                     <table class="table table-hover text-md-center">
                         <thead class="thead-info">
-                        <tr>
-                            <th>{{trans('user.shop.service')}}</th>
-                            <th>{{trans('user.shop.description')}} </th>
-                            <th>{{trans('user.shop.price')}}</th>
-                            <th>{{trans('user.shop.quantity')}}</th>
-                            <th>{{trans('model.coupon.attribute')}}</th>
-                            <th>{{trans('user.shop.total')}}</th>
-                            <th>{{trans('common.status.attribute')}}</th>
-                        </tr>
+                            <tr>
+                                <th>{{ trans('user.shop.service') }}</th>
+                                <th>{{ trans('user.shop.description') }} </th>
+                                <th>{{ trans('user.shop.price') }}</th>
+                                <th>{{ trans('user.shop.quantity') }}</th>
+                                <th>{{ trans('model.coupon.attribute') }}</th>
+                                <th>{{ trans('user.shop.total') }}</th>
+                                <th>{{ trans('common.status.attribute') }}</th>
+                            </tr>
                         </thead>
                         <tbody>
-                        <tr>
-                            <td>
-                                <h3>{{$order->goods->name ?? trans('user.recharge_credit')}}</h3>
-                            </td>
-                            <td>
-                                @if($order->goods)
-                                    {{trans('common.available_date')}}
-                                    <code>{{$order->goods->days}}</code> {{trans_choice('common.days.attribute', 1)}}
-                                    <br/>
-                                    @if($order->goods->type === 2)
-                                        <code>{{$order->goods->traffic_label}}</code>
-                                        {{trans('user.attribute.data')}}/{{trans('validation.attributes.month')}}
+                            <tr>
+                                <td>
+                                    <h3>{{ $order->goods->name ?? trans('user.recharge_credit') }}</h3>
+                                </td>
+                                <td>
+                                    @if ($order->goods)
+                                        {{ trans('common.available_date') }}
+                                        <code>{{ $order->goods->days }}</code> {{ trans_choice('common.days.attribute', 1) }}
+                                        <br />
+                                        @if ($order->goods->type === 2)
+                                            <code>{{ $order->goods->traffic_label }}</code>
+                                            {{ trans('user.attribute.data') }}/{{ trans('validation.attributes.month') }}
+                                        @else
+                                            <code>{{ $order->goods->traffic_label }}</code>
+                                            {{ trans('user.attribute.data') }}/
+                                            <code>{{ $order->goods->days }}</code>
+                                            {{ trans_choice('common.days.attribute', 1) }}
+                                        @endif
                                     @else
-                                        <code>{{$order->goods->traffic_label}}</code>
-                                        {{trans('user.attribute.data')}}/
-                                        <code>{{$order->goods->days}}</code>
-                                        {{trans_choice('common.days.attribute', 1)}}
+                                        {{ trans('user.recharge_credit') }}
                                     @endif
-                                @else
-                                    {{trans('user.recharge_credit')}}
-                                @endif
-                            </td>
-                            <td> {{$order->origin_amount_tag}} </td>
-                            <td> 1</td>
-                            <td>{{$order->coupon->name ?? trans('common.none')}}</td>
-                            <td> {{$order->amount_tag}} </td>
-                            <td> {!! $order->status_label !!} </td>
-                        </tr>
+                                </td>
+                                <td> {{ $order->origin_amount_tag }} </td>
+                                <td> 1</td>
+                                <td>{{ $order->coupon->name ?? trans('common.none') }}</td>
+                                <td> {{ $order->amount_tag }} </td>
+                                <td> {!! $order->status_label !!} </td>
+                            </tr>
                         </tbody>
                     </table>
                 </div>
                 <div class="text-right">
-                    <button type="button" class="btn btn-animate btn-animate-side btn-outline-info" onclick="window.print();">
-                        <span><i class="icon wb-print" aria-hidden="true"></i> {{trans('common.print')}} </span>
+                    <button class="btn btn-animate btn-animate-side btn-outline-info" type="button" onclick="window.print();">
+                        <span><i class="icon wb-print" aria-hidden="true"></i> {{ trans('common.print') }} </span>
                     </button>
                 </div>
             </div>

+ 112 - 99
resources/views/user/invoices.blade.php

@@ -6,58 +6,61 @@
     <div class="page-content container">
         <div class="panel">
             <div class="panel-heading p-20">
-                <h1 class="panel-title cyan-600"><i class="icon wb-bookmark"></i>{{trans('user.menu.invoices')}}</h1>
-                @if($prepaidPlan)
+                <h1 class="panel-title cyan-600"><i class="icon wb-bookmark"></i>{{ trans('user.menu.invoices') }}</h1>
+                @if ($prepaidPlan)
                     <div class="panel-actions">
-                        <button onclick="closePlan()" class="btn btn-primary"> {{trans('common.active_item', ['attribute' => trans('common.order.status.prepaid')])}}</button>
+                        <button class="btn btn-primary" onclick="closePlan()">
+                            {{ trans('common.active_item', ['attribute' => trans('common.order.status.prepaid')]) }}</button>
                     </div>
                 @endif
             </div>
             <div class="panel-body">
                 <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
                     <thead class="thead-default">
-                    <tr>
-                        <th> #</th>
-                        <th> {{trans('model.order.id')}} </th>
-                        <th> {{trans('user.shop.service')}} </th>
-                        <th> {{trans('user.payment_method')}} </th>
-                        <th> {{trans('user.invoice.amount')}} </th>
-                        <th> {{trans('user.bought_at')}} </th>
-                        <th> {{trans('common.expired_at')}} </th>
-                        <th> {{trans('common.status.attribute')}} </th>
-                        <th> {{trans('common.action')}} </th>
-                    </tr>
+                        <tr>
+                            <th> #</th>
+                            <th> {{ trans('model.order.id') }} </th>
+                            <th> {{ trans('user.shop.service') }} </th>
+                            <th> {{ trans('user.payment_method') }} </th>
+                            <th> {{ trans('user.invoice.amount') }} </th>
+                            <th> {{ trans('user.bought_at') }} </th>
+                            <th> {{ trans('common.expired_at') }} </th>
+                            <th> {{ trans('common.status.attribute') }} </th>
+                            <th> {{ trans('common.action') }} </th>
+                        </tr>
                     </thead>
                     <tbody>
-                    @foreach($orderList as $order)
-                        <tr>
-                            <td>{{$loop->iteration}}</td>
-                            <td><a href="/invoice/{{$order->sn}}" target="_blank">{{$order->sn}}</a></td>
-                            <td>{{$order->goods->name ?? trans('user.recharge_credit')}}</td>
-                            <td>{{$order->pay_way === 1 ? trans('user.shop.pay_credit') : trans('user.shop.pay_online')}}</td>
-                            <td>{{$order->amount_tag}}</td>
-                            <td>{{$order->created_at}}</td>
-                            <td>{{empty($order->goods) || $order->goods_id === null || $order->status === 3 ? '' : $order->expired_at}}</td>
-                            <td>{!! $order->status_label !!}</td>
-                            <td>
-                                <div class="btn-group">
-                                    @if($order->status === 0 && $order->pay_way !== 1)
-                                        @if ($order->payment)
-                                            @if($order->payment->qr_code)
-                                                <a href="{{route('orderDetail', $order->payment->trade_no)}}" target="_blank" class="btn btn-primary">{{trans('user.pay')}}</a>
-                                            @elseif($order->payment->url)
-                                                <a href="{{$order->payment->url}}" target="_blank" class="btn btn-primary">{{trans('user.pay')}}</a>
+                        @foreach ($orderList as $order)
+                            <tr>
+                                <td>{{ $loop->iteration }}</td>
+                                <td><a href="/invoice/{{ $order->sn }}" target="_blank">{{ $order->sn }}</a></td>
+                                <td>{{ $order->goods->name ?? trans('user.recharge_credit') }}</td>
+                                <td>{{ $order->pay_way === 1 ? trans('user.shop.pay_credit') : trans('user.shop.pay_online') }}</td>
+                                <td>{{ $order->amount_tag }}</td>
+                                <td>{{ $order->created_at }}</td>
+                                <td>{{ empty($order->goods) || $order->goods_id === null || $order->status === 3 ? '' : $order->expired_at }}</td>
+                                <td>{!! $order->status_label !!}</td>
+                                <td>
+                                    <div class="btn-group">
+                                        @if ($order->status === 0 && $order->pay_way !== 1)
+                                            @if ($order->payment)
+                                                @if ($order->payment->qr_code)
+                                                    <a class="btn btn-primary" href="{{ route('orderDetail', $order->payment->trade_no) }}"
+                                                       target="_blank">{{ trans('user.pay') }}</a>
+                                                @elseif($order->payment->url)
+                                                    <a class="btn btn-primary" href="{{ $order->payment->url }}" target="_blank">{{ trans('user.pay') }}</a>
+                                                @endif
                                             @endif
+                                            <button class="btn btn-danger"
+                                                    onclick="closeOrder('{{ route('closeOrder', $order) }}')">{{ trans('common.cancel') }}</button>
+                                        @elseif ($order->status === 1)
+                                            <button class="btn btn-primary" onClick="window.location.reload();">
+                                                <i class="icon wb-refresh" aria-hidden="true"></i></button>
                                         @endif
-                                        <button onclick="closeOrder('{{route('closeOrder', $order)}}')" class="btn btn-danger">{{trans('common.cancel')}}</button>
-                                    @elseif ($order->status === 1)
-                                        <button onClick="window.location.reload();" class="btn btn-primary">
-                                            <i class="icon wb-refresh" aria-hidden="true"></i></button>
-                                    @endif
-                                </div>
-                            </td>
-                        </tr>
-                    @endforeach
+                                    </div>
+                                </td>
+                            </tr>
+                        @endforeach
                     </tbody>
                 </table>
             </div>
@@ -65,7 +68,7 @@
                 <div class="row">
                     <div class="col-12">
                         <nav class="Page navigation float-right">
-                            {{$orderList->links()}}
+                            {{ $orderList->links() }}
                         </nav>
                     </div>
                 </div>
@@ -77,67 +80,77 @@
     <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
     <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
     <script>
-      function closePlan() {
-        swal.fire({
-          title: '{{trans('user.invoice.active_prepaid_question')}}',
-          html: @json(trans('user.invoice.active_prepaid_tips')),
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('cancelPlan')}}',
-              dataType: 'json',
-              data: {_token: '{{csrf_token()}}'},
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'});
+        function closePlan() {
+            swal.fire({
+                title: '{{ trans('user.invoice.active_prepaid_question') }}',
+                html: @json(trans('user.invoice.active_prepaid_tips')),
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{ route('cancelPlan') }}',
+                        dataType: 'json',
+                        data: {
+                            _token: '{{ csrf_token() }}'
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                });
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
+        }
 
-      function closeOrder(url) {
-        swal.fire({
-          title: '{{trans('common.close_item', ['attribute' => trans('user.invoice.attribute')])}}?',
-          icon: 'warning',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'PUT',
-              url: url,
-              dataType: 'json',
-              data: {_token: '{{csrf_token()}}'},
-              success: function(ret) {
-                if (ret.status === 'success') {
-                  swal.fire({
-                    title: ret.message,
-                    icon: 'success',
-                    timer: 1000,
-                    showConfirmButton: false,
-                  }).then(() => window.location.reload());
-                } else {
-                  swal.fire({title: ret.message, icon: 'error'});
+        function closeOrder(url) {
+            swal.fire({
+                title: '{{ trans('common.close_item', ['attribute' => trans('user.invoice.attribute')]) }}?',
+                icon: 'warning',
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'PUT',
+                        url: url,
+                        dataType: 'json',
+                        data: {
+                            _token: '{{ csrf_token() }}'
+                        },
+                        success: function(ret) {
+                            if (ret.status === 'success') {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'success',
+                                    timer: 1000,
+                                    showConfirmButton: false,
+                                }).then(() => window.location.reload());
+                            } else {
+                                swal.fire({
+                                    title: ret.message,
+                                    icon: 'error'
+                                });
+                            }
+                        },
+                    });
                 }
-              },
             });
-          }
-        });
-      }
+        }
     </script>
 @endsection

+ 95 - 82
resources/views/user/replyTicket.blade.php

@@ -3,30 +3,34 @@
     <div class="page-content">
         <div class="panel panel-bordered">
             <div class="panel-heading">
-                <h1 class="panel-title cyan-600"><i class="icon wb-help-circle"></i> {{$ticket->title}} </h1>
-                @if($ticket->status !== 2)
+                <h1 class="panel-title cyan-600"><i class="icon wb-help-circle"></i> {{ $ticket->title }} </h1>
+                @if ($ticket->status !== 2)
                     <div class="panel-actions">
-                        <button class="btn btn-danger" onclick="closeTicket()"> {{trans('common.close')}} </button>
+                        <button class="btn btn-danger" onclick="closeTicket()"> {{ trans('common.close') }} </button>
                     </div>
                 @endif
             </div>
             <div class="panel-body">
                 <div class="chat-box">
                     <div class="chats">
-                        <x-chat-unit :user="Auth::getUser()" :ticket="$ticket"/>
+                        @php
+                            $currentUser = Auth::user();
+                        @endphp
+                        <x-chat-unit :user="$currentUser" :ticket="$ticket" />
                         @foreach ($replyList as $reply)
-                            <x-chat-unit :user="Auth::getUser()" :ticket="$reply"/>
+                            <x-chat-unit :user="$currentUser" :ticket="$reply" />
                         @endforeach
                     </div>
                 </div>
             </div>
+
             <div class="panel-footer pb-30">
                 <form>
                     <div class="input-group">
-                        <input type="text" class="form-control" id="editor" placeholder="{{trans('user.ticket.reply_placeholder')}}"/>
+                        <input class="form-control" id="editor" type="text" placeholder="{{ trans('user.ticket.reply_placeholder') }}" />
                         <span class="input-group-btn">
-                                <button type="button" class="btn btn-primary" onclick="replyTicket()"> {{trans('common.send')}}</button>
-                            </span>
+                            <button class="btn btn-primary" type="button" onclick="replyTicket()"> {{ trans('common.send') }}</button>
+                        </span>
                     </div>
                 </form>
             </div>
@@ -35,85 +39,94 @@
 @endsection
 @section('javascript')
     <script>
-      //回车检测
-      $(document).on('keypress', 'input', function(e) {
-        if (e.which === 13) {
-          replyTicket();
-          return false;
-        }
-      });
+        //回车检测
+        $(document).on('keypress', 'input', function(e) {
+            if (e.which === 13) {
+                replyTicket();
+                return false;
+            }
+        });
 
-      // 关闭工单
-      function closeTicket() {
-        swal.fire({
-          title: '{{trans('user.ticket.close')}}',
-          text: '{{trans('user.ticket.close_tips')}}',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.ajax({
-              method: 'POST',
-              url: '{{route('closeTicket')}}',
-              async: true,
-              data: {_token: '{{csrf_token()}}', id: '{{$ticket->id}}'},
-              dataType: 'json',
-              success: function(ret) {
-                swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1300,
-                }).then(() => window.location.href = '{{route('ticket')}}');
-              },
-              error: function() {
-                swal.fire({title: '{{trans('user.ticket.error')}}', icon: 'error'});
-              },
+        // 关闭工单
+        function closeTicket() {
+            swal.fire({
+                title: '{{ trans('user.ticket.close') }}',
+                text: '{{ trans('user.ticket.close_tips') }}',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.ajax({
+                        method: 'POST',
+                        url: '{{ route('closeTicket') }}',
+                        async: true,
+                        data: {
+                            _token: '{{ csrf_token() }}',
+                            id: '{{ $ticket->id }}'
+                        },
+                        dataType: 'json',
+                        success: function(ret) {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1300,
+                            }).then(() => window.location.href = '{{ route('ticket') }}');
+                        },
+                        error: function() {
+                            swal.fire({
+                                title: '{{ trans('user.ticket.error') }}',
+                                icon: 'error'
+                            });
+                        },
+                    });
+                }
             });
-          }
-        });
-      }
+        }
 
-      // 回复工单
-      function replyTicket() {
-        const content = document.getElementById('editor').value;
+        // 回复工单
+        function replyTicket() {
+            const content = document.getElementById('editor').value;
 
-        if (content.trim() === '') {
-          swal.fire({
-            title: '{{trans('validation.required', ['attribute' => trans('validation.attributes.content')])}}!',
-            icon: 'warning',
-            timer: 1500,
-          });
-          return false;
-        }
-        swal.fire({
-          title: '{{trans('user.ticket.reply_confirm')}}',
-          icon: 'question',
-          allowEnterKey: false,
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('replyTicket')}}', {
-              _token: '{{csrf_token()}}',
-              id: '{{$ticket->id}}',
-              content: content,
-            }, function(ret) {
-              if (ret.status === 'success') {
+            if (content.trim() === '') {
                 swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
-              }
+                    title: '{{ trans('validation.required', ['attribute' => trans('validation.attributes.content')]) }}!',
+                    icon: 'warning',
+                    timer: 1500,
+                });
+                return false;
+            }
+            swal.fire({
+                title: '{{ trans('user.ticket.reply_confirm') }}',
+                icon: 'question',
+                allowEnterKey: false,
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{ route('replyTicket') }}', {
+                        _token: '{{ csrf_token() }}',
+                        id: '{{ $ticket->id }}',
+                        content: content,
+                    }, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'error'
+                            }).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-          }
-        });
-      }
+        }
     </script>
 @endsection

+ 173 - 163
resources/views/user/services.blade.php

@@ -1,6 +1,6 @@
 @extends('user.layouts')
 @section('css')
-    <link rel="stylesheet" href="assets/global/vendor/ionrangeslider/ionrangeslider.min.css">
+    <link href="assets/global/vendor/ionrangeslider/ionrangeslider.min.css" rel="stylesheet">
 @endsection
 @section('content')
     <div class="page-content">
@@ -8,28 +8,28 @@
             <div class="col-xxl-2 col-lg-3">
                 <div class="card card-shadow">
                     <div class="card-block p-20">
-                        <button type="button" class="btn btn-floating btn-sm btn-pure">
+                        <button class="btn btn-floating btn-sm btn-pure" type="button">
                             <i class="icon wb-payment green-500"></i>
                         </button>
-                        <span class="font-weight-400">{{trans('user.account.credit')}}</span>
+                        <span class="font-weight-400">{{ trans('user.account.credit') }}</span>
                         <div class="content-text text-center mb-0">
-                            <span class="font-size-40 font-weight-100">{{Auth::getUser()->credit_tag}}</span>
-                            <br/>
-                            <button class="btn btn-danger float-right mr-15" data-toggle="modal" data-target="#charge_modal">{{trans('user.recharge')}}</button>
+                            <span class="font-size-40 font-weight-100">{{ Auth::getUser()->credit_tag }}</span>
+                            <br />
+                            <button class="btn btn-danger float-right mr-15" data-toggle="modal" data-target="#charge_modal">{{ trans('user.recharge') }}</button>
                         </div>
                     </div>
                 </div>
-                @if($renewTraffic)
+                @if ($renewTraffic)
                     <div class="card card-shadow">
                         <div class="card-block p-20">
-                            <button type="button" class="btn btn-floating btn-sm btn-pure">
+                            <button class="btn btn-floating btn-sm btn-pure" type="button">
                                 <i class="icon wb-payment green-500"></i>
                             </button>
-                            <span class="font-weight-400">{{trans('user.reset_data.action')}}</span>
+                            <span class="font-weight-400">{{ trans('user.reset_data.action') }}</span>
                             <div class="content-text text-center mb-0">
                                 <span class="font-size-20 font-weight-100">{!! trans('user.reset_data.cost', ['amount' => $renewTraffic]) !!}</span>
-                                <br/>
-                                <button class="btn btn-danger mt-10" onclick="resetTraffic()">{{trans('common.reset')}}</button>
+                                <br />
+                                <button class="btn btn-danger mt-10" onclick="resetTraffic()">{{ trans('common.reset') }}</button>
                             </div>
                         </div>
                     </div>
@@ -39,53 +39,53 @@
                 <div class="panel">
                     <div class="panel-heading p-20">
                         <h1 class="panel-title cyan-700">
-                            <i class="icon wb-shopping-cart"></i>{{trans('user.menu.shop')}}
+                            <i class="icon wb-shopping-cart"></i>{{ trans('user.menu.shop') }}
                         </h1>
                     </div>
                     <div class="panel-body">
                         <div class="row">
-                            @foreach($goodsList as $goods)
+                            @foreach ($goodsList as $goods)
                                 <div class="col-md-6 col-xl-4 col-xxl-3">
                                     <div class="position-relative">
-                                        @if($goods->limit_num)
+                                        @if ($goods->limit_num)
                                             <div class="ribbon ribbon-badge ribbon-danger ribbon-reverse">
-                                                <span class="ribbon-inner">{{trans('user.shop.limited')}}</span>
+                                                <span class="ribbon-inner">{{ trans('user.shop.limited') }}</span>
                                             </div>
                                         @elseif($goods->is_hot)
                                             <div class="ribbon ribbon-badge ribbon-danger ribbon-reverse">
-                                                <span class="ribbon-inner">{{trans('user.shop.hot')}}</span>
+                                                <span class="ribbon-inner">{{ trans('user.shop.hot') }}</span>
                                             </div>
                                         @endif
                                     </div>
                                     <div class="pricing-list text-left">
-                                        <div class="pricing-header text-white" style="background-color: {{$goods->color}}">
-                                            <div class="pricing-title font-size-20">{{$goods->name}}</div>
-                                            <div class="pricing-price text-white @if($goods->type === 1) text-center @endif">
-                                                <span class="pricing-amount">{{$goods->price_tag}}</span>
-                                                @if($goods->type === 2)
-                                                    <span class="pricing-period">/ {{$goods->days.trans_choice('common.days.attribute', 1)}}</span>
+                                        <div class="pricing-header text-white" style="background-color: {{ $goods->color }}">
+                                            <div class="pricing-title font-size-20">{{ $goods->name }}</div>
+                                            <div class="pricing-price text-white @if ($goods->type === 1) text-center @endif">
+                                                <span class="pricing-amount">{{ $goods->price_tag }}</span>
+                                                @if ($goods->type === 2)
+                                                    <span class="pricing-period">/ {{ $goods->days . trans_choice('common.days.attribute', 1) }}</span>
                                                 @endif
                                             </div>
-                                            @if($goods->description)
-                                                <p class="px-30 pb-25 text-center">{{$goods->description}}</p>
+                                            @if ($goods->description)
+                                                <p class="px-30 pb-25 text-center">{{ $goods->description }}</p>
                                             @endif
                                         </div>
                                         <ul class="pricing-features">
                                             <li>
-                                                <strong>{{$goods->traffic_label}}</strong>{{trans('user.attribute.data')}}
-                                                {!!$goods->type === 1? ' <code>'.$dataPlusDays.'</code> '.trans_choice('common.days.attribute', 1):'/'.trans('validation.attributes.month')!!}
+                                                <strong>{{ $goods->traffic_label }}</strong>{{ trans('user.attribute.data') }}
+                                                {!! $goods->type === 1 ? ' <code>' . $dataPlusDays . '</code> ' . trans_choice('common.days.attribute', 1) : '/' . trans('validation.attributes.month') !!}
                                             </li>
                                             <li>
-                                                {!!trans('user.service.node_count', ['num' => $goods->node_count])!!}
+                                                {!! trans('user.service.node_count', ['num' => $goods->node_count]) !!}
                                             </li>
                                             <li>
-                                                {{trans('user.account.speed_limit')}}
-                                                <strong> {{ $goods->speed_limit ? $goods->speed_limit.' Mbps' : trans('user.service.unlimited') }} </strong>
+                                                {{ trans('user.account.speed_limit') }}
+                                                <strong> {{ $goods->speed_limit ? $goods->speed_limit . ' Mbps' : trans('user.service.unlimited') }} </strong>
                                             </li>
-                                            {!!$goods->info!!}
+                                            {!! $goods->info !!}
                                         </ul>
                                         <div class="pricing-footer text-center bg-blue-grey-100">
-                                            <a href="{{route('buy', $goods)}}" class="btn btn-lg btn-primary"> {{trans('user.shop.buy')}}</a>
+                                            <a class="btn btn-lg btn-primary" href="{{ route('buy', $goods) }}"> {{ trans('user.shop.buy') }}</a>
                                         </div>
                                     </div>
                                 </div>
@@ -96,42 +96,42 @@
             </div>
         </div>
     </div>
-    <div id="charge_modal" class="modal fade" aria-labelledby="charge_modal" role="dialog" tabindex="-1"
-         aria-hidden="true">
+    <div class="modal fade" id="charge_modal" role="dialog" aria-labelledby="charge_modal" aria-hidden="true" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
             <div class="modal-content">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span></button>
-                    <h4 class="modal-title">{{trans('user.recharge_credit')}}</h4>
+                    <h4 class="modal-title">{{ trans('user.recharge_credit') }}</h4>
                 </div>
                 <div class="modal-body">
                     <div class="alert alert-danger" id="charge_msg" style="display: none;"></div>
                     <form action="#" method="post">
-                        @if(sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
+                        @if (sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
                             <div class="mb-15 w-p50">
-                                <select class="form-control" name="charge_type" id="charge_type">
-                                    @if(sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
-                                        <option value="1">{{trans('user.shop.pay_online')}}</option>
+                                <select class="form-control" id="charge_type" name="charge_type">
+                                    @if (sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
+                                        <option value="1">{{ trans('user.shop.pay_online') }}</option>
                                     @endif
-                                    <option value="2">{{trans('admin.coupon.type.charge')}}</option>
+                                    <option value="2">{{ trans('admin.coupon.type.charge') }}</option>
                                 </select>
                             </div>
                         @endif
-                        @if(sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
+                        @if (sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
                             <div class="form-group row charge_credit">
-                                <label for="amount" class="offset-md-1 col-md-2 col-form-label">{{trans('user.shop.change_amount')}}</label>
+                                <label class="offset-md-1 col-md-2 col-form-label" for="amount">{{ trans('user.shop.change_amount') }}</label>
                                 <div class="col-md-8">
-                                    <input type="text" name="amount" id="amount" data-plugin="ionRangeSlider" data-min=1 data-max=300 data-from=40 data-prefix="{{array_column
-                                    (config('common.currency'), 'symbol', 'code')[session('currency') ?? sysConfig('standard_currency')]}}"/>
+                                    <input id="amount" name="amount" data-plugin="ionRangeSlider" data-min=1 data-max=300 data-from=40
+                                           data-prefix="{{ array_column(config('common.currency'), 'symbol', 'code')[session('currency') ?? sysConfig('standard_currency')] }}"
+                                           type="text" />
                                 </div>
                             </div>
                         @endif
                         <div class="form-group row" id="charge_coupon_code">
-                            <label for="charge_coupon"
-                                   class="offset-md-2 col-md-2 col-form-label"> {{trans('admin.coupon.type.charge')}} </label>
+                            <label class="offset-md-2 col-md-2 col-form-label" for="charge_coupon"> {{ trans('admin.coupon.type.charge') }} </label>
                             <div class="col-md-6">
-                                <input type="text" class="form-control round" name="charge_coupon" id="charge_coupon" placeholder="{{trans('user.input_coupon')}}">
+                                <input class="form-control round" id="charge_coupon" name="charge_coupon" type="text"
+                                       placeholder="{{ trans('user.input_coupon') }}">
                             </div>
                         </div>
                     </form>
@@ -140,7 +140,7 @@
                     <div class="charge_credit">
                         @include('user.components.purchase')
                     </div>
-                    <button type="button" class="btn btn-primary" id="change_btn" onclick="pay()">{{trans('user.recharge')}}</button>
+                    <button class="btn btn-primary" id="change_btn" type="button" onclick="pay()">{{ trans('user.recharge') }}</button>
                 </div>
             </div>
         </div>
@@ -150,133 +150,143 @@
     <script src="assets/global/vendor/ionrangeslider/ion.rangeSlider.min.js"></script>
     <script src="assets/global/js/Plugin/ionrangeslider.js"></script>
     <script>
-      function itemControl(value) {
-        if (value === 1) {
-          $('.charge_credit').show();
-          $('#change_btn').hide();
-          $('#charge_coupon_code').hide();
-        } else {
-          $('.charge_credit').hide();
-          $('#charge_coupon_code').show();
-          $('#change_btn').show();
+        function itemControl(value) {
+            if (value === 1) {
+                $('.charge_credit').show();
+                $('#change_btn').hide();
+                $('#charge_coupon_code').hide();
+            } else {
+                $('.charge_credit').hide();
+                $('#charge_coupon_code').show();
+                $('#change_btn').show();
+            }
         }
-      }
 
-      $(document).ready(function() {
-        let which_selected = 2;
-          @if(sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
-              which_selected = 1;
-          @endif
+        $(document).ready(function() {
+            let which_selected = 2;
+            @if (sysConfig('is_onlinePay') || sysConfig('alipay_qrcode') || sysConfig('wechat_qrcode'))
+                which_selected = 1;
+            @endif
 
-          itemControl(which_selected);
-        $('charge_type').val(which_selected);
-      });
-
-      // 切换充值方式
-      $('#charge_type').change(function() {
-        itemControl(parseInt($(this).val()));
-      });
+            itemControl(which_selected);
+            $('charge_type').val(which_selected);
+        });
 
-      // 重置流量
-      function resetTraffic() {
-        swal.fire({
-          title: '{{trans('user.reset_data.action')}}',
-          text: '{{trans('user.reset_data.cost_tips', ['amount' => $renewTraffic])}}',
-          icon: 'question',
-          showCancelButton: true,
-          cancelButtonText: '{{trans('common.close')}}',
-          confirmButtonText: '{{trans('common.confirm')}}',
-        }).then((result) => {
-          if (result.value) {
-            $.post('{{route('resetTraffic')}}', {_token: '{{csrf_token()}}'}, function(ret) {
-              if (ret.status === 'success') {
-                swal.fire({
-                  title: ret.message,
-                  icon: 'success',
-                  timer: 1000,
-                  showConfirmButton: false,
-                }).then(() => window.location.reload());
-              } else {
-                swal.fire({
-                  title: ret.message,
-                  text: ret.data,
-                  icon: 'error',
-                }).then(() => window.location.reload());
-              }
-            });
-          }
+        // 切换充值方式
+        $('#charge_type').change(function() {
+            itemControl(parseInt($(this).val()));
         });
-      }
 
-      // 充值
-      function pay(method, pay_type) {
-        const paymentType = parseInt($('#charge_type').val() ?? 2);
-        const charge_coupon = $('#charge_coupon').val().trim();
-        const amount = parseInt($('#amount').val());
-        if (paymentType === 1) {
-          if (amount <= 0) {
+        // 重置流量
+        function resetTraffic() {
             swal.fire({
-              title: '{{trans('common.error')}}',
-              text: '{{trans('user.payment.error')}}',
-              icon: 'warning',
-              timer: 1000,
-              showConfirmButton: false,
+                title: '{{ trans('user.reset_data.action') }}',
+                text: '{{ trans('user.reset_data.cost_tips', ['amount' => $renewTraffic]) }}',
+                icon: 'question',
+                showCancelButton: true,
+                cancelButtonText: '{{ trans('common.close') }}',
+                confirmButtonText: '{{ trans('common.confirm') }}',
+            }).then((result) => {
+                if (result.value) {
+                    $.post('{{ route('resetTraffic') }}', {
+                        _token: '{{ csrf_token() }}'
+                    }, function(ret) {
+                        if (ret.status === 'success') {
+                            swal.fire({
+                                title: ret.message,
+                                icon: 'success',
+                                timer: 1000,
+                                showConfirmButton: false,
+                            }).then(() => window.location.reload());
+                        } else {
+                            swal.fire({
+                                title: ret.message,
+                                text: ret.data,
+                                icon: 'error',
+                            }).then(() => window.location.reload());
+                        }
+                    });
+                }
             });
-            return false;
-          }
+        }
+
+        // 充值
+        function pay(method, pay_type) {
+            const paymentType = parseInt($('#charge_type').val() ?? 2);
+            const charge_coupon = $('#charge_coupon').val().trim();
+            const amount = parseInt($('#amount').val());
+            if (paymentType === 1) {
+                if (amount <= 0) {
+                    swal.fire({
+                        title: '{{ trans('common.error') }}',
+                        text: '{{ trans('user.payment.error') }}',
+                        icon: 'warning',
+                        timer: 1000,
+                        showConfirmButton: false,
+                    });
+                    return false;
+                }
 
-          $.ajax({
-            method: 'POST',
-            url: '{{route('purchase')}}',
-            data: {_token: '{{csrf_token()}}', amount: amount, method: method, pay_type: pay_type},
-            dataType: 'json',
-            beforeSend: function() {
-              $('#charge_msg').show().html('{{trans('user.payment.creating')}}');
-            },
-            success: function(ret) {
-              $('#charge_msg').show().html(ret.message);
-              if (ret.status === 'fail') {
-                return false;
-              } else {
-                if (ret.data) {
-                  window.location.href = '{{route('orderDetail' , '')}}/' + ret.data;
-                } else if (ret.url) {
-                  window.location.href = ret.url;
+                $.ajax({
+                    method: 'POST',
+                    url: '{{ route('purchase') }}',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        amount: amount,
+                        method: method,
+                        pay_type: pay_type
+                    },
+                    dataType: 'json',
+                    beforeSend: function() {
+                        $('#charge_msg').show().html('{{ trans('user.payment.creating') }}');
+                    },
+                    success: function(ret) {
+                        $('#charge_msg').show().html(ret.message);
+                        if (ret.status === 'fail') {
+                            return false;
+                        } else {
+                            if (ret.data) {
+                                window.location.href = '{{ route('orderDetail', '') }}/' + ret.data;
+                            } else if (ret.url) {
+                                window.location.href = ret.url;
+                            }
+                        }
+                    },
+                    error: function() {
+                        $('#charge_msg').show().html("{{ trans('user.error_response') }}");
+                    },
+                });
+            } else if (paymentType === 2) {
+                if (charge_coupon === '') {
+                    $('#charge_msg').show().html("{{ trans('validation.required', ['attribute' => trans('model.coupon.attribute')]) }}");
+                    $('#charge_coupon').focus();
+                    return false;
                 }
-              }
-            },
-            error: function() {
-              $('#charge_msg').show().html("{{trans('user.error_response')}}");
-            },
-          });
-        } else if (paymentType === 2) {
-          if (charge_coupon === '') {
-            $('#charge_msg').show().html("{{trans('validation.required', ['attribute' => trans('model.coupon.attribute')])}}");
-            $('#charge_coupon').focus();
-            return false;
-          }
 
-          $.ajax({
-            method: 'POST',
-            url: '{{route('recharge')}}',
-            data: {_token: '{{csrf_token()}}', coupon_sn: charge_coupon},
-            beforeSend: function() {
-              $('#charge_msg').show().html("{{trans('user.recharging')}}");
-            },
-            success: function(ret) {
-              if (ret.status === 'fail') {
-                $('#charge_msg').show().html(ret.message);
-                return false;
-              }
+                $.ajax({
+                    method: 'POST',
+                    url: '{{ route('recharge') }}',
+                    data: {
+                        _token: '{{ csrf_token() }}',
+                        coupon_sn: charge_coupon
+                    },
+                    beforeSend: function() {
+                        $('#charge_msg').show().html("{{ trans('user.recharging') }}");
+                    },
+                    success: function(ret) {
+                        if (ret.status === 'fail') {
+                            $('#charge_msg').show().html(ret.message);
+                            return false;
+                        }
 
-              $('#charge_modal').modal('hide');
-              window.location.reload();
-            },
-            error: function() {
-              $('#charge_msg').show().html("{{trans('user.error_response')}}");
-            },
-          });
+                        $('#charge_modal').modal('hide');
+                        window.location.reload();
+                    },
+                    error: function() {
+                        $('#charge_msg').show().html("{{ trans('user.error_response') }}");
+                    },
+                });
+            }
         }
-      }
     </script>
 @endsection

+ 7 - 9
resources/views/vendor/log-viewer/remark/dashboard.blade.php

@@ -14,7 +14,7 @@
 
         <div class="col-12 col-md-6 col-lg-9 col-xl-10">
             <div class="row">
-                @foreach($percents as $level => $item)
+                @foreach ($percents as $level => $item)
                     <div class="col-sm-6 col-md-12 col-lg-4 mb-10">
                         <div class="box level-{{ $level }} {{ $item['count'] === 0 ? 'empty' : '' }}">
                             <div class="box-icon">
@@ -40,18 +40,16 @@
 
 @section('javascript')
     <script>
-      new Chart(document.getElementById('stats-doughnut-chart'),
-          {
+        new Chart(document.getElementById('stats-doughnut-chart'), {
             type: 'doughnut',
             data: {!! $chartData !!},
             options: {
-              plugins: {
-                legend: {
-                  position: 'bottom',
+                plugins: {
+                    legend: {
+                        position: 'bottom',
+                    },
                 },
-              },
             },
-          },
-      );
+        }, );
     </script>
 @endsection

+ 35 - 21
resources/views/vendor/log-viewer/remark/layouts.blade.php

@@ -8,10 +8,6 @@
             margin-bottom: 20px;
         }
 
-        /*
-         * Boxes
-         */
-
         .box {
             display: block;
             padding: 0;
@@ -22,14 +18,14 @@
             border-radius: 1.25rem;
         }
 
-        .box > .box-icon > i,
+        .box>.box-icon>i,
         .box .box-content .box-text,
         .box .box-content .box-number {
             color: #FFF;
             text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
         }
 
-        .box > .box-icon {
+        .box>.box-icon {
             border-radius: 1.25rem 0 0 1.25rem;
             display: block;
             float: left;
@@ -68,10 +64,6 @@
             background-color: #FFF;
         }
 
-        /*
-         * Log Entry
-         */
-
         .stack-content {
             color: #AE0E0E;
             font-family: consolas, Menlo, Courier, monospace;
@@ -79,10 +71,6 @@
             font-size: .8rem;
         }
 
-        /*
-         * Colors: Badge & Infobox
-         */
-
         .badge.badge-env,
         .badge.badge-level-all,
         .badge.badge-level-emergency,
@@ -154,11 +142,12 @@
     @yield('css')
 @endsection
 @section('layout_content')
-    <nav class="site-navbar navbar navbar-default navbar-fixed-top navbar-mega {{config('theme.navbar.inverse')}} {{config('theme.navbar.skin')}}" role="navigation">
+    <nav class="site-navbar navbar navbar-default navbar-fixed-top navbar-mega {{ config('theme.navbar.inverse') }} {{ config('theme.navbar.skin') }}"
+         role="navigation">
         <div class="navbar-header">
             <div class="navbar-brand navbar-brand-center">
-                <img src="{{sysConfig('website_logo')? asset(sysConfig('website_logo')) :'/assets/images/logo.png'}}" class="navbar-brand-logo" alt="logo"/>
-                <span class="navbar-brand-text hidden-xs-down"> {{sysConfig('website_name')}}</span>
+                <img class="navbar-brand-logo" src="{{ sysConfig('website_logo') ? asset(sysConfig('website_logo')) : '/assets/images/logo.png' }}" alt="logo" />
+                <span class="navbar-brand-text hidden-xs-down"> {{ sysConfig('website_name') }}</span>
             </div>
         </div>
         <div class="navbar-container container-fluid">
@@ -184,15 +173,13 @@
         </div>
     </nav>
     <div class="page ml-0">
-        <!--[if lt IE 8]><p class="browserupgrade">{{trans('common.update_browser.0')}}<strong>{{trans('common.update_browser.1')}}</strong>
-{{trans('common.update_browser.2')}}<a href="https://browsehappy.com/" target="_blank">{{trans('common.update_browser.3')}}</a>{{trans('common.update_browser.4')}}</p><![endif]-->
         <div class="container-fluid">
             @yield('content')
         </div>
     </div>
     <footer class="site-footer ml-0">
         <div class="site-footer-legal">© 2017 -
-            2023<a href="https://github.com/ProxyPanel/ProxyPanel" target="_blank">{{config('version.name')}} </a> {{__('All rights reserved.')}}
+            2024<a href="https://github.com/ProxyPanel/ProxyPanel" target="_blank">{{ config('version.name') }} </a> {{ __('All rights reserved.') }}
         </div>
         <div class="site-footer-right">
             Base on <a href="https://github.com/ARCANEDEV/LogViewer" target="_blank">LogViewer</a> 🚀
@@ -202,6 +189,33 @@
     @yield('modals')
 @endsection
 @section('layout_javascript')
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.6.0/chart.min.js" integrity="sha512-GMGzUEevhWh8Tc/njS0bDpwgxdCJLQBWG3Z2Ct+JGOpVnEmjvNx6ts4v6A2XJf1HOrtOsfhv3hBKpK9kE5z8AQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.6.0/chart.min.js"
+            integrity="sha512-GMGzUEevhWh8Tc/njS0bDpwgxdCJLQBWG3Z2Ct+JGOpVnEmjvNx6ts4v6A2XJf1HOrtOsfhv3hBKpK9kE5z8AQ==" crossorigin="anonymous"
+            referrerpolicy="no-referrer"></script>
+    <script>
+        const $buoop = {
+            required: {
+                e: 11,
+                f: -6,
+                o: -6,
+                s: -6,
+                c: -6
+            },
+            insecure: true,
+            unsupported: true,
+            api: 2024.07,
+        }
+
+        function $buo_f() {
+            const e = document.createElement('script')
+            e.src = "//browser-update.org/update.min.js";
+            document.body.appendChild(e);
+        }
+        try {
+            document.addEventListener("DOMContentLoaded", $buo_f, false)
+        } catch (e) {
+            window.attachEvent("onload", $buo_f)
+        }
+    </script>
     @yield('javascript')
 @endsection

+ 95 - 94
resources/views/vendor/log-viewer/remark/logs.blade.php

@@ -1,7 +1,8 @@
 @extends('vendor.log-viewer.remark.layouts')
 
 <?php
-/** @var  Illuminate\Pagination\LengthAwarePaginator $rows */ ?>
+/** @var  Illuminate\Pagination\LengthAwarePaginator $rows */
+?>
 
 @section('content')
     <div class="page-header">
@@ -11,55 +12,56 @@
     <div class="table-responsive">
         <table class="table table-hover">
             <thead>
-            <tr>
-                @foreach($headers as $key => $header)
-                    <th scope="col" class="{{ $key == 'date' ? 'text-left' : 'text-center' }}">
-                        @if ($key == 'date')
-                            <strong>{{ $header }}</strong>
-                        @else
-                            <strong class="badge badge-level-{{ $key }}">
-                                {{ log_styler()->icon($key) }} {{ $header }}
-                            </strong>
-                        @endif
-                    </th>
-                @endforeach
-                <th scope="col" class="text-right">@lang('Actions')</th>
-            </tr>
-            </thead>
-            <tbody>
-            @forelse($rows as $date => $row)
                 <tr>
-                    @foreach($row as $key => $value)
-                        <td class="{{ $key == 'date' ? 'text-left' : 'text-center' }}">
+                    @foreach ($headers as $key => $header)
+                        <th class="{{ $key == 'date' ? 'text-left' : 'text-center' }}" scope="col">
                             @if ($key == 'date')
-                                <strong>{{ $value }}</strong>
-                            @elseif ($value == 0)
+                                <strong>{{ $header }}</strong>
                             @else
-                                <a href="{{ route('log-viewer::logs.filter', [$date, $key]) }}">
-                                    <span class="badge badge-level-{{ $key }}">{{ $value }}</span>
-                                </a>
+                                <strong class="badge badge-level-{{ $key }}">
+                                    {{ log_styler()->icon($key) }} {{ $header }}
+                                </strong>
                             @endif
-                        </td>
+                        </th>
                     @endforeach
-                    <td class="text-right">
-                        <a href="{{ route('log-viewer::logs.show', [$date]) }}" class="btn btn-sm btn-info">
-                            <i class="fa-solid fa-magnifying-glass"></i>
-                        </a>
-                        <a href="{{ route('log-viewer::logs.download', [$date]) }}" class="btn btn-sm btn-success">
-                            <i class="fa-solid fa-download"></i>
-                        </a>
-                        <button class="btn btn-sm btn-danger" data-target="#deleteLogModal" data-toggle="modal" data-log-date="{{ $date }}" type="button">
-                            <i class="fa-solid fa-trash"></i> @lang('Delete')
-                        </button>
-                    </td>
+                    <th class="text-right" scope="col">@lang('Actions')</th>
                 </tr>
-            @empty
-                <tr>
-                    <td colspan="11" class="text-center">
-                        <span class="badge badge-secondary">@lang('The list of logs is empty!')</span>
-                    </td>
-                </tr>
-            @endforelse
+            </thead>
+            <tbody>
+                @forelse($rows as $date => $row)
+                    <tr>
+                        @foreach ($row as $key => $value)
+                            <td class="{{ $key == 'date' ? 'text-left' : 'text-center' }}">
+                                @if ($key == 'date')
+                                    <strong>{{ $value }}</strong>
+                                @elseif ($value == 0)
+                                @else
+                                    <a href="{{ route('log-viewer::logs.filter', [$date, $key]) }}">
+                                        <span class="badge badge-level-{{ $key }}">{{ $value }}</span>
+                                    </a>
+                                @endif
+                            </td>
+                        @endforeach
+                        <td class="text-right">
+                            <a class="btn btn-sm btn-info" href="{{ route('log-viewer::logs.show', [$date]) }}">
+                                <i class="fa-solid fa-magnifying-glass"></i>
+                            </a>
+                            <a class="btn btn-sm btn-success" href="{{ route('log-viewer::logs.download', [$date]) }}">
+                                <i class="fa-solid fa-download"></i>
+                            </a>
+                            <button class="btn btn-sm btn-danger" data-target="#deleteLogModal" data-toggle="modal" data-log-date="{{ $date }}"
+                                    type="button">
+                                <i class="fa-solid fa-trash"></i> @lang('Delete')
+                            </button>
+                        </td>
+                    </tr>
+                @empty
+                    <tr>
+                        <td class="text-center" colspan="11">
+                            <span class="badge badge-secondary">@lang('The list of logs is empty!')</span>
+                        </td>
+                    </tr>
+                @endforelse
             </tbody>
         </table>
     </div>
@@ -69,24 +71,23 @@
 
 @section('modals')
     {{-- DELETE MODAL --}}
-    <div id="deleteLogModal" class="modal fade" aria-hidden="true" aria-labelledby="deleteLogModal"
-         role="dialog" tabindex="-1">
+    <div class="modal fade" id="deleteLogModal" role="dialog" aria-hidden="true" aria-labelledby="deleteLogModal" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
-            <form id="deleteLogForm" class="modal-content" action="{{ route('log-viewer::logs.delete') }}" method="POST">
+            <form class="modal-content" id="deleteLogForm" action="{{ route('log-viewer::logs.delete') }}" method="POST">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">@lang('Delete log file')</h4>
                 </div>
                 <div class="modal-body">
-                    <input type="hidden" name="_method" value="DELETE">@csrf
-                    <input type="hidden" name="date" value="">
+                    <input name="_method" type="hidden" value="DELETE">@csrf
+                    <input name="date" type="hidden" value="">
                     <p></p>
                 </div>
                 <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal">@lang('Cancel')</button>
-                    <button type="submit" class="btn btn-danger" data-loading-text="@lang('Loading')&hellip;">@lang('Delete')</button>
+                    <button class="btn btn-secondary mr-auto" data-dismiss="modal" type="button">@lang('Cancel')</button>
+                    <button class="btn btn-danger" data-loading-text="@lang('Loading')&hellip;" type="submit">@lang('Delete')</button>
                 </div>
             </form>
         </div>
@@ -95,55 +96,55 @@
 
 @section('javascript')
     <script>
-      $(function() {
-        const deleteLogModal = $('div#deleteLogModal'),
-            deleteLogForm = $('form#deleteLogForm'),
-            submitBtn = deleteLogForm.find('button[type=submit]');
+        $(function() {
+            const deleteLogModal = $('div#deleteLogModal'),
+                deleteLogForm = $('form#deleteLogForm'),
+                submitBtn = deleteLogForm.find('button[type=submit]');
 
-        $('button[data-target=\'#deleteLogModal\']').on('click', function(event) {
-          event.preventDefault();
-          const date = $(this).data('log-date'),
-              message = "{{ __('Are you sure you want to delete this log file: :date ?') }}";
+            $('button[data-target=\'#deleteLogModal\']').on('click', function(event) {
+                event.preventDefault();
+                const date = $(this).data('log-date'),
+                    message = "{{ __('Are you sure you want to delete this log file: :date ?') }}";
 
-          deleteLogForm.find('input[name=date]').val(date);
-          deleteLogModal.find('.modal-body p').html(message.replace(':date', date));
+                deleteLogForm.find('input[name=date]').val(date);
+                deleteLogModal.find('.modal-body p').html(message.replace(':date', date));
 
-          deleteLogModal.modal('show');
-        });
+                deleteLogModal.modal('show');
+            });
 
-        deleteLogForm.on('submit', function(event) {
-          event.preventDefault();
-          submitBtn.button('loading');
+            deleteLogForm.on('submit', function(event) {
+                event.preventDefault();
+                submitBtn.button('loading');
 
-          $.ajax({
-            url: $(this).attr('action'),
-            type: $(this).attr('method'),
-            dataType: 'json',
-            data: $(this).serialize(),
-            success: function(data) {
-              submitBtn.button('reset');
-              if (data.result === 'success') {
-                deleteLogModal.modal('hide');
-                location.reload();
-              } else {
-                alert('AJAX ERROR ! Check the console !');
-                console.error(data);
-              }
-            },
-            error: function(xhr, textStatus, errorThrown) {
-              alert('AJAX ERROR ! Check the console !');
-              console.error(errorThrown);
-              submitBtn.button('reset');
-            },
-          });
+                $.ajax({
+                    url: $(this).attr('action'),
+                    type: $(this).attr('method'),
+                    dataType: 'json',
+                    data: $(this).serialize(),
+                    success: function(data) {
+                        submitBtn.button('reset');
+                        if (data.result === 'success') {
+                            deleteLogModal.modal('hide');
+                            location.reload();
+                        } else {
+                            alert('AJAX ERROR ! Check the console !');
+                            console.error(data);
+                        }
+                    },
+                    error: function(xhr, textStatus, errorThrown) {
+                        alert('AJAX ERROR ! Check the console !');
+                        console.error(errorThrown);
+                        submitBtn.button('reset');
+                    },
+                });
 
-          return false;
-        });
+                return false;
+            });
 
-        deleteLogModal.on('hidden.bs.modal', function() {
-          deleteLogForm.find('input[name=date]').val('');
-          deleteLogModal.find('.modal-body p').html('');
+            deleteLogModal.on('hidden.bs.modal', function() {
+                deleteLogForm.find('input[name=date]').val('');
+                deleteLogModal.find('.modal-body p').html('');
+            });
         });
-      });
     </script>
 @endsection

+ 140 - 144
resources/views/vendor/log-viewer/remark/show.blade.php

@@ -4,7 +4,6 @@
  * @var  Illuminate\Pagination\LengthAwarePaginator $entries
  * @var  string|null $query
  */
-
 ?>
 
 @extends('vendor.log-viewer.remark.layouts')
@@ -18,15 +17,14 @@
         <div class="col-lg-2">
             {{-- Log Menu --}}
             <div class="list-group">
-                @foreach($log->menu() as $levelKey => $item)
+                @foreach ($log->menu() as $levelKey => $item)
                     @if ($item['count'] === 0)
                         <a class="list-group-item disabled">
                             <span class="level-name">{!! $item['icon'] !!} {{ $item['name'] }}</span>
                             <span class="float-right badge empty">{{ $item['count'] }}</span>
                         </a>
                     @else
-                        <a href="{{ $item['url'] }}"
-                           class="list-group-item level-{{ $levelKey }}{{ $level === $levelKey ? ' active' : ''}}">
+                        <a class="list-group-item level-{{ $levelKey }}{{ $level === $levelKey ? ' active' : '' }}" href="{{ $item['url'] }}">
                             <span class="level-name">{!! $item['icon'] !!} {{ $item['name'] }}</span>
                             <span class="float-right badge badge-level-{{ $levelKey }}">{{ $item['count'] }}</span>
                         </a>
@@ -40,7 +38,7 @@
                 <div class="panel-heading">
                     <h3 class="panel-title"> @lang('Log info') :</h3>
                     <div class="panel-actions panel-actions-keep">
-                        <a href="{{ route('log-viewer::logs.download', [$log->date]) }}" class="btn btn-sm btn-success">
+                        <a class="btn btn-sm btn-success" href="{{ route('log-viewer::logs.download', [$log->date]) }}">
                             <i class="fa-solid fa-download"></i> @lang('Download')
                         </a>
                         <button class="btn btn-sm btn-danger" data-target="#deleteLogModal" data-toggle="modal" type="button">
@@ -52,28 +50,28 @@
                     <div class="table-responsive">
                         <table class="table mb-0">
                             <tbody>
-                            <tr>
-                                <td>@lang('File path') :</td>
-                                <td colspan="7">{{ $log->getPath() }}</td>
-                            </tr>
-                            <tr>
-                                <td>@lang('Log entries') :</td>
-                                <td>
-                                    <span class="badge badge-primary">{{ $entries->total() }}</span>
-                                </td>
-                                <td>@lang('Size') :</td>
-                                <td>
-                                    <span class="badge badge-primary">{{ $log->size() }}</span>
-                                </td>
-                                <td>@lang('Created at') :</td>
-                                <td>
-                                    <span class="badge badge-primary">{{ $log->createdAt() }}</span>
-                                </td>
-                                <td>@lang('Updated at') :</td>
-                                <td>
-                                    <span class="badge badge-primary">{{ $log->updatedAt() }}</span>
-                                </td>
-                            </tr>
+                                <tr>
+                                    <td>@lang('File path') :</td>
+                                    <td colspan="7">{{ $log->getPath() }}</td>
+                                </tr>
+                                <tr>
+                                    <td>@lang('Log entries') :</td>
+                                    <td>
+                                        <span class="badge badge-primary">{{ $entries->total() }}</span>
+                                    </td>
+                                    <td>@lang('Size') :</td>
+                                    <td>
+                                        <span class="badge badge-primary">{{ $log->size() }}</span>
+                                    </td>
+                                    <td>@lang('Created at') :</td>
+                                    <td>
+                                        <span class="badge badge-primary">{{ $log->createdAt() }}</span>
+                                    </td>
+                                    <td>@lang('Updated at') :</td>
+                                    <td>
+                                        <span class="badge badge-primary">{{ $log->updatedAt() }}</span>
+                                    </td>
+                                </tr>
                             </tbody>
                         </table>
                     </div>
@@ -83,15 +81,15 @@
                     <form action="{{ route('log-viewer::logs.search', [$log->date, $level]) }}" method="GET">
                         <div class="form-group">
                             <div class="input-group">
-                                <input id="query" name="query" class="form-control" value="{{ $query }}" placeholder="@lang('Type here to search')">
+                                <input class="form-control" id="query" name="query" value="{{ $query }}" placeholder="@lang('Type here to search')">
                                 <div class="input-group-append">
                                     @unless (is_null($query))
-                                        <a href="{{ route('log-viewer::logs.show', [$log->date]) }}" class="btn btn-secondary">
+                                        <a class="btn btn-secondary" href="{{ route('log-viewer::logs.show', [$log->date]) }}">
                                             (@lang(':count results', ['count' => $entries->count()]))
                                             <i class="fa-solid fa-fw fa-xmark"></i>
                                         </a>
                                     @endunless
-                                    <button id="search-btn" class="btn btn-primary">
+                                    <button class="btn btn-primary" id="search-btn">
                                         <i class="fa-solid fa-fw fa-magnifying-glass"></i>
                                     </button>
                                 </div>
@@ -115,81 +113,82 @@
                 </div>
                 <div class="panel-body">
                     <div class="table-responsive">
-                        <table id="entries" class="table table-striped mb-0">
+                        <table class="table table-striped mb-0" id="entries">
                             <thead>
-                            <tr>
-                                <th>ID</th>
-                                <th style="white-space: nowrap;">@lang('ENV')</th>
-                                <th>@lang('Level')</th>
-                                <th>@lang('Time')</th>
-                                <th>@lang('Header')</th>
-                                <th>@lang('Actions')</th>
-                            </tr>
+                                <tr>
+                                    <th>ID</th>
+                                    <th style="white-space: nowrap;">@lang('ENV')</th>
+                                    <th>@lang('Level')</th>
+                                    <th>@lang('Time')</th>
+                                    <th>@lang('Header')</th>
+                                    <th>@lang('Actions')</th>
+                                </tr>
                             </thead>
                             <tbody>
-                            @forelse($entries as $key => $entry)
+                                @forelse($entries as $key => $entry)
                                     <?php
-                                    /** @var  Arcanedev\LogViewer\Entities\LogEntry $entry */ ?>
-                                <tr>
-                                    <td>
-                                        {{ $key+1 }}
-                                    </td>
-                                    <td style="white-space: nowrap;">
-                                        {{ $entry->env }}
-                                    </td>
-                                    <td>
-                                        <span class="badge badge-level-{{ $entry->level }}">
-                                            {!! $entry->level() !!}
-                                        </span>
-                                    </td>
-                                    <td>
-                                        <span class="badge badge-secondary">
-                                            {{ $entry->datetime->format('H:i:s') }}
-                                        </span>
-                                    </td>
-                                    <td>
-                                        {{ $entry->header }}
-                                    </td>
-                                    <td class="text-right">
-                                        @if ($entry->hasStack())
-                                            <a class="btn btn-sm btn-light" role="button" data-toggle="collapse"
-                                               href="#log-stack-{{ $key }}" aria-expanded="false" aria-controls="log-stack-{{ $key }}">
-                                                <i class="fa-solid fa-toggle-on"></i> @lang('Stack')
-                                            </a>
-                                        @endif
-
-                                        @if ($entry->hasContext())
-                                            <a class="btn btn-sm btn-light" role="button" data-toggle="collapse"
-                                               href="#log-context-{{ $key }}" aria-expanded="false" aria-controls="log-context-{{ $key }}">
-                                                <i class="fa-solid fa-toggle-on"></i> @lang('Context')
-                                            </a>
-                                        @endif
-                                    </td>
-                                </tr>
-                                @if ($entry->hasStack() || $entry->hasContext())
+                                    /** @var  Arcanedev\LogViewer\Entities\LogEntry $entry */
+                                    ?>
                                     <tr>
-                                        <td colspan="6" class="stack py-0">
+                                        <td>
+                                            {{ $key + 1 }}
+                                        </td>
+                                        <td style="white-space: nowrap;">
+                                            {{ $entry->env }}
+                                        </td>
+                                        <td>
+                                            <span class="badge badge-level-{{ $entry->level }}">
+                                                {!! $entry->level() !!}
+                                            </span>
+                                        </td>
+                                        <td>
+                                            <span class="badge badge-secondary">
+                                                {{ $entry->datetime->format('H:i:s') }}
+                                            </span>
+                                        </td>
+                                        <td>
+                                            {{ $entry->header }}
+                                        </td>
+                                        <td class="text-right">
                                             @if ($entry->hasStack())
-                                                <div class="stack-content collapse" id="log-stack-{{ $key }}">
-                                                    {!! $entry->stack() !!}
-                                                </div>
+                                                <a class="btn btn-sm btn-light" data-toggle="collapse" href="#log-stack-{{ $key }}" role="button"
+                                                   aria-expanded="false" aria-controls="log-stack-{{ $key }}">
+                                                    <i class="fa-solid fa-toggle-on"></i> @lang('Stack')
+                                                </a>
                                             @endif
 
                                             @if ($entry->hasContext())
-                                                <div class="stack-content collapse" id="log-context-{{ $key }}">
-                                                    <pre>{{ $entry->context() }}</pre>
-                                                </div>
+                                                <a class="btn btn-sm btn-light" data-toggle="collapse" href="#log-context-{{ $key }}" role="button"
+                                                   aria-expanded="false" aria-controls="log-context-{{ $key }}">
+                                                    <i class="fa-solid fa-toggle-on"></i> @lang('Context')
+                                                </a>
                                             @endif
                                         </td>
                                     </tr>
-                                @endif
-                            @empty
-                                <tr>
-                                    <td colspan="5" class="text-center">
-                                        <span class="badge badge-secondary">@lang('The list of logs is empty!')</span>
-                                    </td>
-                                </tr>
-                            @endforelse
+                                    @if ($entry->hasStack() || $entry->hasContext())
+                                        <tr>
+                                            <td class="stack py-0" colspan="6">
+                                                @if ($entry->hasStack())
+                                                    <div class="stack-content collapse" id="log-stack-{{ $key }}">
+                                                        {!! $entry->stack() !!}
+                                                    </div>
+                                                @endif
+
+                                                @if ($entry->hasContext())
+                                                    <div class="stack-content collapse" id="log-context-{{ $key }}">
+                                                        <pre>{{ $entry->context() }}</pre>
+                                                    </div>
+                                                @endif
+                                            </td>
+                                        </tr>
+                                    @endif
+                                @empty
+                                    <tr>
+                                        <td class="text-center" colspan="5">
+                                            <span class="badge badge-secondary">@lang('The list of logs is empty!')</span>
+                                        </td>
+                                    </tr>
+                                @endforelse
                             </tbody>
                         </table>
                     </div>
@@ -201,7 +200,7 @@
                         </div>
                         <div class="col-sm-8">
                             <nav class="Page navigation float-right">
-                                {{$entries->links()}}
+                                {{ $entries->links() }}
                             </nav>
                         </div>
                     </div>
@@ -213,24 +212,23 @@
 
 @section('modals')
     {{-- DELETE MODAL --}}
-    <div id="deleteLogModal" class="modal fade" aria-hidden="true" aria-labelledby="deleteLogModal"
-         role="dialog" tabindex="-1">
+    <div class="modal fade" id="deleteLogModal" role="dialog" aria-hidden="true" aria-labelledby="deleteLogModal" tabindex="-1">
         <div class="modal-dialog modal-simple modal-center">
-            <form id="deleteLogForm" class="modal-content" action="{{ route('log-viewer::logs.delete') }}" method="POST">
+            <form class="modal-content" id="deleteLogForm" action="{{ route('log-viewer::logs.delete') }}" method="POST">
                 <div class="modal-header">
-                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('common.close') }}">
+                    <button class="close" data-dismiss="modal" type="button" aria-label="{{ trans('common.close') }}">
                         <span aria-hidden="true">×</span>
                     </button>
                     <h4 class="modal-title">@lang('Delete log file')</h4>
                 </div>
                 <div class="modal-body">
-                    <input type="hidden" name="_method" value="DELETE">@csrf
-                    <input type="hidden" name="date" value="{{ $log->date }}">
+                    <input name="_method" type="hidden" value="DELETE">@csrf
+                    <input name="date" type="hidden" value="{{ $log->date }}">
                     <p>@lang('Are you sure you want to delete this log file: :date ?', ['date' => $log->date])</p>
                 </div>
                 <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary mr-auto" data-dismiss="modal">@lang('Cancel')</button>
-                    <button type="submit" class="btn btn-danger" data-loading-text="@lang('Loading')&hellip;">@lang('Delete')</button>
+                    <button class="btn btn-secondary mr-auto" data-dismiss="modal" type="button">@lang('Cancel')</button>
+                    <button class="btn btn-danger" data-loading-text="@lang('Loading')&hellip;" type="submit">@lang('Delete')</button>
                 </div>
             </form>
         </div>
@@ -239,53 +237,51 @@
 
 @section('javascript')
     <script>
-      $(function() {
-        const deleteLogModal = $('div#deleteLogModal'),
-            deleteLogForm = $('form#deleteLogForm'),
-            submitBtn = deleteLogForm.find('button[type=submit]');
+        $(function() {
+            const deleteLogModal = $('div#deleteLogModal'),
+                deleteLogForm = $('form#deleteLogForm'),
+                submitBtn = deleteLogForm.find('button[type=submit]');
 
-        deleteLogForm.on('submit', function(event) {
-          event.preventDefault();
-          submitBtn.button('loading');
+            deleteLogForm.on('submit', function(event) {
+                event.preventDefault();
+                submitBtn.button('loading');
 
-          $.ajax({
-            url: $(this).attr('action'),
-            type: $(this).attr('method'),
-            dataType: 'json',
-            data: $(this).serialize(),
-            success: function(data) {
-              submitBtn.button('reset');
-              if (data.result === 'success') {
-                deleteLogModal.modal('hide');
-                location.replace("{{ route('log-viewer::logs.list') }}");
-              } else {
-                alert('OOPS ! This is a lack of coffee exception !');
-              }
-            },
-            error: function(xhr, textStatus, errorThrown) {
-              alert('AJAX ERROR ! Check the console !');
-              console.error(errorThrown);
-              submitBtn.button('reset');
-            },
-          });
+                $.ajax({
+                    url: $(this).attr('action'),
+                    type: $(this).attr('method'),
+                    dataType: 'json',
+                    data: $(this).serialize(),
+                    success: function(data) {
+                        submitBtn.button('reset');
+                        if (data.result === 'success') {
+                            deleteLogModal.modal('hide');
+                            location.replace("{{ route('log-viewer::logs.list') }}");
+                        } else {
+                            alert('OOPS ! This is a lack of coffee exception !');
+                        }
+                    },
+                    error: function(xhr, textStatus, errorThrown) {
+                        alert('AJAX ERROR ! Check the console !');
+                        console.error(errorThrown);
+                        submitBtn.button('reset');
+                    },
+                });
 
-          return false;
-        });
+                return false;
+            });
 
-          @unless (empty(log_styler()->toHighlight()))
-          @php
-              $htmlHighlight = version_compare(PHP_VERSION, '7.4.0') >= 0
-                  ? join('|', log_styler()->toHighlight())
-                  : join(log_styler()->toHighlight(), '|')
-          @endphp
+            @unless (empty(log_styler()->toHighlight()))
+                @php
+                    $htmlHighlight = implode('|', log_styler()->toHighlight());
+                @endphp
 
-          $('.stack-content').each(function() {
-            const $this = $(this);
-            const html = $this.html().trim().replace(/({!! $htmlHighlight !!})/gm, '<strong>$1</strong>');
+                $('.stack-content').each(function() {
+                    const $this = $(this);
+                    const html = $this.html().trim().replace(/({!! $htmlHighlight !!})/gm, '<strong>$1</strong>');
 
-            $this.html(html);
-          });
-          @endunless
-      });
+                    $this.html(html);
+                });
+            @endunless
+        });
     </script>
 @endsection