socialpandas / sidekiq_monitor

Advanced monitoring for Sidekiq
MIT License
230 stars 35 forks source link

Graph page not working #9

Closed NOV-DM closed 10 years ago

NOV-DM commented 11 years ago

I get the following error in my browser console when i go to graph page:

image

tombenner commented 11 years ago

A /#! shouldn't be included in the requested URLs. You likely have another plugin that's interfering here. Please try entering the following into your JS console:

SidekiqMonitor.settings.api_url('')

If this returns /sidekiq/api, then the issue is probably with a redirect; if it returns /#!/sidekiq/api, then the issue is related to something rewriting the route for where Sidekiq Monitor is mounted.

NOV-DM commented 11 years ago

/#! is included because there was no matching route found in rails. I am using rails for json api and angularjs for frontend. If the api route is not found it tries to redirect it to the frontend.

SidekiqMonitor.settings.api_url('')

returns

/sidekiq/api

I looked into it a bit and the problem is that I mount my sidekiq_monitor to

mount Sidekiq::Monitor::Engine => '/sidekiq/monitor'

but

SidekiqMonitor.settings.api_url('')

still returns

 /sidekiq/api

it should return

 /sidekiq/monitor/api

i tried to call

http://localhost:9000/sidekiq/monitor/api/jobs/graph

and the response was correct

I tried a temporary workaround and mounted my sidekiq_monitor to

mount Sidekiq::Monitor::Engine => '/sidekiq'

and it works but the problem is that I also have sidekiq mounted to the same route so now when I access that url i get to sidekiq and if i want to access sidekiq_monitor tabs I have to manually go to url like

/sidekiq/graph

but other pages like /queues and /jobs is not working because it is using sidekiq tabs instead

NOV-DM commented 11 years ago

I believe error lays here https://github.com/socialpandas/sidekiq_monitor/blob/master/app/assets/javascripts/sidekiq/monitor/initialize.js.coffee.erb

url_helpers.sidekiq_monitor_path

returns wrong url

tombenner commented 10 years ago

This should be fixed in 0.1.2.