Przeglądaj źródła

fix: 🐛 Show Product name instead of resource description #756

IceToast 2 lat temu
rodzic
commit
91476d2701
1 zmienionych plików z 52 dodań i 30 usunięć
  1. 52 30
      themes/default/views/admin/servers/index.blade.php

+ 52 - 30
themes/default/views/admin/servers/index.blade.php

@@ -6,12 +6,13 @@
         <div class="container-fluid">
             <div class="row mb-2">
                 <div class="col-sm-6">
-                    <h1>{{__('Servers')}}</h1>
+                    <h1>{{ __('Servers') }}</h1>
                 </div>
                 <div class="col-sm-6">
                     <ol class="breadcrumb float-sm-right">
-                        <li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
-                        <li class="breadcrumb-item"><a class="text-muted" href="{{route('admin.servers.index')}}">{{__('Servers')}}</a></li>
+                        <li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
+                        <li class="breadcrumb-item"><a class="text-muted"
+                                href="{{ route('admin.servers.index') }}">{{ __('Servers') }}</a></li>
                     </ol>
                 </div>
             </div>
@@ -27,25 +28,25 @@
                 <div class="card-header">
                     <div class="d-flex justify-content-between">
                         <div class="card-title ">
-                            <span><i class="fas fa-server mr-2"></i>{{__('Servers')}}</span>
+                            <span><i class="fas fa-server mr-2"></i>{{ __('Servers') }}</span>
                         </div>
-                        <a href="{{route('admin.servers.sync')}}" class="btn btn-primary btn-sm"><i
-                                class="fas fa-sync mr-2"></i>{{__('Sync')}}</a>
+                        <a href="{{ route('admin.servers.sync') }}" class="btn btn-primary btn-sm"><i
+                                class="fas fa-sync mr-2"></i>{{ __('Sync') }}</a>
                     </div>
                 </div>
                 <div class="card-body table-responsive">
                     <table id="datatable" class="table table-striped">
                         <thead>
-                        <tr>
-                            <th width="20">{{ __('Status') }}</th>
-                            <th>{{__('Name')}}</th>
-                            <th>{{__('User')}}</th>
-                            <th>{{__('Server id')}}</th>
-                            <th>{{__('Config')}}</th>
-                            <th>{{__('Suspended at')}}</th>
-                            <th>{{__('Created at')}}</th>
-                            <th>{{ __('Actions') }}</th>
-                        </tr>
+                            <tr>
+                                <th width="20">{{ __('Status') }}</th>
+                                <th>{{ __('Name') }}</th>
+                                <th>{{ __('User') }}</th>
+                                <th>{{ __('Server id') }}</th>
+                                <th>{{ __('Product') }}</th>
+                                <th>{{ __('Suspended at') }}</th>
+                                <th>{{ __('Created at') }}</th>
+                                <th>{{ __('Actions') }}</th>
+                            </tr>
                         </thead>
                         <tbody>
                         </tbody>
@@ -61,10 +62,10 @@
 
 <script>
     function submitResult() {
-        return confirm("{{__('Are you sure you wish to delete?')}}") !== false;
+        return confirm("{{ __('Are you sure you wish to delete?') }}") !== false;
     }
 
-    document.addEventListener("DOMContentLoaded", function () {
+    document.addEventListener("DOMContentLoaded", function() {
         $('#datatable').DataTable({
             language: {
                 url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ $locale_datatables }}.json'
@@ -72,19 +73,40 @@
             processing: true,
             serverSide: true,
             stateSave: true,
-            ajax: "{{route('admin.servers.datatable')}}{{$filter ?? ''}}",
-            order: [[ 5, "desc" ]],
-            columns: [
-                {data: 'status' , name : 'servers.suspended'},
-                {data: 'name'},
-                {data: 'user' , name : 'user.name'},
-                {data: 'identifier'},
-                {data: 'resources' , name : 'product.name'},
-                {data: 'suspended'},
-                {data: 'created_at'},
-                {data: 'actions' , sortable : false},
+            ajax: "{{ route('admin.servers.datatable') }}{{ $filter ?? '' }}",
+            order: [
+                [5, "desc"]
             ],
-            fnDrawCallback: function( oSettings ) {
+            columns: [{
+                    data: 'status',
+                    name: 'servers.suspended'
+                },
+                {
+                    data: 'name'
+                },
+                {
+                    data: 'user',
+                    name: 'user.name'
+                },
+                {
+                    data: 'identifier'
+                },
+                {
+                    data: 'product.name',
+                    sortable: false
+                },
+                {
+                    data: 'suspended'
+                },
+                {
+                    data: 'created_at'
+                },
+                {
+                    data: 'actions',
+                    sortable: false
+                },
+            ],
+            fnDrawCallback: function(oSettings) {
                 $('[data-toggle="popover"]').popover();
             }
         });