some progress
This commit is contained in:
@@ -11,6 +11,27 @@ use Illuminate\View\View;
|
||||
|
||||
class HealthCheckController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display overview of all health checks across all sites
|
||||
*/
|
||||
public function overview(): View
|
||||
{
|
||||
$sites = Site::where('user_id', Auth::id())
|
||||
->withCount('healthChecks')
|
||||
->with(['healthChecks' => function ($query) {
|
||||
$query->where('is_active', true)->limit(5);
|
||||
}])
|
||||
->get();
|
||||
|
||||
$stats = [
|
||||
'total_sites' => $sites->count(),
|
||||
'total_health_checks' => $sites->sum('health_checks_count'),
|
||||
'sites_with_checks' => $sites->where('health_checks_count', '>', 0)->count(),
|
||||
];
|
||||
|
||||
return view('health-checks.overview', compact('sites', 'stats'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the health checks for a site.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user