qless 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/bin/install_phantomjs +7 -0
  2. data/lib/qless.rb +4 -0
  3. data/lib/qless/job.rb +40 -38
  4. data/lib/qless/qless-core/cancel.lua +9 -9
  5. data/lib/qless/qless-core/failed.lua +1 -1
  6. data/lib/qless/qless-core/peek.lua +22 -12
  7. data/lib/qless/qless-core/pop.lua +31 -16
  8. data/lib/qless/qless-core/recur.lua +12 -3
  9. data/lib/qless/server.rb +96 -66
  10. data/lib/qless/server/static/css/bootstrap-responsive.css +686 -0
  11. data/lib/qless/server/static/css/bootstrap-responsive.min.css +12 -0
  12. data/lib/qless/server/static/css/bootstrap.css +3991 -0
  13. data/lib/qless/server/static/css/bootstrap.min.css +689 -0
  14. data/lib/qless/server/static/css/codemirror.css +112 -0
  15. data/lib/qless/server/static/css/docs.css +819 -0
  16. data/lib/qless/server/static/css/jquery.noty.css +105 -0
  17. data/lib/qless/server/static/css/noty_theme_twitter.css +137 -0
  18. data/lib/qless/server/static/css/style.css +204 -0
  19. data/lib/qless/server/static/favicon.ico +0 -0
  20. data/lib/qless/server/static/img/glyphicons-halflings-white.png +0 -0
  21. data/lib/qless/server/static/img/glyphicons-halflings.png +0 -0
  22. data/lib/qless/server/static/js/bootstrap-alert.js +94 -0
  23. data/lib/qless/server/static/js/bootstrap-scrollspy.js +125 -0
  24. data/lib/qless/server/static/js/bootstrap-tab.js +130 -0
  25. data/lib/qless/server/static/js/bootstrap-tooltip.js +270 -0
  26. data/lib/qless/server/static/js/bootstrap-typeahead.js +285 -0
  27. data/lib/qless/server/static/js/bootstrap.js +1726 -0
  28. data/lib/qless/server/static/js/bootstrap.min.js +6 -0
  29. data/lib/qless/server/static/js/codemirror.js +2972 -0
  30. data/lib/qless/server/static/js/jquery.noty.js +220 -0
  31. data/lib/qless/server/static/js/mode/javascript.js +360 -0
  32. data/lib/qless/server/static/js/theme/cobalt.css +18 -0
  33. data/lib/qless/server/static/js/theme/eclipse.css +25 -0
  34. data/lib/qless/server/static/js/theme/elegant.css +10 -0
  35. data/lib/qless/server/static/js/theme/lesser-dark.css +45 -0
  36. data/lib/qless/server/static/js/theme/monokai.css +28 -0
  37. data/lib/qless/server/static/js/theme/neat.css +9 -0
  38. data/lib/qless/server/static/js/theme/night.css +21 -0
  39. data/lib/qless/server/static/js/theme/rubyblue.css +21 -0
  40. data/lib/qless/server/static/js/theme/xq-dark.css +46 -0
  41. data/lib/qless/server/views/_job.erb +219 -0
  42. data/lib/qless/server/views/_job_list.erb +8 -0
  43. data/lib/qless/server/views/_pagination.erb +7 -0
  44. data/lib/qless/server/views/about.erb +130 -0
  45. data/lib/qless/server/views/config.erb +14 -0
  46. data/lib/qless/server/views/failed.erb +48 -0
  47. data/lib/qless/server/views/failed_type.erb +18 -0
  48. data/lib/qless/server/views/job.erb +17 -0
  49. data/lib/qless/server/views/layout.erb +341 -0
  50. data/lib/qless/server/views/overview.erb +90 -0
  51. data/lib/qless/server/views/queue.erb +122 -0
  52. data/lib/qless/server/views/queues.erb +26 -0
  53. data/lib/qless/server/views/tag.erb +6 -0
  54. data/lib/qless/server/views/track.erb +69 -0
  55. data/lib/qless/server/views/worker.erb +34 -0
  56. data/lib/qless/server/views/workers.erb +14 -0
  57. data/lib/qless/version.rb +1 -1
  58. data/lib/qless/worker.rb +11 -2
  59. metadata +72 -6
  60. data/lib/qless/qless-core/ruby/lib/qless-core.rb +0 -1
  61. data/lib/qless/qless-core/ruby/lib/qless/core.rb +0 -13
  62. data/lib/qless/qless-core/ruby/lib/qless/core/version.rb +0 -5
  63. data/lib/qless/qless-core/ruby/spec/qless_core_spec.rb +0 -13
@@ -0,0 +1,18 @@
1
+ .cm-s-cobalt { background: #002240; color: white; }
2
+ .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
3
+ .cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
4
+ .cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
5
+ .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
6
+
7
+ .cm-s-cobalt span.cm-comment { color: #08f; }
8
+ .cm-s-cobalt span.cm-atom { color: #845dc4; }
9
+ .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
10
+ .cm-s-cobalt span.cm-keyword { color: #ffee80; }
11
+ .cm-s-cobalt span.cm-string { color: #3ad900; }
12
+ .cm-s-cobalt span.cm-meta { color: #ff9d00; }
13
+ .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
14
+ .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
15
+ .cm-s-cobalt span.cm-error { color: #9d1e15; }
16
+ .cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
17
+ .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
18
+ .cm-s-cobalt span.cm-link { color: #845dc4; }
@@ -0,0 +1,25 @@
1
+ .cm-s-eclipse span.cm-meta {color: #FF1717;}
2
+ .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
3
+ .cm-s-eclipse span.cm-atom {color: #219;}
4
+ .cm-s-eclipse span.cm-number {color: #164;}
5
+ .cm-s-eclipse span.cm-def {color: #00f;}
6
+ .cm-s-eclipse span.cm-variable {color: black;}
7
+ .cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
8
+ .cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
9
+ .cm-s-eclipse span.cm-property {color: black;}
10
+ .cm-s-eclipse span.cm-operator {color: black;}
11
+ .cm-s-eclipse span.cm-comment {color: #3F7F5F;}
12
+ .cm-s-eclipse span.cm-string {color: #2A00FF;}
13
+ .cm-s-eclipse span.cm-string-2 {color: #f50;}
14
+ .cm-s-eclipse span.cm-error {color: #f00;}
15
+ .cm-s-eclipse span.cm-qualifier {color: #555;}
16
+ .cm-s-eclipse span.cm-builtin {color: #30a;}
17
+ .cm-s-eclipse span.cm-bracket {color: #cc7;}
18
+ .cm-s-eclipse span.cm-tag {color: #170;}
19
+ .cm-s-eclipse span.cm-attribute {color: #00c;}
20
+ .cm-s-eclipse span.cm-link {color: #219;}
21
+
22
+ .cm-s-eclipse .CodeMirror-matchingbracket {
23
+ border:1px solid grey;
24
+ color:black !important;;
25
+ }
@@ -0,0 +1,10 @@
1
+ .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
2
+ .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
3
+ .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
4
+ .cm-s-elegant span.cm-variable {color: black;}
5
+ .cm-s-elegant span.cm-variable-2 {color: #b11;}
6
+ .cm-s-elegant span.cm-qualifier {color: #555;}
7
+ .cm-s-elegant span.cm-keyword {color: #730;}
8
+ .cm-s-elegant span.cm-builtin {color: #30a;}
9
+ .cm-s-elegant span.cm-error {background-color: #fdd;}
10
+ .cm-s-elegant span.cm-link {color: #762;}
@@ -0,0 +1,45 @@
1
+ /*
2
+ http://lesscss.org/ dark theme
3
+ Ported to CodeMirror by Peter Kroon
4
+ */
5
+ .CodeMirror{
6
+ line-height: 15px;
7
+ }
8
+ .cm-s-lesser-dark {
9
+ font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important;
10
+ font-size:12px;
11
+ }
12
+
13
+ .cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
14
+ .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
15
+ .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
16
+ .cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/
17
+
18
+ div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/
19
+
20
+ .cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; }
21
+ .cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; }
22
+
23
+ .cm-s-lesser-dark span.cm-keyword { color: #599eff; }
24
+ .cm-s-lesser-dark span.cm-atom { color: #C2B470; }
25
+ .cm-s-lesser-dark span.cm-number { color: #B35E4D; }
26
+ .cm-s-lesser-dark span.cm-def {color: color: white;}
27
+ .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; }
28
+ .cm-s-lesser-dark span.cm-variable-2 { color: #669199; }
29
+ .cm-s-lesser-dark span.cm-variable-3 { color: white; }
30
+ .cm-s-lesser-dark span.cm-property {color: #92A75C;}
31
+ .cm-s-lesser-dark span.cm-operator {color: #92A75C;}
32
+ .cm-s-lesser-dark span.cm-comment { color: #666; }
33
+ .cm-s-lesser-dark span.cm-string { color: #BCD279; }
34
+ .cm-s-lesser-dark span.cm-string-2 {color: #f50;}
35
+ .cm-s-lesser-dark span.cm-meta { color: #738C73; }
36
+ .cm-s-lesser-dark span.cm-error { color: #9d1e15; }
37
+ .cm-s-lesser-dark span.cm-qualifier {color: #555;}
38
+ .cm-s-lesser-dark span.cm-builtin { color: #ff9e59; }
39
+ .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }
40
+ .cm-s-lesser-dark span.cm-tag { color: #669199; }
41
+ .cm-s-lesser-dark span.cm-attribute {color: #00c;}
42
+ .cm-s-lesser-dark span.cm-header {color: #a0a;}
43
+ .cm-s-lesser-dark span.cm-quote {color: #090;}
44
+ .cm-s-lesser-dark span.cm-hr {color: #999;}
45
+ .cm-s-lesser-dark span.cm-link {color: #00c;}
@@ -0,0 +1,28 @@
1
+ /* Based on Sublime Text's Monokai theme */
2
+
3
+ .cm-s-monokai {background: #272822; color: #f8f8f2;}
4
+ .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
5
+ .cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;}
6
+ .cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
7
+ .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
8
+
9
+ .cm-s-monokai span.cm-comment {color: #75715e;}
10
+ .cm-s-monokai span.cm-atom {color: #ae81ff;}
11
+ .cm-s-monokai span.cm-number {color: #ae81ff;}
12
+
13
+ .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
14
+ .cm-s-monokai span.cm-keyword {color: #f92672;}
15
+ .cm-s-monokai span.cm-string {color: #e6db74;}
16
+
17
+ .cm-s-monokai span.cm-variable {color: #a6e22e;}
18
+ .cm-s-monokai span.cm-variable-2 {color: #9effff;}
19
+ .cm-s-monokai span.cm-def {color: #fd971f;}
20
+ .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
21
+ .cm-s-monokai span.cm-bracket {color: #f8f8f2;}
22
+ .cm-s-monokai span.cm-tag {color: #f92672;}
23
+ .cm-s-monokai span.cm-link {color: #ae81ff;}
24
+
25
+ .cm-s-monokai .CodeMirror-matchingbracket {
26
+ text-decoration: underline;
27
+ color: white !important;
28
+ }
@@ -0,0 +1,9 @@
1
+ .cm-s-neat span.cm-comment { color: #a86; }
2
+ .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; }
3
+ .cm-s-neat span.cm-string { color: #a22; }
4
+ .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; }
5
+ .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; }
6
+ .cm-s-neat span.cm-variable { color: black; }
7
+ .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
8
+ .cm-s-neat span.cm-meta {color: #555;}
9
+ .cm-s-neat span.cm-link { color: #3a3; }
@@ -0,0 +1,21 @@
1
+ /* Loosely based on the Midnight Textmate theme */
2
+
3
+ .cm-s-night { background: #0a001f; color: #f8f8f8; }
4
+ .cm-s-night div.CodeMirror-selected { background: #a8f !important; }
5
+ .cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
6
+ .cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
7
+ .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
8
+
9
+ .cm-s-night span.cm-comment { color: #6900a1; }
10
+ .cm-s-night span.cm-atom { color: #845dc4; }
11
+ .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
12
+ .cm-s-night span.cm-keyword { color: #599eff; }
13
+ .cm-s-night span.cm-string { color: #37f14a; }
14
+ .cm-s-night span.cm-meta { color: #7678e2; }
15
+ .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
16
+ .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
17
+ .cm-s-night span.cm-error { color: #9d1e15; }
18
+ .cm-s-night span.cm-bracket { color: #8da6ce; }
19
+ .cm-s-night span.cm-comment { color: #6900a1; }
20
+ .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
21
+ .cm-s-night span.cm-link { color: #845dc4; }
@@ -0,0 +1,21 @@
1
+ .cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
2
+
3
+ .cm-s-rubyblue { background: #112435; color: white; }
4
+ .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
5
+ .cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; }
6
+ .cm-s-rubyblue .CodeMirror-gutter-text { color: white; }
7
+ .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
8
+
9
+ .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }
10
+ .cm-s-rubyblue span.cm-atom { color: #F4C20B; }
11
+ .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }
12
+ .cm-s-rubyblue span.cm-keyword { color: #F0F; }
13
+ .cm-s-rubyblue span.cm-string { color: #F08047; }
14
+ .cm-s-rubyblue span.cm-meta { color: #F0F; }
15
+ .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
16
+ .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
17
+ .cm-s-rubyblue span.cm-error { color: #AF2018; }
18
+ .cm-s-rubyblue span.cm-bracket { color: #F0F; }
19
+ .cm-s-rubyblue span.cm-link { color: #F4C20B; }
20
+ .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
21
+ .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
@@ -0,0 +1,46 @@
1
+ /*
2
+ Copyright (C) 2011 by MarkLogic Corporation
3
+ Author: Mike Brevoort <mike@brevoort.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+ */
23
+ .cm-s-xq-dark { background: #0a001f; color: #f8f8f8; }
24
+ .cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
25
+ .cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
26
+ .cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; }
27
+ .cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
28
+
29
+ .cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
30
+ .cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
31
+ .cm-s-xq-dark span.cm-number {color: #164;}
32
+ .cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
33
+ .cm-s-xq-dark span.cm-variable {color: #FFF;}
34
+ .cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
35
+ .cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
36
+ .cm-s-xq-dark span.cm-property {}
37
+ .cm-s-xq-dark span.cm-operator {}
38
+ .cm-s-xq-dark span.cm-comment {color: gray;}
39
+ .cm-s-xq-dark span.cm-string {color: #9FEE00;}
40
+ .cm-s-xq-dark span.cm-meta {color: yellow;}
41
+ .cm-s-xq-dark span.cm-error {color: #f00;}
42
+ .cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
43
+ .cm-s-xq-dark span.cm-builtin {color: #30a;}
44
+ .cm-s-xq-dark span.cm-bracket {color: #cc7;}
45
+ .cm-s-xq-dark span.cm-tag {color: #FFBD40;}
46
+ .cm-s-xq-dark span.cm-attribute {color: #FFF700;}
@@ -0,0 +1,219 @@
1
+ <% if job.instance_of?(Qless::Job) %>
2
+ <div class="row" id="job-<%= job.jid %>">
3
+ <div class="span12">
4
+ <div class="row">
5
+ <div class="span6">
6
+ <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden">
7
+ <a href="<%= u "/jobs/#{job.jid}" %>"><%= job.jid[0..8] %>...</a> | <%= job.klass_name %>
8
+ </h2>
9
+ </div>
10
+ <div class="span3">
11
+ <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden">
12
+ <strong>
13
+ | <%= job.state %> / <a href="<%= u "/queues/#{job.queue_name}" %>"><%= job.queue_name %></a><%= job.worker_name.nil? ? "/ #{job.worker_name}" : "" %>
14
+ </strong>
15
+ </h2>
16
+ </div>
17
+ <div class="span3">
18
+ <div style="float:right; margin-top: 4px">
19
+ <div class="btn-group">
20
+ <% if (job.state != "complete") %>
21
+ <button title="delete" class="btn btn-danger" onclick="confirmation(this, 'Delete?', function() { cancel('<%= job.jid %>', fade) })"><i class="icon-remove"></i></button>
22
+ <% end %>
23
+ <button title="track" class="btn<%= job.tracked ? " active" : "" %>" data-toggle="button" onclick="$(this).hasClass('active') ? untrack('<%= job.jid %>', fade) : track('<%= job.jid %>', [], fade)"><i class="icon-flag"></i></button>
24
+ <% if (job.state == 'failed') %>
25
+ <button title="retry" class="btn btn-success" onclick="retry('<%= job.jid %>', fade)"><i class="icon-repeat"></i></button>
26
+ <% end %>
27
+ <button title="move" class="btn dropdown-toggle btn-success" data-toggle="dropdown">
28
+ <i class="caret"></i>
29
+ </button>
30
+ <ul class="dropdown-menu">
31
+ <% queues.each do |queue| %>
32
+ <a href="#" onclick="move('<%= job.jid %>', '<%= queue['name'] %>', fade)"><%= queue['name'] %></a>
33
+ <% end %>
34
+ </ul>
35
+ </div>
36
+ </div>
37
+ <div style="float:right; margin-right: 12px; margin-top: 4px">
38
+ <div class="btn-group">
39
+ <input class="span1 priority" type="text" placeholder="Pri <%= job.priority %>" onchange="priority('<%= job.jid %>', $(this).val())"></input>
40
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
41
+ <i class="caret"></i>
42
+ </button>
43
+ <ul class="dropdown-menu">
44
+ <a href="#" onclick="priority('<%= job.jid %>', 25)">high</a>
45
+ <a href="#" onclick="priority('<%= job.jid %>', 0 )">normal</a>
46
+ <a href="#" onclick="priority('<%= job.jid %>', -25)">low</a>
47
+ </ul>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+
53
+ <% if not job.dependencies.empty? %>
54
+ <div class="row">
55
+ <div class="span12" style="margin-bottom: 10px">
56
+ <div style="float:left; margin-right: 10px"><h3>Dependencies:</h3></div>
57
+ <% job.dependencies.each do |jid| %>
58
+ <div class="btn-group" style="float:left; margin-right: 10px" id="<%= sanitize_attr("#{job.jid}-dependson-#{jid}") %>">
59
+ <button class="btn" onclick="window.open('<%= u "/jobs/#{jid}" %>', '_blank')"><%= jid[0...8] %>...</button>
60
+ <button class="btn dropdown-toggle" onclick="confirmation(this, 'Undepend?', function() { undepend('<%= job.jid %>', '<%= jid %>', function() { $('#<%= sanitize_attr("#{job.jid}-dependson-#{jid}") %>').remove()} ); })">
61
+ <i class="icon-remove"></i>
62
+ </button>
63
+ </div>
64
+ <% end %>
65
+ </div>
66
+ </div>
67
+ <% end %>
68
+
69
+ <% if not job.dependents.empty? %>
70
+ <div class="row">
71
+ <div class="span12" style="margin-bottom: 10px">
72
+ <div style="float:left; margin-right: 10px"><h3>Dependents:</h3></div>
73
+ <% job.dependents.each do |jid| %>
74
+ <div class="btn-group" style="float:left; margin-right: 10px" id="<%= sanitize_attr("#{job.jid}-dependents-#{jid}") %>">
75
+ <button class="btn" onclick="window.open('<%= u "/jobs/#{jid}" %>', '_blank')"><%= jid[0...8] %>...</button>
76
+ <button class="btn dropdown-toggle" onclick="confirmation(this, 'Undepend?', function() { undepend('<%= jid %>', '<%= job.jid %>', function() { $('#<%= sanitize_attr("#{job.jid}-dependents-#{jid}") %>').remove()} ); })">
77
+ <i class="icon-remove"></i>
78
+ </button>
79
+ </div>
80
+ <% end %>
81
+ </div>
82
+ </div>
83
+ <% end %>
84
+
85
+ <div class="row">
86
+ <div class="span12 tags" style="margin-bottom: 3px;">
87
+ <% job.tags.each do |tag| %>
88
+ <div class="btn-group" style="float:left">
89
+ <span class="tag"><%= tag %></span>
90
+ <button class="btn" onclick="untag('<%= job.jid %>', '<%= tag %>')">
91
+ <i class="icon-remove"></i>
92
+ </button>
93
+ </div>
94
+ <% end %>
95
+
96
+ <!-- One for adding new tags -->
97
+ <div class="btn-group" style="float:left">
98
+ <input class="span1 add-tag" type="text" placeholder="Add Tag" onchange="tag('<%= job.jid %>', $(this).val())"></input>
99
+ <button class="btn" onclick="tag('<%= job.jid %>', $(this).parent().siblings().val())">
100
+ <i class="icon-plus"></i>
101
+ </button>
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <% if not defined? brief %>
107
+ <div class="row">
108
+ <div class="span6">
109
+ <h3><small>Data</small></h3>
110
+ <pre style="overflow-y:scroll; height: 200px"><%= JSON.pretty_generate(job.data) %></pre>
111
+ </div>
112
+ <div class="span6">
113
+ <h3><small>History</small></h3>
114
+ <div style="overflow-y:scroll; height: 200px">
115
+ <% job.history.reverse.each do |h| %>
116
+ <pre><strong><%= h['q'] %></strong>
117
+ Put: <%= strftime(Time.at(h['put'])) %><% if not h['popped'].nil? %>
118
+ Pop: <%= strftime(Time.at(h['popped'])) %> by <%= h['worker'] %><% end %><% if not h['completed'].nil? %>
119
+ Completed: <%= strftime(Time.at(h['completed'])) %><% end %><% if not h['failed'].nil? %>
120
+ Failed: <%= strftime(Time.at(h['failed'])) %><% end %></pre>
121
+ <% end %>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ <% end %>
126
+
127
+ <% if job.failure.length > 0 %>
128
+ <div class="row">
129
+ <div class="span12">
130
+ <div class="alert alert-error">
131
+ <p>In <strong><%= job.queue_name %></strong> on <strong><%= job.failure['worker'] %></strong>
132
+ about <%= strftime(Time.at(job.failure['when'])) %></p>
133
+ <pre><%= job.failure['message'].gsub('>', '&gt;').gsub('<', '&lt;') %></pre>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ <% end %>
138
+ <hr/>
139
+ </div>
140
+ </div>
141
+ <% else # Recurring job %>
142
+ <div class="row" id="job-<%= job.jid %>">
143
+ <div class="span12">
144
+ <div class="row">
145
+ <div class="span6">
146
+ <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden">
147
+ <a href="<%= u "/jobs/#{job.jid}" %>"><%= job.jid[0..8] %>...</a> | <%= job.klass_name %>
148
+ </h2>
149
+ </div>
150
+ <div class="span3">
151
+ <h2 style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden">
152
+ <strong>
153
+ | recurring / <a href="<%= u "/queues/#{job.queue_name}" %>"><%= job.queue_name %></a>
154
+ </strong>
155
+ </h2>
156
+ </div>
157
+ <div class="span3">
158
+ <div style="float:right; margin-top: 4px">
159
+ <div class="btn-group">
160
+ <button title="delete" class="btn btn-danger" onclick="confirmation(this, 'Delete?', function() { cancel('<%= job.jid %>', fade) })"><i class="icon-remove"></i></button>
161
+ <button title="move" class="btn dropdown-toggle btn-success" data-toggle="dropdown">
162
+ <i class="caret"></i>
163
+ </button>
164
+ <ul class="dropdown-menu">
165
+ <% queues.each do |queue| %>
166
+ <a href="#" onclick="move('<%= job.jid %>', '<%= queue['name'] %>', fade)"><%= queue['name'] %></a>
167
+ <% end %>
168
+ </ul>
169
+ </div>
170
+ </div>
171
+ <div style="float:right; margin-right: 12px; margin-top: 4px">
172
+ <div class="btn-group">
173
+ <input class="span1 priority" type="text" placeholder="Pri <%= job.priority %>" onchange="priority('<%= job.jid %>', $(this).val())"></input>
174
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
175
+ <i class="caret"></i>
176
+ </button>
177
+ <ul class="dropdown-menu">
178
+ <a href="#" onclick="priority('<%= job.jid %>', 25)">high</a>
179
+ <a href="#" onclick="priority('<%= job.jid %>', 0 )">normal</a>
180
+ <a href="#" onclick="priority('<%= job.jid %>', -25)">low</a>
181
+ </ul>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <div class="row">
188
+ <div class="span12 tags" style="margin-bottom: 3px;">
189
+ <% job.tags.each do |tag| %>
190
+ <div class="btn-group" style="float:left">
191
+ <span class="tag"><%= tag %></span>
192
+ <button class="btn" onclick="untag('<%= job.jid %>', '<%= tag %>')">
193
+ <i class="icon-remove"></i>
194
+ </button>
195
+ </div>
196
+ <% end %>
197
+
198
+ <!-- One for adding new tags -->
199
+ <div class="btn-group" style="float:left">
200
+ <input class="span1 add-tag" type="text" placeholder="Add Tag" onchange="tag('<%= job.jid %>', $(this).val())"></input>
201
+ <button class="btn" onclick="tag('<%= job.jid %>', $(this).parent().siblings().val())">
202
+ <i class="icon-plus"></i>
203
+ </button>
204
+ </div>
205
+ </div>
206
+ </div>
207
+
208
+ <% if not defined? brief %>
209
+ <div class="row">
210
+ <div class="span12">
211
+ <h3><small>Data</small></h3>
212
+ <pre style="overflow-y:scroll; height: 200px"><%= JSON.pretty_generate(job.data) %></pre>
213
+ </div>
214
+ </div>
215
+ <% end %>
216
+ <hr/>
217
+ </div>
218
+ </div>
219
+ <% end %>