Pārlūkot izejas kodu

more details on admin overview

1day2die 2 gadi atpakaļ
vecāks
revīzija
74c7fc9da1

+ 3 - 1
app/Http/Controllers/Admin/OverViewController.php

@@ -37,7 +37,9 @@ class OverViewController extends Controller
         //Get counters
         $counters = collect();
         //Set basic variables in the collection
-        $counters->put('users', User::query()->count());
+        $counters->put('users', collect());
+        $counters['users']->active = User::where("suspended", 0)->count();
+        $counters['users']->total = User::query()->count();
         $counters->put('credits', number_format(User::query()->whereHas("roles", function($q){ $q->where("id", "!=", "1"); })->sum('credits'), 2, '.', ''));
         $counters->put('payments', Payment::query()->count());
         $counters->put('eggs', Egg::query()->count());

+ 13 - 3
themes/default/views/admin/overview/index.blade.php

@@ -58,7 +58,12 @@
                         <span class="info-box-icon bg-info elevation-1"><i class="fas fa-server"></i></span>
 
                         <div class="info-box-content">
-                            <span class="info-box-text">{{__('Servers')}}</span>
+                            <span class="info-box-text">{{__('Servers')}}
+                          <i class="fas fa-info-circle mr-4" data-toggle="popover"
+                             data-trigger="hover" data-placement="top"
+                             data-html="true"
+                             data-content="{{ __("This shows the total active servers and the total servers. Total active servers are all servers which are not suspended") }}"></i>
+                            </span>
                             <span class="info-box-number">{{$counters['servers']->active}}/{{$counters['servers']->total}}</span>
                         </div>
                         <!-- /.info-box-content -->
@@ -71,8 +76,13 @@
                         <span class="info-box-icon bg-primary elevation-1"><i class="fas fa-users"></i></span>
 
                         <div class="info-box-content">
-                            <span class="info-box-text">{{__('Users')}}</span>
-                            <span class="info-box-number">{{$counters['users']}}</span>
+                            <span class="info-box-text">{{__('Users')}}
+                              <i class="fas fa-info-circle mr-4" data-toggle="popover"
+                                  data-trigger="hover" data-placement="top"
+                                  data-html="true"
+                                  data-content="{{ __("This shows the total active Users and the total Users. Total active Users are all Users which are not suspended") }}"></i>
+                              </span>
+                          <span class="info-box-number">{{$counters['users']->active}}/{{$counters['users']->total}}</span>
                         </div>
                         <!-- /.info-box-content -->
                     </div>