From 9bdd5c8d92d6b6f7e5b5f929e01b0db9e1e495ef Mon Sep 17 00:00:00 2001 From: Daniel Weissengruber Date: Tue, 9 Mar 2021 17:25:21 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=EF=B8=8F=20=20add=20json=20status=20e?= =?UTF-8?q?ndpoint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StatusReportController.php | 29 +++++++++++++++++++ routes/web.php | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 app/Http/Controllers/StatusReportController.php diff --git a/app/Http/Controllers/StatusReportController.php b/app/Http/Controllers/StatusReportController.php new file mode 100644 index 0000000..8312c62 --- /dev/null +++ b/app/Http/Controllers/StatusReportController.php @@ -0,0 +1,29 @@ +url]['uptime'] = $site->generateUptimeReport(); + $results[$site->url]['ssl'] = $site->certificates()->latest()->first(); + $results[$site->url]['dns'] = $site->last_dns_scans; + $results[$site->url]['robots'] = $site->last_robot_scans; + } + + return $results; + } +} diff --git a/routes/web.php b/routes/web.php index 9933dd6..f13fb81 100644 --- a/routes/web.php +++ b/routes/web.php @@ -17,6 +17,8 @@ Route::put('edit-account', '\Maelstrom\Http\Controllers\EditAccountController@update'); Route::post('logout', 'Auth\LoginController@logout')->name('maelstrom.logout'); + Route::get('status', 'StatusReportController')->name('status'); + Route::post('websites/bulk', 'WebsiteController@bulk')->name('websites.bulk'); Route::resource('websites', 'WebsiteController'); Route::get('websites/{website}/robots', 'RobotCompareController')->name('robots');