dj_mon 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -10
- data/app/assets/stylesheets/dj_mon.css +4 -0
- data/app/controllers/dj_mon/dj_reports_controller.rb +13 -1
- data/app/models/dj_mon/dj_report.rb +2 -1
- data/app/views/dj_mon/dj_reports/index.html.haml +15 -4
- data/app/views/layouts/dj_mon.html.haml +5 -0
- data/config/routes.rb +4 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
A Rails engine based frontend for Delayed Job.
|
4
4
|
|
5
|
+
## Demo
|
6
|
+
* [Demo URL](http://dj-mon-demo.herokuapp.com/)
|
7
|
+
* Username: `dj_mon`
|
8
|
+
* Password: `password`
|
9
|
+
* [Demo Source](https://github.com/akshayrawat/dj_mon_demo)
|
10
|
+
|
11
|
+
|
5
12
|
## Installation
|
6
13
|
|
7
14
|
Add this line to your application's Gemfile:
|
@@ -37,20 +44,12 @@ This uses http basic auth for authentication. Set the credentials in an initiali
|
|
37
44
|
If the credentials are not set, then the username and password are assumed to be the above mentioned.
|
38
45
|
|
39
46
|
Now visit `http://localhost:3000/dj_mon` and profit!
|
40
|
-
|
47
|
+
|
41
48
|
## Demo
|
42
49
|
* Source [DJ Mon](https://github.com/akshayrawat/dj_mon)
|
43
50
|
* URL: [Demo](http://dj-mon-demo.herokuapp.com/)
|
44
51
|
* Username: `dj_mon`
|
45
|
-
* Password: `password`
|
46
|
-
|
47
|
-
|
48
|
-
## ROADMAP
|
49
|
-
* Delete failed or queued jobs
|
50
|
-
* Restart failed jobs
|
51
|
-
* Filter by queue.
|
52
|
-
* `rake` tasks to know job status from command line.
|
53
|
-
|
52
|
+
* Password: `password`
|
54
53
|
|
55
54
|
## Contributing
|
56
55
|
|
@@ -31,7 +31,19 @@ module DjMon
|
|
31
31
|
def settings
|
32
32
|
respond_with DjReport.settings
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
|
+
def retry
|
36
|
+
dj = Delayed::Job.find(params[:id])
|
37
|
+
dj.update_attribute :failed_at, nil if dj
|
38
|
+
redirect_to root_url, notice: "The job was been queued for a re-run" and return
|
39
|
+
end
|
40
|
+
|
41
|
+
def destroy
|
42
|
+
dj = Delayed::Job.find(params[:id])
|
43
|
+
dj.destroy if dj
|
44
|
+
redirect_to root_url, notice: "The job was deleted" and return
|
45
|
+
end
|
46
|
+
|
35
47
|
protected
|
36
48
|
|
37
49
|
def authenticate
|
@@ -18,7 +18,8 @@ module DjMon
|
|
18
18
|
last_error: delayed_job.last_error,
|
19
19
|
failed_at: l_datetime(delayed_job.failed_at),
|
20
20
|
run_at: l_datetime(delayed_job.run_at),
|
21
|
-
created_at: l_datetime(delayed_job.created_at)
|
21
|
+
created_at: l_datetime(delayed_job.created_at),
|
22
|
+
failed: delayed_job.failed_at.present?
|
22
23
|
}
|
23
24
|
end
|
24
25
|
|
@@ -29,12 +29,13 @@
|
|
29
29
|
Attempts
|
30
30
|
%th
|
31
31
|
Last Error
|
32
|
-
%th.date
|
33
|
-
Failed at
|
34
32
|
%th.date
|
35
33
|
Run at
|
36
34
|
%th.date
|
37
35
|
Created at
|
36
|
+
%th.date
|
37
|
+
Failed at
|
38
|
+
|
38
39
|
%tbody
|
39
40
|
{{#.}}
|
40
41
|
%tr
|
@@ -49,12 +50,22 @@
|
|
49
50
|
{{attempts}}
|
50
51
|
%td
|
51
52
|
<a href="#last_error_template" data-content="{{last_error}}" rel='modal' title='Last Error'> {{last_error_summary}} </a>
|
52
|
-
%td.date
|
53
|
-
{{failed_at}}
|
54
53
|
%td.date
|
55
54
|
{{run_at}}
|
56
55
|
%td.date
|
57
56
|
{{created_at}}
|
57
|
+
%td.date
|
58
|
+
{{#failed}}
|
59
|
+
{{failed_at}}
|
60
|
+
|
61
|
+
= form_tag '/dj_mon/dj_reports/{{id}}/retry', method: :post, class: 'form-inline' do
|
62
|
+
= submit_tag 'Retry', class: 'btn btn-info btn-mini'
|
63
|
+
|
64
|
+
= form_tag '/dj_mon/dj_reports/{{id}}', method: :delete, class: 'form-inline' do
|
65
|
+
= submit_tag 'Delete', class: 'btn btn-danger btn-mini'
|
66
|
+
|
67
|
+
{{/failed}}
|
68
|
+
|
58
69
|
{{/.}}
|
59
70
|
|
60
71
|
%script#last_error_template{ :type=> "text/x-handlebars-template" }
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
DjMon::Engine.routes.draw do
|
2
2
|
|
3
|
-
resources :dj_reports
|
3
|
+
resources :dj_reports do
|
4
4
|
collection do
|
5
5
|
get :all
|
6
6
|
get :failed
|
@@ -9,6 +9,9 @@ DjMon::Engine.routes.draw do
|
|
9
9
|
get :dj_counts
|
10
10
|
get :settings
|
11
11
|
end
|
12
|
+
member do
|
13
|
+
post :retry
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
root :to => 'dj_reports#index'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dj_mon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|