From 679a8d097a9062e56456ab1a860bf80b93964d79 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Thu, 13 Aug 2020 14:40:19 +0300 Subject: [PATCH 1/2] Fixed logger --- config/websockets.php | 2 +- src/Console/StartWebSocketServer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/websockets.php b/config/websockets.php index a4517cf..45415d7 100644 --- a/config/websockets.php +++ b/config/websockets.php @@ -85,7 +85,7 @@ return [ * The Statistics Logger will, by default, handle the incoming statistics, store them * and then release them into the database on each interval defined below. */ - 'logger' => \BeyondCode\LaravelWebSockets\Statistics\Logger::class, + 'logger' => BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class, /* * Here you can specify the interval in seconds at which statistics should be logged. diff --git a/src/Console/StartWebSocketServer.php b/src/Console/StartWebSocketServer.php index cd1de64..9c51470 100644 --- a/src/Console/StartWebSocketServer.php +++ b/src/Console/StartWebSocketServer.php @@ -65,7 +65,7 @@ class StartWebSocketServer extends Command $browser = new Browser($this->loop, $connector); app()->singleton(StatisticsLoggerInterface::class, function () use ($browser) { - $class = config('websockets.statistics.logger', \BeyondCode\LaravelWebSockets\Statistics\Logger::class); + $class = config('websockets.statistics.logger', \BeyondCode\LaravelWebSockets\Statistics\Logger\HttpStatisticsLogger::class); return new $class(app(ChannelManager::class), $browser); }); From 83830548fd9950d1066e5c0edd8f5d56ab21aa16 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Thu, 13 Aug 2020 15:21:55 +0300 Subject: [PATCH 2/2] Fixed the urls for the dashboard API calls --- resources/views/dashboard.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index fbf90c7..58a6426 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -118,7 +118,7 @@ wssPort: this.port === null ? 6001 : this.port, wsPath: this.app.path === null ? '' : this.app.path, disableStats: true, - authEndpoint: '{{ url('/auth') }}', + authEndpoint: '{{ url(request()->path().'/auth') }}', auth: { headers: { 'X-CSRF-Token': "{{ csrf_token() }}", @@ -162,7 +162,7 @@ }, loadChart() { - $.getJSON('{{ url('/api') }}/' + this.app.id + '/statistics', (data) => { + $.getJSON('{{ url(request()->path().'/api') }}/' + this.app.id + '/statistics', (data) => { let chartData = [ { @@ -246,7 +246,7 @@ }, sendEvent() { - $.post('{{ url('/event') }}', { + $.post('{{ url(request()->path().'/event') }}', { _token: '{{ csrf_token() }}', key: this.app.key, secret: this.app.secret,