resque-web 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/app/assets/javascripts/resque_web/application.js +0 -89
  4. data/app/assets/javascripts/resque_web/failure.js.coffee +7 -0
  5. data/app/assets/javascripts/resque_web/polling.js.coffee +25 -0
  6. data/app/assets/javascripts/resque_web/relative_date.js.coffee +27 -0
  7. data/app/assets/stylesheets/resque_web/{bootstrap_and_overrides.css.erb → bootstrap_and_overrides.css.scss} +1 -1
  8. data/app/controllers/resque_web/application_controller.rb +2 -0
  9. data/app/controllers/resque_web/queues_controller.rb +5 -0
  10. data/app/controllers/resque_web/stats_controller.rb +24 -5
  11. data/app/controllers/resque_web/workers_controller.rb +6 -1
  12. data/app/controllers/resque_web/working_controller.rb +4 -0
  13. data/app/helpers/resque_web/application_helper.rb +10 -6
  14. data/app/helpers/resque_web/failures_helper.rb +4 -0
  15. data/app/views/layouts/resque_web/application.html.erb +1 -1
  16. data/app/views/resque_web/failures/index.html.erb +18 -19
  17. data/app/views/resque_web/queues/show.html.erb +2 -2
  18. data/app/views/resque_web/stats/keys.html.erb +2 -4
  19. data/config/routes.rb +5 -1
  20. data/lib/resque_web/engine.rb +5 -0
  21. data/lib/resque_web/version.rb +1 -1
  22. data/test/dummy/log/development.log +2148 -0
  23. data/test/dummy/log/test.log +12499 -0
  24. data/test/dummy/tmp/cache/assets/development/sass/3700e9ce5293267736ba97e0c26f3d47c0831f78/bootstrap_and_overrides.css.scssc +0 -0
  25. data/test/dummy/tmp/cache/assets/development/sprockets/267d0243760c55e0ff8039158fbfa98d +0 -0
  26. data/test/dummy/tmp/cache/assets/development/sprockets/27702049a9de2629f2ed91cdd31be59f +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/373b0c58027ae58f732cc7e48e62a522 +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/492baca6c94c6497c4cd84a8be19c680 +0 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/4d22200fb380d8ae9d5f07525088622f +0 -0
  30. data/test/dummy/tmp/cache/assets/development/sprockets/5a6bde0acfcefec77d80e353647b009d +0 -0
  31. data/test/dummy/tmp/cache/assets/development/sprockets/62048721da4f3b03c45790b988031b97 +0 -0
  32. data/test/dummy/tmp/cache/assets/development/sprockets/68ef5c7f933ca591803bc207c78523d2 +0 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/7cc1cf7c3cfd0a98060c98f3854c2623 +0 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/823cf0a4ada4a293acf5ea2c94d0fe51 +0 -0
  35. data/test/dummy/tmp/cache/assets/development/sprockets/8fbf100e961e22baca23d1850b41e4d5 +0 -0
  36. data/test/dummy/tmp/cache/assets/development/sprockets/a14b14c6f9b0cc8813ccef7ebe52b946 +0 -0
  37. data/test/dummy/tmp/cache/assets/development/sprockets/a476c44dad10844e0f468821badf02fd +0 -0
  38. data/test/dummy/tmp/cache/assets/development/sprockets/b32b680312dc848727e94d9a05750037 +0 -0
  39. data/test/dummy/tmp/cache/assets/development/sprockets/b6f28ccc1808230b8d7f937253be2112 +0 -0
  40. data/test/dummy/tmp/cache/assets/development/sprockets/ccbf15c47a87da505803a6a215148d3a +0 -0
  41. data/test/dummy/tmp/cache/assets/development/sprockets/d9f00b466d45c065d1281b100de9311f +0 -0
  42. data/test/dummy/tmp/cache/assets/development/sprockets/e05ff4f8801c918dc89fef1d37880568 +0 -0
  43. data/test/dummy/tmp/cache/assets/test/sass/3700e9ce5293267736ba97e0c26f3d47c0831f78/bootstrap_and_overrides.css.scssc +0 -0
  44. data/test/dummy/tmp/cache/assets/test/sprockets/02fc0f32ed6d2b2e5865bfdf79df6ae5 +0 -0
  45. data/test/dummy/tmp/cache/assets/test/sprockets/032c0d9725e6f257678ff460b7ec61da +0 -0
  46. data/test/dummy/tmp/cache/assets/test/sprockets/0351bddf9b742970e5e314f04138c3cf +0 -0
  47. data/test/dummy/tmp/cache/assets/test/sprockets/0b685878ca84b0dd82f9836bd70d7340 +0 -0
  48. data/test/dummy/tmp/cache/assets/test/sprockets/0fbf718cb07a27a132ae7edba954fb40 +0 -0
  49. data/test/dummy/tmp/cache/assets/test/sprockets/15ec19285d7eabe2154ec51a428dc21c +0 -0
  50. data/test/dummy/tmp/cache/assets/test/sprockets/195ca31a7cf5107a657fb2d90e8dc35c +0 -0
  51. data/test/dummy/tmp/cache/assets/test/sprockets/256f88a09b236d9ddbde7985826d274d +0 -0
  52. data/test/dummy/tmp/cache/assets/test/sprockets/267d0243760c55e0ff8039158fbfa98d +0 -0
  53. data/test/dummy/tmp/cache/assets/test/sprockets/27702049a9de2629f2ed91cdd31be59f +0 -0
  54. data/test/dummy/tmp/cache/assets/test/sprockets/29f5fe6a38dbf15c9c6540d227e466d8 +0 -0
  55. data/test/dummy/tmp/cache/assets/test/sprockets/2a9f8ccd705f08ca1a66ef68d0967655 +0 -0
  56. data/test/dummy/tmp/cache/assets/test/sprockets/2ab37c1672b566feb5086d1efce4ef06 +0 -0
  57. data/test/dummy/tmp/cache/assets/test/sprockets/2d13e89fb36400e53d9d1f772a7306d3 +0 -0
  58. data/test/dummy/tmp/cache/assets/test/sprockets/323ae466a976c736904d337e04a77f0f +0 -0
  59. data/test/dummy/tmp/cache/assets/test/sprockets/32fdb0387d5cd8aba5f0185f10ccaf6b +0 -0
  60. data/test/dummy/tmp/cache/assets/test/sprockets/3300fcbaadb94dfc76a5e15a917d2a5c +0 -0
  61. data/test/dummy/tmp/cache/assets/test/sprockets/3404b8d7ffc0f3f7fb3f8c09a820ae2d +0 -0
  62. data/test/dummy/tmp/cache/assets/test/sprockets/34e1f36ce83865719fa7b26a65e34fba +0 -0
  63. data/test/dummy/tmp/cache/assets/test/sprockets/373b0c58027ae58f732cc7e48e62a522 +0 -0
  64. data/test/dummy/tmp/cache/assets/test/sprockets/395fd7e9d9dd28f6a1a225902df3d1b3 +0 -0
  65. data/test/dummy/tmp/cache/assets/test/sprockets/3af7b9731ca77394a5e3cd5484e047b3 +0 -0
  66. data/test/dummy/tmp/cache/assets/test/sprockets/3b603e358acbce7d4e6c7e53be5a8414 +0 -0
  67. data/test/dummy/tmp/cache/assets/test/sprockets/404fe327fe27745a105909c9d0d7dc0e +0 -0
  68. data/test/dummy/tmp/cache/assets/test/sprockets/429d37a3143b763262f09380204b6e7e +0 -0
  69. data/test/dummy/tmp/cache/assets/test/sprockets/4703603e63c6b5332b1710c8f80df833 +0 -0
  70. data/test/dummy/tmp/cache/assets/test/sprockets/4830cd721ae6d64fb5a86d30393ab181 +0 -0
  71. data/test/dummy/tmp/cache/assets/test/sprockets/492baca6c94c6497c4cd84a8be19c680 +0 -0
  72. data/test/dummy/tmp/cache/assets/test/sprockets/4b4f58fffb5873ecfe6f0feb8eaa0de6 +0 -0
  73. data/test/dummy/tmp/cache/assets/test/sprockets/4d22200fb380d8ae9d5f07525088622f +0 -0
  74. data/test/dummy/tmp/cache/assets/test/sprockets/4db5ecfa8e71040f6b070f2fe5d8830a +0 -0
  75. data/test/dummy/tmp/cache/assets/test/sprockets/4ff25675e9d69ac5d68dff1d4372f3d1 +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/57db68673f85a8f19a095060304788f1 +0 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/58209bfedfa5a8913da17d9dfe378ee5 +0 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/58c189068622a1bf78f759f8f7851143 +0 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/5af3b0789d5082831e9eaa717c4f0c3e +0 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/62566022f4deb51d6a7ebc74ed5e0077 +0 -0
  81. data/test/dummy/tmp/cache/assets/test/sprockets/64369bdb2598739d4b56d393e84a2fc2 +0 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/64ea7d9eaa6f2720d29f54d945cf527e +0 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/68ef5c7f933ca591803bc207c78523d2 +0 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/6abca5d2fa4f208d859608aaab9a86aa +0 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/6b333684cc88cc858701e0ff2a0fcc96 +0 -0
  86. data/test/dummy/tmp/cache/assets/test/sprockets/6ceaff99fe282a7a75bb97f927d693dd +0 -0
  87. data/test/dummy/tmp/cache/assets/test/sprockets/6e7acd6f7443db46070d24f98875e26b +0 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/700f27aaa765d8d3752a1a26a0e2b6de +0 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/718edbc6b6e91350bc4f9c696ba2eabe +0 -0
  90. data/test/dummy/tmp/cache/assets/test/sprockets/722f2a204ab15e0261bc526aa3ea4a3d +0 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/79965bea5ecea07173592c30b2d7cd4a +0 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/7a2aaf3f4f2464cab9a6a546516d6093 +0 -0
  93. data/test/dummy/tmp/cache/assets/test/sprockets/7cc1cf7c3cfd0a98060c98f3854c2623 +0 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/7dcef8f4767eeae44ff2368ed119f80d +0 -0
  95. data/test/dummy/tmp/cache/assets/test/sprockets/7e982e844962031ecd1bfc047979da8e +0 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/81cde34de1dc552dabbc5f1cb007756a +0 -0
  97. data/test/dummy/tmp/cache/assets/test/sprockets/822f558a291238c0e1243baa05dc0078 +0 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/823cf0a4ada4a293acf5ea2c94d0fe51 +0 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/8347d8bab74b0f7d886d8956383f9529 +0 -0
  100. data/test/dummy/tmp/cache/assets/test/sprockets/854305634174de2dfc6115e0d05de74a +0 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/871f29c20b88dc490ec27567227d0ced +0 -0
  102. data/test/dummy/tmp/cache/assets/test/sprockets/8855c560fba1bd85e26f55568144a4d5 +0 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/8d90527f6d78f66cd9a0e1b6d80540ea +0 -0
  104. data/test/dummy/tmp/cache/assets/test/sprockets/8db5e0838ccc7af599bed9d1583d9536 +0 -0
  105. data/test/dummy/tmp/cache/assets/test/sprockets/8e526dc1a43ba261ea96cc7d60a38f3f +0 -0
  106. data/test/dummy/tmp/cache/assets/test/sprockets/8ede852c2a9449d78c01e89499f273e5 +0 -0
  107. data/test/dummy/tmp/cache/assets/test/sprockets/8f0bb559073ecfcd453b2edf3b3942d9 +0 -0
  108. data/test/dummy/tmp/cache/assets/test/sprockets/8fbf100e961e22baca23d1850b41e4d5 +0 -0
  109. data/test/dummy/tmp/cache/assets/test/sprockets/90bf5c76a5b601d800906b8f3378cd4a +0 -0
  110. data/test/dummy/tmp/cache/assets/test/sprockets/946024650dc58c11ad04e5276406dbaf +0 -0
  111. data/test/dummy/tmp/cache/assets/test/sprockets/9950bbaad1c8200f7c5211be2ff9dde9 +0 -0
  112. data/test/dummy/tmp/cache/assets/test/sprockets/9ab5bb1f2843f449ae54518739b99fe0 +0 -0
  113. data/test/dummy/tmp/cache/assets/test/sprockets/9bae2543ee8034cbd1cb0dc7fdb66551 +0 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/a476c44dad10844e0f468821badf02fd +0 -0
  115. data/test/dummy/tmp/cache/assets/test/sprockets/a491611d8a81efd7b36e6598d7164775 +0 -0
  116. data/test/dummy/tmp/cache/assets/test/sprockets/a5338dffdab56b5e26f8cb798f3d3fbd +0 -0
  117. data/test/dummy/tmp/cache/assets/test/sprockets/a86260e43f4af99c33552e1d15c1beff +0 -0
  118. data/test/dummy/tmp/cache/assets/test/sprockets/a8daa7ca89f875fa27015cfbed019daf +0 -0
  119. data/test/dummy/tmp/cache/assets/test/sprockets/a8ffd37644d986072d5bdb95109200fd +0 -0
  120. data/test/dummy/tmp/cache/assets/test/sprockets/a97936f8de2ec1ac226ff6adfa10c58a +0 -0
  121. data/test/dummy/tmp/cache/assets/test/sprockets/aa129daab62391fd5a7e4da2629c16c3 +0 -0
  122. data/test/dummy/tmp/cache/assets/test/sprockets/ab9f83c297cdf1b77e2757ac42bd046e +0 -0
  123. data/test/dummy/tmp/cache/assets/test/sprockets/ac46bc10e41a078e53c502585d18a2fd +0 -0
  124. data/test/dummy/tmp/cache/assets/test/sprockets/b32b680312dc848727e94d9a05750037 +0 -0
  125. data/test/dummy/tmp/cache/assets/test/sprockets/b66838b2bbafc524cb33bcf0245bb634 +0 -0
  126. data/test/dummy/tmp/cache/assets/test/sprockets/c14a109a9ad16a532a14457fd85ef40d +0 -0
  127. data/test/dummy/tmp/cache/assets/test/sprockets/c50a3882a8af8120296e694171a75a76 +0 -0
  128. data/test/dummy/tmp/cache/assets/test/sprockets/c7c8b271f30a25ebed6ed14122a73d8d +0 -0
  129. data/test/dummy/tmp/cache/assets/test/sprockets/c8d75f093577f5a4d8371b8097c1d2a0 +0 -0
  130. data/test/dummy/tmp/cache/assets/test/sprockets/c90e9c573e54b170859449cb2ceb3a7a +0 -0
  131. data/test/dummy/tmp/cache/assets/test/sprockets/ccbf15c47a87da505803a6a215148d3a +0 -0
  132. data/test/dummy/tmp/cache/assets/test/sprockets/d2c9ab6cb2ffab9203c49e8aa8a8638a +0 -0
  133. data/test/dummy/tmp/cache/assets/test/sprockets/d3347e44949d8909be6fb1d64cfb9967 +0 -0
  134. data/test/dummy/tmp/cache/assets/test/sprockets/d3b37b59d7bfbff886d5fe9196331477 +0 -0
  135. data/test/dummy/tmp/cache/assets/test/sprockets/d572fd50d855d3cfca311d6a7d613483 +0 -0
  136. data/test/dummy/tmp/cache/assets/test/sprockets/d9f00b466d45c065d1281b100de9311f +0 -0
  137. data/test/dummy/tmp/cache/assets/test/sprockets/da24d6ed6605c160606df54829bd2243 +0 -0
  138. data/test/dummy/tmp/cache/assets/test/sprockets/db86602761e31ddd6facdfdf79b09545 +0 -0
  139. data/test/dummy/tmp/cache/assets/test/sprockets/dc94fd89d95deffd26d73a2dc7839c5c +0 -0
  140. data/test/dummy/tmp/cache/assets/test/sprockets/de8c7c42ab9ce204bd092917cab19b7b +0 -0
  141. data/test/dummy/tmp/cache/assets/test/sprockets/df621608c5dbad64a79460c92a787133 +0 -0
  142. data/test/dummy/tmp/cache/assets/test/sprockets/df794e3dae763f3ff0c96f05147eadc6 +0 -0
  143. data/test/dummy/tmp/cache/assets/test/sprockets/e05ff4f8801c918dc89fef1d37880568 +0 -0
  144. data/test/dummy/tmp/cache/assets/test/sprockets/e48e226b900fedce58cd317408956ddf +0 -0
  145. data/test/dummy/tmp/cache/assets/test/sprockets/e49c4d8ec8434e5f0015f356cd1b9e62 +0 -0
  146. data/test/dummy/tmp/cache/assets/test/sprockets/e4b617370a479f0edc146ad94b472b46 +0 -0
  147. data/test/dummy/tmp/cache/assets/test/sprockets/e71835fce5a1cd93cf2d176e8d72c34a +0 -0
  148. data/test/dummy/tmp/cache/assets/test/sprockets/e8606c009704eb4d9fd929abafc4e24b +0 -0
  149. data/test/dummy/tmp/cache/assets/test/sprockets/efc408ad768caf0eccd8bf07e13bd0c3 +0 -0
  150. data/test/dummy/tmp/cache/assets/test/sprockets/f2f0052d6146026489e3d05e891e6fe9 +0 -0
  151. data/test/dummy/tmp/cache/assets/test/sprockets/f7334b050d787bac849d2728a2fd4b1f +0 -0
  152. data/test/dummy/tmp/cache/assets/test/sprockets/f81463d0d5bd6cf7d83cdaaaaf320dff +0 -0
  153. data/test/dummy/tmp/cache/assets/test/sprockets/fac0cf39deee2f9a7dc39c3123bd8648 +0 -0
  154. data/test/functional/queues_controller_test.rb +27 -6
  155. data/test/functional/stats_controller_test.rb +67 -4
  156. data/test/functional/workers_controller_test.rb +23 -4
  157. data/test/functional/working_controller_test.rb +16 -4
  158. data/test/integration/plugin_integration_test.rb +72 -0
  159. data/test/test_helper.rb +1 -1
  160. data/test/unit/helpers/failures_helper_test.rb +11 -0
  161. metadata +473 -244
  162. data/lib/resque_web/tabs.rb +0 -21
  163. data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49370634f83656fb026087b61f407d0e694d270e
4
- data.tar.gz: 6f8cffbd8816702b2d0e95e2a1cf68c7817c32a5
3
+ metadata.gz: 9234c02c3b2a4284338cbd1d3214e4d79b1b1073
4
+ data.tar.gz: a5522b9fdb62a1a70681b96e11debb8ec70759ef
5
5
  SHA512:
6
- metadata.gz: 16cce0ff5e53e531fab09ff82391e2c246d908bb21d5e6e82553be8deefca77713be5a6b135b37ad60010741ae06e5fa3066b09241bf1c56f3ade1797e4ace08
7
- data.tar.gz: 146990a48227c490a62c66d2f186e2b8ce3d50c1a67c400fc9b773e9e786a9c868d641b3568614c7398995c5982d665ce4311fcdbd1b9c667cc69c679b8b6969
6
+ metadata.gz: 255bfc7bfb5bac12a736df7abfa4d74f218813743901daefda73733b85d0a0bfb884125d4645e77ac33f9aa3b22604780b7bb646d0632ee4395da011b1bb1014
7
+ data.tar.gz: 8e1d4ff4d789a7b67db3af49ab8151e52df649325195fd3143a981531fec8747a84719ec5a7773280870eb4fa0b30d9da1df5fb00b630fbe543ca3e9964b27cf
data/README.md CHANGED
@@ -11,6 +11,13 @@ application that comes bundled with Resque, but deploys like a Rails application
11
11
  and leverages Rails conventions for factoring things like controllers, helpers,
12
12
  and views.
13
13
 
14
+ # NOTICE
15
+ Note this is NOT the old sinatra interface that comes with Resque 1-x. This is
16
+ a new project based on rails. If you have any issues with old web server,
17
+ please file an issue on the [resque](https://github.com/resque/resque) project.
18
+ Note that the sinatra web interface will be gone in Resque 2.0 and this is
19
+ meant to be the replacement.
20
+
14
21
  More documentation coming soon!
15
22
 
16
23
  ## Starting
@@ -70,6 +77,12 @@ end
70
77
 
71
78
  HTTP Basic Authentication is supported out of the box. Simply set the environment variables `RESQUE_WEB_HTTP_BASIC_AUTH_USER` and `RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD` to turn it on. If you're using Resque with Heroku run `heroku config:set RESQUE_WEB_HTTP_BASIC_AUTH_USER=user RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD=secret` to get ResqueWeb secured.
72
79
 
80
+ ## Plugins
81
+
82
+ In the past with the sinatra app it was fairly simple to just monkey-patch the
83
+ server to add more functionality/tabs. With this rails version you have to write
84
+ an engine under a specific namespace. Read more in PLUGINS.md.
85
+
73
86
  ## Screenshot
74
87
 
75
88
  ![Screenshot](http://i.imgur.com/LkNgl.png)
@@ -14,92 +14,3 @@
14
14
  //= require jquery_ujs
15
15
  //= require twitter/bootstrap
16
16
  //= require_tree .
17
-
18
- $(function() {
19
- var poll_interval = 2
20
-
21
- var relatizer = function(){
22
- var dt = $(this).text();
23
- $(this).relativeDate();
24
- var relatized = $(this).text();
25
-
26
- if ($(this).parents("a").length > 0 || $(this).is("a")) {
27
- $(this).relativeDate()
28
- if (!$(this).attr('title')) {
29
- $(this).attr('title', dt)
30
- }
31
- } else {
32
- $(this)
33
- .text('')
34
- .append( $('<a href="#" class="toggle_format" title="' + dt + '" />')
35
- .append('<span class="date_time">' + dt +
36
- '</span><span class="relatized_time">' +
37
- relatized + '</span>') )
38
- }
39
- };
40
-
41
- $('.time').each(relatizer);
42
-
43
- $('.time a.toggle_format .date_time').hide()
44
-
45
- var format_toggler = function(){
46
- $('.time a.toggle_format span').toggle()
47
- $(this).attr('title', $('span:hidden',this).text())
48
- return false
49
- };
50
-
51
- $('.time a.toggle_format').click(format_toggler);
52
-
53
- $('.backtrace').click(function() {
54
- $(this).next().toggle()
55
- return false
56
- })
57
-
58
- var poll_start = function(el) {
59
- var href = el.attr('href')
60
- el.parent().text('Starting...')
61
- $("#main").addClass('polling')
62
-
63
- setInterval(function() {
64
- $.ajax({dataType: 'text', type: 'get', url: href, success: function(data) {
65
- $('#main').html(data)
66
- $('#main .time').relativeDate()
67
- }})
68
- }, poll_interval * 1000)
69
-
70
- location.hash = '#poll'
71
-
72
- return false
73
- };
74
-
75
- if (location.hash == '#poll') poll_start($('a[rel=poll]'))
76
-
77
- $('a[rel=poll]').click(function() { return poll_start($(this)) })
78
-
79
- $('ul.failed li').hover(function() {
80
- $(this).addClass('hover');
81
- }, function() {
82
- $(this).removeClass('hover');
83
- })
84
-
85
- $('ul.failed a[rel=retry]').click(function() {
86
- var href = $(this).attr('href');
87
- $(this).text('Retrying...');
88
- var parent = $(this).parent();
89
- $.ajax({dataType: 'text', type: 'get', url: href, success: function(data) {
90
- parent.html('Retried <b><span class="time">' + data + '</span></b>');
91
- relatizer.apply($('.time', parent));
92
- $('.date_time', parent).hide();
93
- $('a.toggle_format span', parent).click(format_toggler);
94
- }});
95
- return false;
96
- })
97
-
98
- $('#clear-failed-jobs').click(function(){
99
- return confirm('Are you sure you want to clear ALL failed jobs?');
100
- })
101
-
102
- $('#retry-failed-jobs').click(function(){
103
- return confirm('Are you sure you want to retry ALL failed jobs?');
104
- })
105
- })
@@ -0,0 +1,7 @@
1
+ jQuery ->
2
+ $(".backtrace").click (e) ->
3
+ e.preventDefault()
4
+ $(this).next().toggle()
5
+
6
+ $("ul.failed li").hover ->
7
+ $(this).toggleClass "hover"
@@ -0,0 +1,25 @@
1
+ jQuery ->
2
+ poll_interval = 2
3
+
4
+ poll_start = (el) ->
5
+ href = el.attr("href")
6
+ el.parent().text "Starting..."
7
+ $("#main").addClass "polling"
8
+ setInterval (->
9
+ $.ajax
10
+ dataType: "text"
11
+ type: "get"
12
+ url: href
13
+ success: (data) ->
14
+ $("#main").html data
15
+ $("#main .time").relativeDate()
16
+ ), poll_interval * 1000
17
+ location.hash = "#poll"
18
+
19
+ # auto start if hash is poll
20
+ poll_start $("a[rel=poll]") if location.hash == "#poll"
21
+
22
+ # start when click on link
23
+ $("a[rel=poll]").click (e) ->
24
+ e.preventDefault()
25
+ poll_start $(this)
@@ -0,0 +1,27 @@
1
+ jQuery ->
2
+ relatizer = ->
3
+ dt = $(this).text()
4
+ $(this).relativeDate()
5
+ relatized = $(this).text()
6
+ if $(this).parents("a").size() > 0 || $(this).is("a")
7
+ $(this).relativeDate()
8
+ $(this).attr("title", dt) unless $(this).attr("title")
9
+ else
10
+ $(this).html """
11
+ <a href='#'' class='toggle_format' title='#{dt}'>
12
+ <span class='date_time'>#{dt}</span>
13
+ <span class='relatized_time'>#{relatized}</span>
14
+ </a>
15
+ """
16
+
17
+ format_toggler = (e) ->
18
+ e.preventDefault()
19
+ $(".time a.toggle_format span").toggle()
20
+ $(this).attr "title", $("span:hidden", this).text()
21
+
22
+ # changed html when doom is ready
23
+ $(".time").each relatizer
24
+ $(".time a.toggle_format .date_time").hide()
25
+
26
+ # add event on click in relative time to show date_time
27
+ $(".time").on "click", "a.toggle_format", format_toggler
@@ -101,7 +101,7 @@ body {
101
101
  #footer { padding:10px 5%; background:#efefef; color:#999; font-size:85%; line-height:1.5; border-top:5px solid #ccc; padding-top:10px;}
102
102
  #footer p a { color:#999;}
103
103
 
104
- .container p.poll { background:url(<%= asset_path 'poll.png' %>) no-repeat 0 2px; padding:3px 0; padding-left:23px; float:right; font-size:85%; }
104
+ .container p.poll { background:url(image-url('poll.png')) no-repeat 0 2px; padding:3px 0; padding-left:23px; float:right; font-size:85%; }
105
105
 
106
106
  .container ul.failed {margin-top: 20px;}
107
107
  .container ul.failed li {
@@ -3,6 +3,8 @@ module ResqueWeb
3
3
  protect_from_forgery
4
4
  before_filter :set_subtabs, :authorize
5
5
 
6
+ helper :all
7
+
6
8
  def self.subtabs(*tab_names)
7
9
  return defined?(@subtabs) ? @subtabs : [] if tab_names.empty?
8
10
  @subtabs = tab_names
@@ -1,5 +1,9 @@
1
1
  module ResqueWeb
2
2
  class QueuesController < ApplicationController
3
+
4
+ def index
5
+ end
6
+
3
7
  def show
4
8
  set_subtabs view_context.queue_names
5
9
  end
@@ -8,5 +12,6 @@ module ResqueWeb
8
12
  Resque.remove_queue(params[:id])
9
13
  redirect_to queues_path
10
14
  end
15
+
11
16
  end
12
17
  end
@@ -3,14 +3,33 @@ module ResqueWeb
3
3
  subtabs :resque, :redis, :keys
4
4
 
5
5
  def index
6
- redirect_to :action => 'resque'
6
+ redirect_to action: "resque"
7
+ end
8
+
9
+ def resque
10
+ respond_to do |format|
11
+ format.html
12
+ format.json { render json: Hash[Resque.info.sort] }
13
+ end
14
+ end
15
+
16
+ def redis
17
+ respond_to do |format|
18
+ format.html
19
+ format.json { render json: Hash[Resque.redis.info.sort] }
20
+ end
7
21
  end
8
22
 
9
23
  def keys
10
- if params[:id]
11
- render 'key'
12
- else
13
- render 'keys'
24
+ respond_to do |format|
25
+ format.html do
26
+ if params[:id]
27
+ render 'key'
28
+ else
29
+ render 'keys'
30
+ end
31
+ end
32
+ format.json { render json: Resque.keys.sort }
14
33
  end
15
34
  end
16
35
  end
@@ -2,6 +2,9 @@ module ResqueWeb
2
2
  class WorkersController < ApplicationController
3
3
  before_filter :display_subtabs
4
4
 
5
+ def index
6
+ end
7
+
5
8
  def show
6
9
  if params[:id] && params[:id] != 'all'
7
10
  @workers = view_context.worker_hosts[params[:id]].map { |id| Resque::Worker.find(id) }
@@ -10,9 +13,11 @@ module ResqueWeb
10
13
  end
11
14
  end
12
15
 
16
+ private
17
+
13
18
  def display_subtabs
14
19
  set_subtabs view_context.worker_hosts.map(&:first)
15
20
  end
16
- private :display_subtabs
21
+
17
22
  end
18
23
  end
@@ -1,4 +1,8 @@
1
1
  module ResqueWeb
2
2
  class WorkingController < ApplicationController
3
+
4
+ def index
5
+ end
6
+
3
7
  end
4
8
  end
@@ -4,13 +4,17 @@ module ResqueWeb
4
4
  PER_PAGE = 20
5
5
 
6
6
  def tabs
7
- {'overview' => overview_path,
8
- 'working' => working_index_path,
9
- 'failures' => failures_path,
10
- 'queues' => queues_path,
11
- 'workers' => workers_path,
12
- 'stats' => stats_path
7
+ t = {'overview' => ResqueWeb::Engine.app.url_helpers.overview_path,
8
+ 'working' => ResqueWeb::Engine.app.url_helpers.working_index_path,
9
+ 'failures' => ResqueWeb::Engine.app.url_helpers.failures_path,
10
+ 'queues' => ResqueWeb::Engine.app.url_helpers.queues_path,
11
+ 'workers' => ResqueWeb::Engine.app.url_helpers.workers_path,
12
+ 'stats' => ResqueWeb::Engine.app.url_helpers.stats_path
13
13
  }
14
+ ResqueWeb::Plugins.plugins.each do |p|
15
+ p.tabs.each { |tab| t.merge!(tab) }
16
+ end
17
+ t
14
18
  end
15
19
 
16
20
  def tab(name,path)
@@ -16,6 +16,10 @@ module ResqueWeb
16
16
  multiple_failure_queues? ? params[:id] : 'failed'
17
17
  end
18
18
 
19
+ def failure_queue_name
20
+ @failure_queue_name ||= params[:queue] ? params[:queue] : 'Failed'
21
+ end
22
+
19
23
  def failure_size
20
24
  @failure_size ||= Resque::Failure.count(params[:id], params[:class])
21
25
  end
@@ -21,7 +21,7 @@
21
21
  <span class="icon-bar"></span>
22
22
  </a>
23
23
  <%= image_tag "resque_web/lifebuoy.png", class: 'logo' %>
24
- <%= link_to "Resque.", root_path, :class => "brand" %>
24
+ <%= link_to "Resque.", ResqueWeb::Engine.app.url_helpers.root_path, :class => "brand" %>
25
25
  <div class="nav-collapse collapse">
26
26
  <ul class="nav">
27
27
  <% tabs.each do |tab_name,path| %>
@@ -1,33 +1,32 @@
1
1
  <% if multiple_failure_queues? && !params[:queue] %>
2
- <h1>All Failure Queues</h1>
2
+ <h1>All Failure Queues</h1>
3
3
  <% else %>
4
- <h1>Failed Jobs <%= "on '#{params[:queue]}'" if params[:queue] %> <%= "with class '#{params[:class]}'" if params[:class] %></h1>
4
+ <h1>Failed Jobs <%= "on '#{params[:queue]}'" if params[:queue] %> <%= "with class '#{params[:class]}'" if params[:class] %></h1>
5
5
  <% end %>
6
6
 
7
7
  <% unless failure_size.zero? %>
8
- <%= form_tag(destroy_all_failures_path(:queue=>params[:queue]), :method => :delete) do %>
9
- <%= submit_tag "Clear #{params[:queue] ? "'#{params[:queue]}'" : 'Failed'} Jobs", data: { confirm: "Are you sure?" }, :class => 'btn btn-danger' %>
10
- <% if failure_size >ResqueWeb::ApplicationHelper::PER_PAGE %>
11
- <%= link_to "Last page &raquo;".html_safe, {:start => (failure_size - ResqueWeb::ApplicationHelper::PER_PAGE)}, :class => 'btn' %>
12
- <% end %>
8
+ <%= form_tag(destroy_all_failures_path(queue: params[:queue]), method: :delete) do %>
9
+ <%= submit_tag "Clear #{failure_queue_name} Jobs", class: 'btn btn-danger', data: { confirm: "Are you sure you want to clear ALL #{failure_queue_name.downcase} jobs?" } %>
10
+ <% if failure_size > failure_per_page %>
11
+ <%= link_to "Last page &raquo;".html_safe, { start: (failure_size - failure_per_page) }, class: 'btn' %>
12
+ <% end %>
13
13
  <% end %>
14
- <%= form_tag(retry_all_failures_path(:queue=>params[:queue]), :method => :put) do %>
15
- <%= submit_tag "Retry #{params[:queue] ? "'#{params[:queue]}'" : 'Failed'} Jobs", :class => 'btn' %>
14
+ <%= form_tag(retry_all_failures_path(queue: params[:queue]), method: :put) do %>
15
+ <%= submit_tag "Retry #{failure_queue_name} Jobs", class: 'btn', data: { confirm: "Are you sure you want to retry ALL #{failure_queue_name.downcase} jobs?" } %>
16
16
  <% end %>
17
17
  <% end %>
18
18
 
19
19
  <% if multiple_failure_queues? && !params[:queue] %>
20
- <p class="sub"><b><%= Resque::Failure.queues.size %></b> failure queues total</sub>
21
- <%= render :partial => 'overview' %>
20
+ <p class="sub"><b><%= Resque::Failure.queues.size %></b> failure queues total</sub>
21
+ <%= render partial: 'overview' %>
22
22
  <% else %>
23
- <p class="sub">Showing <%= failure_start_at %> to <%= failure_end_at %> of <b><%= failure_size %></b> jobs</p>
23
+ <p class="sub">Showing <%= failure_start_at %> to <%= failure_end_at %> of <b><%= failure_size %></b> jobs</p>
24
24
 
25
- <ul class="failed">
26
- <% each_failure do |id, job| %>
27
- <%= render :partial => 'failed_job', :locals => {:id => id, :job => job} %>
28
- <% end %>
29
- </ul>
30
-
31
- <%= pagination :start => failure_start_at, :total => failure_size unless params[:class] %>
25
+ <ul class="failed">
26
+ <% each_failure do |id, job| %>
27
+ <%= render partial: 'failed_job', locals: { id: id, job: job } %>
28
+ <% end %>
29
+ </ul>
32
30
 
31
+ <%= pagination(start: failure_start_at, total: failure_size) unless params[:class] %>
33
32
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <h1>Pending jobs on <span class='hl'><%= params[:id] %></span></h1>
2
2
 
3
3
  <%= form_tag(queue_path(params[:id]), :method => :delete, :class => 'remove-queue') do %>
4
- <%= submit_tag "Remove Queue", :confirm => "Are you absolutely sure? This cannot be undone.", :class => 'btn btn-danger' %>
4
+ <%= submit_tag "Remove Queue", :class => 'btn btn-danger', :data => { :confirm => "Are you absolutely sure? This cannot be undone." } %>
5
5
  <% end %>
6
6
 
7
7
  <p class="sub">Showing <%= queue_start_at %> to <%= queue_end_at %> of <b><%= queue_size %></b> jobs</p>
@@ -23,4 +23,4 @@
23
23
  <% end %>
24
24
  </table>
25
25
 
26
- <%= pagination :start => queue_start_at, :total => queue_size %>
26
+ <%= pagination :start => queue_start_at, :total => queue_size %>
@@ -9,11 +9,9 @@
9
9
  </tr>
10
10
  <% Resque.keys.sort.each do |key| %>
11
11
  <tr>
12
- <th>
13
- <%= link_to key, "/stats/keys/#{key}" %>
14
- </th>
12
+ <th><%= link_to key, statistic_path("keys", key) %></th>
15
13
  <td><%= redis_key_type key %></td>
16
14
  <td><%= redis_key_size key %></td>
17
15
  </tr>
18
16
  <% end %>
19
- </table>
17
+ </table>
data/config/routes.rb CHANGED
@@ -3,6 +3,10 @@ id_pattern = /[^\/]+/
3
3
 
4
4
  ResqueWeb::Engine.routes.draw do
5
5
 
6
+ ResqueWeb::Plugins.plugins.each do |p|
7
+ mount p::Engine => p.engine_path
8
+ end
9
+
6
10
  resource :overview, :only => [:show], :controller => :overview
7
11
  resources :working, :only => [:index]
8
12
  resources :queues, :only => [:index,:show,:destroy], :constraints => {:id => id_pattern}
@@ -19,7 +23,7 @@ ResqueWeb::Engine.routes.draw do
19
23
 
20
24
  get '/stats' => "stats#index"
21
25
  get '/stats/:action', :controller => :stats
22
- get '/stats/:action/:id', :controller => :stats, :constraints => {:id => id_pattern}
26
+ get '/stats/:action/:id', :controller => :stats, :constraints => {:id => id_pattern}, :as => :statistic
23
27
 
24
28
  root :to => 'overview#show'
25
29
 
@@ -5,4 +5,9 @@ module ResqueWeb
5
5
  class Engine < ::Rails::Engine
6
6
  isolate_namespace ResqueWeb
7
7
  end
8
+ module Plugins
9
+ def self.plugins
10
+ self.constants.map{|m| self.const_get(m)}
11
+ end
12
+ end
8
13
  end
@@ -1,3 +1,3 @@
1
1
  module ResqueWeb
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end