que-web 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5d0822590ed95eae50f53e560a7bb684fc88327
4
- data.tar.gz: bace56f4a38d819d5b6a54253ba637e8f14660bc
3
+ metadata.gz: e462dea7156e236045867d2dc8738e060f62517d
4
+ data.tar.gz: 8d01b77c484316f7b34a4dff2f0c61d432fbe92e
5
5
  SHA512:
6
- metadata.gz: 9ce5decd963f58bb67363dadd7faaf4cace6a6f552c0f842e76e0ea6e27288a50cd1e012f47d7b6df5e9560b1ec39b760b5175351b015da01fa87fce8791115c
7
- data.tar.gz: c10020a7a740268d5352fca93f93fa2cfa579135e4424224918ca74f56f5a1bb5e59c221c4480b51ec62bacec24e6d501ecc70f05ac405e0cd2f133a28d3a78d
6
+ metadata.gz: dcb503d51659fcded547811282f5bee869312fc17a2006bcb36da240fcea46fb1c6de959832620c4d17b2154d8f427cb9c5d4ae1e1ea2263561551a938fbd2ed
7
+ data.tar.gz: b8a3383ffec238ec16c63a07d7a78f02b306ed12482c45eba53c8a3bd564efb95a6db50c143c496b4f22a115edda3d729fbc982a3ec7db094d4558bc0d706655
@@ -1,3 +1,12 @@
1
+ ### 0.4.0 - 2015-04-09
2
+ #### Added:
3
+ - Indicate when a job is past due #2
4
+
5
+ #### Fixed:
6
+ - Fix clipping of pagination buttons #11
7
+ - Turn time string into time object #13
8
+
9
+
1
10
  ### 0.3.2 - 2014-12-05
2
11
  #### Fixed:
3
12
  - Fix escaping on pagination controls #10
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014, Jason Staten
1
+ Copyright (c) 2014 - 2015, Jason Staten
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # que-web ![Travis](https://travis-ci.org/statianzo/que-web.svg)
1
+ # que-web [![Build Status](https://travis-ci.org/statianzo/que-web.svg?branch=master)](https://travis-ci.org/statianzo/que-web)
2
2
 
3
3
  que-web is a web UI to the [Que](https://github.com/chanks/que) job queue.
4
4
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- que-web (0.3.1)
4
+ que-web (0.3.2)
5
5
  erubis
6
6
  que (~> 0.8)
7
7
  sinatra
@@ -10,12 +10,12 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  erubis (2.7.0)
13
- pg (0.17.1)
14
- que (0.8.2)
15
- rack (1.5.2)
13
+ pg (0.18.1)
14
+ que (0.9.1)
15
+ rack (1.6.0)
16
16
  rack-protection (1.5.3)
17
17
  rack
18
- sequel (4.16.0)
18
+ sequel (4.19.0)
19
19
  sinatra (1.4.5)
20
20
  rack (~> 1.4)
21
21
  rack-protection (~> 1.4)
@@ -109,6 +109,9 @@ module Que
109
109
  end
110
110
 
111
111
  def relative_time(time)
112
+ if time.is_a?(String)
113
+ time = Time.parse(time)
114
+ end
112
115
  %{<time class="timeago" datetime="#{time.utc.iso8601}">#{time.utc}</time>}
113
116
  end
114
117
 
@@ -10,5 +10,9 @@ module Que::Web::Viewmodels
10
10
  self[m] = job[m.to_s]
11
11
  end
12
12
  end
13
+
14
+ def past_due?(relative_to = Time.now)
15
+ run_at < relative_to
16
+ end
13
17
  end
14
18
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "que-web"
7
- spec.version = "0.3.2"
7
+ spec.version = "0.4.0"
8
8
  spec.authors = ["Jason Staten"]
9
9
  spec.email = ["jstaten07@gmail.com"]
10
10
  spec.summary = %q{A web interface for the que queue}
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Que::Web::Viewmodels::Job do
4
4
  let(:source_job) {
5
- {"priority"=>100, "run_at"=> Time.now,
5
+ {"priority"=>100, "run_at"=> Time.now - 3600,
6
6
  "job_id"=>555, "job_class"=>"SuccessJob",
7
7
  "args"=>["arg1", {"name"=>"foo", "age"=>10}],
8
8
  "error_count"=>0,
@@ -16,4 +16,15 @@ describe Que::Web::Viewmodels::Job do
16
16
  subject.priority.must_equal source_job["priority"]
17
17
  subject.queue.must_equal source_job["queue"]
18
18
  end
19
+
20
+ describe 'schedule' do
21
+ it 'is past due when run_at is behind' do
22
+ subject.must_be :past_due?
23
+ end
24
+
25
+ it 'is not past due when run_at is ahead of now' do
26
+ subject.run_at = Time.now + 3600
27
+ subject.wont_be :past_due?
28
+ end
29
+ end
19
30
  end
@@ -60,3 +60,14 @@ pre {
60
60
  white-space: pre-wrap;
61
61
  word-wrap: break-word;
62
62
  }
63
+
64
+ .version li {
65
+ padding: 0 15px;
66
+ line-height: 45px;
67
+ color: #999999;
68
+ font-size: 0.8125rem;
69
+ }
70
+
71
+ i.subtle {
72
+ color: #999999;
73
+ }
@@ -10,5 +10,9 @@
10
10
  <li class="<%= active_class('scheduled') %>"><a href="<%= to 'scheduled' %>"><span>Scheduled</span></a></li>
11
11
  <li class="<%= active_class('failing') %>"><a href="<%= to 'failing' %>"><span>Failing</span></a></li>
12
12
  </ul>
13
+ <ul class="right version">
14
+ <li>Que <%= Que::Version %></li>
15
+ <li><%= Time.now.utc.strftime("%D %H:%M:%S %Z") %></li>
16
+ </ul>
13
17
  </section>
14
18
  </nav>
@@ -0,0 +1,5 @@
1
+ <% if job.past_due? %>
2
+ <span title="Job is past due">
3
+ <i class="fa fa-clock-o subtle"></i>
4
+ </span>
5
+ <% end %>
@@ -21,7 +21,10 @@
21
21
  <tbody>
22
22
  <% @list.page_jobs.each do |job| %>
23
23
  <tr>
24
- <td><a href="<%= to "jobs/#{job.job_id}" %>"><%== relative_time job.run_at %></a></td>
24
+ <td><a href="<%= to "jobs/#{job.job_id}" %>">
25
+ <%== relative_time job.run_at %></a>
26
+ <%== erb :_past_due, locals: {job: job} %>
27
+ </td>
25
28
  <td><%= job.error_count %></td>
26
29
  <td><%= job.job_class %></td>
27
30
  <td><%= job.queue %></td>
@@ -10,7 +10,6 @@
10
10
  <%== erb :_navbar %>
11
11
  <%== erb :_flash %>
12
12
  <%== yield %>
13
- <%== erb :_footer %>
14
13
  <script src="<%= root_path %>js/jquery.min.js"></script>
15
14
  <script src="<%= root_path %>js/jquery.timeago.min.js"></script>
16
15
  <script>
@@ -19,7 +19,10 @@
19
19
  <tbody>
20
20
  <% @list.page_jobs.each do |job| %>
21
21
  <tr>
22
- <td><a href="<%= to "jobs/#{job.job_id}" %>"><%== relative_time job.run_at %></a></td>
22
+ <td>
23
+ <a href="<%= to "jobs/#{job.job_id}" %>"><%== relative_time job.run_at %></a>
24
+ <%== erb :_past_due, locals: {job: job}%>
25
+ </td>
23
26
  <td><%= job.job_class %></td>
24
27
  <td><%= job.queue %></td>
25
28
  <td><pre><%= format_args job %></pre></td>
@@ -21,7 +21,10 @@
21
21
  </tr>
22
22
  <tr>
23
23
  <th>Run At</th>
24
- <td><%== relative_time @job.run_at %></td>
24
+ <td>
25
+ <%== relative_time @job.run_at %>
26
+ <%== erb :_past_due, locals: {job: @job} %>
27
+ </td>
25
28
  </tr>
26
29
  <tr>
27
30
  <th>Failures</th>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: que-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Staten
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: que
@@ -147,9 +147,9 @@ files:
147
147
  - web/public/styles/foundation.min.css
148
148
  - web/public/styles/normalize.css
149
149
  - web/views/_flash.erb
150
- - web/views/_footer.erb
151
150
  - web/views/_navbar.erb
152
151
  - web/views/_pager.erb
152
+ - web/views/_past_due.erb
153
153
  - web/views/failing.erb
154
154
  - web/views/index.erb
155
155
  - web/views/layout.erb
@@ -1,10 +0,0 @@
1
- <footer class="footer">
2
- <div class="row">
3
- <div class="small-12 columns">
4
- <ul class="right inline-list">
5
- <li>Que <%= Que::Version %></li>
6
- <li><%= Time.now.utc.strftime("%D %H:%M:%S %Z") %></li>
7
- </ul>
8
- </div>
9
- </div>
10
- </footer>