index.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. @extends('layouts.main')
  2. @section('content')
  3. <!-- CONTENT HEADER -->
  4. <section class="content-header">
  5. <div class="container-fluid">
  6. <div class="mb-2 row">
  7. <div class="col-sm-6">
  8. <h1>{{ __('Servers') }}</h1>
  9. </div>
  10. <div class="col-sm-6">
  11. <ol class="breadcrumb float-sm-right">
  12. <li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
  13. <li class="breadcrumb-item"><a class="text-muted"
  14. href="{{ route('admin.servers.index') }}">{{ __('Servers') }}</a></li>
  15. </ol>
  16. </div>
  17. </div>
  18. </div>
  19. </section>
  20. <!-- END CONTENT HEADER -->
  21. <!-- MAIN CONTENT -->
  22. <section class="content">
  23. <div class="container-fluid">
  24. <div class="card">
  25. <div class="card-header">
  26. <div class="d-flex justify-content-between">
  27. <div class="card-title ">
  28. <span><i class="mr-2 fas fa-server"></i>{{ __('Servers') }}</span>
  29. </div>
  30. <a href="{{ route('admin.servers.sync') }}" class="btn btn-primary btn-sm"><i
  31. class="mr-2 fas fa-sync"></i>{{ __('Sync') }}</a>
  32. </div>
  33. </div>
  34. <div class="card-body table-responsive">
  35. <table id="datatable" class="table table-striped">
  36. <thead>
  37. <tr>
  38. <th width="20">{{ __('Status') }}</th>
  39. <th>{{ __('Name') }}</th>
  40. <th>{{ __('User') }}</th>
  41. <th>{{ __('Server id') }}</th>
  42. <th>{{ __('Product') }}</th>
  43. <th>{{ __('Suspended at') }}</th>
  44. <th>{{ __('Created at') }}</th>
  45. <th>{{ __('Actions') }}</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- END CUSTOM CONTENT -->
  55. </div>
  56. </section>
  57. <!-- END CONTENT -->
  58. @endsection
  59. <script>
  60. function submitResult() {
  61. return confirm("{{ __('Are you sure you wish to delete?') }}") !== false;
  62. }
  63. document.addEventListener("DOMContentLoaded", function() {
  64. $('#datatable').DataTable({
  65. language: {
  66. url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
  67. },
  68. processing: true,
  69. serverSide: true,
  70. stateSave: true,
  71. ajax: "{{ route('admin.servers.datatable') }}{{ $filter ?? '' }}",
  72. order: [
  73. [5, "desc"]
  74. ],
  75. columns: [{
  76. data: 'status',
  77. name: 'servers.suspended'
  78. },
  79. {
  80. data: 'name'
  81. },
  82. {
  83. data: 'user',
  84. name: 'user.name'
  85. },
  86. {
  87. data: 'identifier'
  88. },
  89. {
  90. data: 'product.name',
  91. },
  92. {
  93. data: 'suspended'
  94. },
  95. {
  96. data: 'created_at'
  97. },
  98. {
  99. data: 'actions',
  100. sortable: false
  101. },
  102. ],
  103. fnDrawCallback: function(oSettings) {
  104. $('[data-toggle="popover"]').popover();
  105. }
  106. });
  107. });
  108. </script>