mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-18 12:31:27 +00:00
Merge pull request #457 from pixelfed/frontend-ui-refactor
Update AdminController, remove stats for now
This commit is contained in:
commit
0f673d73b8
2 changed files with 10 additions and 9 deletions
|
@ -29,7 +29,7 @@ class AdminController extends Controller
|
|||
|
||||
public function users(Request $request)
|
||||
{
|
||||
$stats = $this->collectUserStats($request);
|
||||
$stats = [];
|
||||
$users = User::orderBy('id', 'desc')->paginate(10);
|
||||
return view('admin.users.home', compact('users', 'stats'));
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class AdminController extends Controller
|
|||
|
||||
|
||||
protected function collectUserStats($request)
|
||||
{
|
||||
{
|
||||
$total_duration = $request->query('total_duration') ?? '30';
|
||||
$new_duration = $request->query('new_duration') ?? '7';
|
||||
$stats = [];
|
||||
|
@ -97,7 +97,7 @@ class AdminController extends Controller
|
|||
'remote' => Profile::whereNotNull('remote_url')->count()
|
||||
];
|
||||
$stats['avg'] = [
|
||||
'age' => Carbon::parse(substr(User::avg('created_at'),0,8))->diffForHumans(null,true,true),
|
||||
'age' => 0,
|
||||
'posts' => floor(Status::avg('profile_id'))
|
||||
];
|
||||
return $stats;
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<div class="title">
|
||||
<h3 class="font-weight-bold">Users</h3>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<hr>
|
||||
{{-- <div class="row mb-3">
|
||||
<div class="col-12 col-md-6 mb-2">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
@ -17,7 +18,7 @@
|
|||
<option data-duration="30" selected="">1 Month</option>
|
||||
<option data-duration="365">1 Year</option>
|
||||
</select>
|
||||
</span> --}}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="h3 font-weight-bold mb-0">{{$stats['total']['count']}}</p>
|
||||
|
@ -38,7 +39,7 @@
|
|||
<option selected="">1 Month</option>
|
||||
<option>1 Year</option>
|
||||
</select>
|
||||
</span> --}}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="h3 font-weight-bold mb-0">{{$stats['new']['count']}}</p>
|
||||
|
@ -95,7 +96,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead class="bg-light">
|
||||
|
@ -215,8 +216,8 @@
|
|||
lineColor: '#0083CD',
|
||||
fillColor: false
|
||||
};
|
||||
$('.totalUsers').sparkline({{$stats['total']['points']}}, sparkopts);
|
||||
$('.newUsers').sparkline({{$stats['new']['points']}}, sparkopts);
|
||||
{{-- $('.totalUsers').sparkline({{$stats['total']['points']}}, sparkopts);
|
||||
$('.newUsers').sparkline({{$stats['new']['points']}}, sparkopts); --}}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
Loading…
Reference in a new issue