Add the pulse script and the component for the public pages
This commit is contained in:
1 parent
1e002ed0c5
commit
5c0a94f167
9 files changed
+154
-1
No files matched your search
@@ -5,6 +5,7 @@ namespace IriksIT\Manager\Modules\Statistics;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
/**
|
||||
* Where the public pages report a page view and the time spent on it. These routes run without
|
||||
@@ -12,6 +13,16 @@ use Illuminate\Http\Response;
|
||||
*/
|
||||
class PulseController
|
||||
{
|
||||
/** The script of the public pages (`<x-manager::pulse />` puts it in the page). */
|
||||
public function script(): BinaryFileResponse
|
||||
{
|
||||
return response()->file(__DIR__.'/../../../resources/js/pulse.js', [
|
||||
'Content-Type' => 'application/javascript',
|
||||
'Cache-Control' => 'public, max-age=3600',
|
||||
'X-Content-Type-Options' => 'nosniff',
|
||||
]);
|
||||
}
|
||||
|
||||
public function view(Request $request, VisitRecorder $recorder): JsonResponse
|
||||
{
|
||||
// A browser that says its user does not want to be followed is not counted at all.
|
||||
|
||||
Reference in new issue
Block a user