From 334846dba947fb1f440ffc30e8cfe709cf6e0de5 Mon Sep 17 00:00:00 2001 From: Erlang Parasu Date: Sat, 1 Aug 2020 18:12:26 +0800 Subject: [PATCH 1/4] getBasePath --- 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 d20672b..4a503a1 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: '/{{ request()->path() }}/auth', + authEndpoint: '/{{ request()->getBasePath() }}/auth', auth: { headers: { 'X-CSRF-Token': "{{ csrf_token() }}", @@ -162,7 +162,7 @@ }, loadChart() { - $.getJSON('/{{ request()->path() }}/api/'+this.app.id+'/statistics', (data) => { + $.getJSON('/{{ request()->getBasePath() }}/api/'+this.app.id+'/statistics', (data) => { let chartData = [ { @@ -246,7 +246,7 @@ }, sendEvent() { - $.post('/{{ request()->path() }}/event', { + $.post('/{{ request()->getBasePath() }}/event', { _token: '{{ csrf_token() }}', key: this.app.key, secret: this.app.secret, From 14b9b11836496662e4cbd4e97aaf4ee379c6c152 Mon Sep 17 00:00:00 2001 From: Erlang Parasu Date: Sat, 1 Aug 2020 18:29:48 +0800 Subject: [PATCH 2/4] Update dashboard.blade.php --- 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 4a503a1..f19b83e 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: '/{{ request()->getBasePath() }}/auth', + authEndpoint: '{{ request()->getBasePath() }}/{{ request()->path() }}/auth', auth: { headers: { 'X-CSRF-Token': "{{ csrf_token() }}", @@ -162,7 +162,7 @@ }, loadChart() { - $.getJSON('/{{ request()->getBasePath() }}/api/'+this.app.id+'/statistics', (data) => { + $.getJSON('{{ request()->getBasePath() }}/{{ request()->path() }}/api/'+this.app.id+'/statistics', (data) => { let chartData = [ { @@ -246,7 +246,7 @@ }, sendEvent() { - $.post('/{{ request()->getBasePath() }}/event', { + $.post('{{ request()->getBasePath() }}/{{ request()->path() }}/event', { _token: '{{ csrf_token() }}', key: this.app.key, secret: this.app.secret, From ee81f7ad3a87a5e0d07a67bbcb9f4c9c643fdcd5 Mon Sep 17 00:00:00 2001 From: Erlang Parasu Date: Thu, 13 Aug 2020 17:11:57 +0800 Subject: [PATCH 3/4] use function url --- 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 f19b83e..b9c9785 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: '{{ request()->getBasePath() }}/{{ request()->path() }}/auth', + authEndpoint: '{{ url("/auth") }}', auth: { headers: { 'X-CSRF-Token': "{{ csrf_token() }}", @@ -162,7 +162,7 @@ }, loadChart() { - $.getJSON('{{ request()->getBasePath() }}/{{ request()->path() }}/api/'+this.app.id+'/statistics', (data) => { + $.getJSON('{{ url("/api") }}/' + this.app.id + '/statistics', (data) => { let chartData = [ { @@ -246,7 +246,7 @@ }, sendEvent() { - $.post('{{ request()->getBasePath() }}/{{ request()->path() }}/event', { + $.post('{{ url("/event") }}', { _token: '{{ csrf_token() }}', key: this.app.key, secret: this.app.secret, From 7fc020d1dc221cd000a96edb556d218fa67d9b69 Mon Sep 17 00:00:00 2001 From: rennokki Date: Thu, 13 Aug 2020 12:13:07 +0300 Subject: [PATCH 4/4] formatting --- 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 b9c9785..fbf90c7 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('/auth') }}', auth: { headers: { 'X-CSRF-Token': "{{ csrf_token() }}", @@ -162,7 +162,7 @@ }, loadChart() { - $.getJSON('{{ url("/api") }}/' + this.app.id + '/statistics', (data) => { + $.getJSON('{{ url('/api') }}/' + this.app.id + '/statistics', (data) => { let chartData = [ { @@ -246,7 +246,7 @@ }, sendEvent() { - $.post('{{ url("/event") }}', { + $.post('{{ url('/event') }}', { _token: '{{ csrf_token() }}', key: this.app.key, secret: this.app.secret,