some progress
This commit is contained in:
@@ -9,6 +9,27 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class TcpPortController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display overview of all TCP ports across all sites
|
||||
*/
|
||||
public function overview()
|
||||
{
|
||||
$sites = Site::where('user_id', Auth::id())
|
||||
->withCount('tcpPorts')
|
||||
->with(['tcpPorts' => function ($query) {
|
||||
$query->where('is_active', true)->limit(5);
|
||||
}])
|
||||
->get();
|
||||
|
||||
$stats = [
|
||||
'total_sites' => $sites->count(),
|
||||
'total_ports_monitored' => $sites->sum('tcp_ports_count'),
|
||||
'sites_with_ports' => $sites->where('tcp_ports_count', '>', 0)->count(),
|
||||
];
|
||||
|
||||
return view('tcp-ports.overview', compact('sites', 'stats'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user