Skip to content

Commit

Permalink
fix custom route when we are in subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
spyp committed Aug 28, 2018
1 parent c001762 commit ddf1553
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/Controllers/TubesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function __construct(PheanstalkInterface $pheanstalk, JobRepository $jobs
public function index()
{
$tubeNames = collect($this->pheanstalk->listTubes());

// Adam Wathan give me your strength!
$tubes = collect($tubeNames)->map(function ($tube) {
return collect($this->pheanstalk->statsTube($tube))->slice(1)->all();
Expand All @@ -58,7 +57,7 @@ public function showTube($tube)
$nextReady = $this->jobs->nextReady($tube, true);
$nextBuried = $this->jobs->nextBuried($tube);
$nextDelayed = $this->jobs->nextDelayed($tube, true);
$prefix = config('beanstalkdui.prefix');
$prefix = url()->to('/'.config('beanstalkdui.prefix'));

return view('beanstalkdui::tubes.show', compact(
'nextReady',
Expand Down
4 changes: 1 addition & 3 deletions src/Resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ new Vue({

methods: {
prefixUrl: function (url){
return this.prefix.length > 0
? '/' + this.prefix + url
: url
return this.prefix + url;
},
fetchData: function () {
$.get(this.prefixUrl('/beanstalkd/api/tubes/' + this.tube), function (response) {
Expand Down
4 changes: 1 addition & 3 deletions src/Resources/assets/js/failed-jobs-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ new Vue({

methods: {
prefixUrl: function (url){
return this.prefix.length > 0
? '/' + this.prefix + url
: url
return this.prefix + url;
},
refresh: function (notify) {
$.get(this.prefixUrl('/beanstalkd/api/tubes/' + this.tube + '/failed'), function (response) {
Expand Down

0 comments on commit ddf1553

Please sign in to comment.