rocketjob_mission_control 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/rocket_job_mission_control/datatable.js.coffee +2 -0
- data/app/assets/stylesheets/rocket_job_mission_control/base.scss +19 -7
- data/app/controllers/rocket_job_mission_control/dirmon_entries_controller.rb +1 -3
- data/app/controllers/rocket_job_mission_control/jobs/index_filters_controller.rb +7 -7
- data/app/controllers/rocket_job_mission_control/jobs_controller.rb +1 -0
- data/app/datatables/rocket_job_mission_control/jobs_datatable.rb +4 -2
- data/app/datatables/rocket_job_mission_control/workers_datatable.rb +1 -1
- data/app/interactors/rocket_job_mission_control/dirmon_entries/search.rb +1 -1
- data/app/interactors/rocket_job_mission_control/jobs/search.rb +1 -1
- data/app/interactors/rocket_job_mission_control/workers/search.rb +1 -1
- data/app/models/job_sanitizer.rb +17 -0
- data/app/views/layouts/rocket_job_mission_control/application.html.haml +1 -1
- data/app/views/layouts/rocket_job_mission_control/partials/_header.html.haml +1 -1
- data/app/views/rocket_job_mission_control/jobs/edit.html.haml +5 -5
- data/app/views/rocket_job_mission_control/jobs/show.html.haml +4 -3
- data/app/views/rocket_job_mission_control/workers/index.html.haml +1 -1
- data/app/views/rocket_job_mission_control/workers/index_filters/paused.html.haml +2 -2
- data/app/views/rocket_job_mission_control/workers/index_filters/running.html.haml +2 -2
- data/app/views/rocket_job_mission_control/workers/index_filters/starting.html.haml +2 -2
- data/app/views/rocket_job_mission_control/workers/index_filters/stopping.html.haml +2 -2
- data/config/locales/en.yml +10 -10
- data/lib/rocket_job_mission_control/version.rb +1 -1
- data/spec/controllers/dirmon_entries/index_filters_controller_spec.rb +15 -10
- data/spec/controllers/jobs/index_filters_controller_spec.rb +2 -1
- data/spec/controllers/jobs_controller_spec.rb +8 -1
- data/spec/controllers/workers/index_filters_controller_spec.rb +1 -1
- data/spec/dummy/Rakefile +2 -1
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +4 -3
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/test.rb +20 -22
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/routes.rb +2 -3
- data/spec/dummy/{public/favicon.ico → db/test.sqlite3} +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +29861 -2625
- data/spec/interactors/jobs/search_spec.rb +35 -0
- data/spec/models/job_sanitizer_spec.rb +16 -0
- data/spec/rails_helper.rb +1 -3
- metadata +13 -44
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/config/environments/development.rb +0 -34
- data/spec/dummy/config/initializers/assets.rb +0 -8
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/locales/en.yml +0 -23
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7962e3b8e27b8b98e946fedd53bfba833a92769f
|
4
|
+
data.tar.gz: 6bf9aa56d4c51a47c459b0f13c33c604161f3b1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fba1711a8c000adf050fe6dbf840c7aaa70ae189276696bc41edc615280572f7019242633d6b46d99d8e6a95f4c01ebc483b717bf793cac4bde91166ac49f405
|
7
|
+
data.tar.gz: a1f334a2c43f79a67b0b3b98c417957518ac862107b02287c129577fbb31173195ece72303fb78e8678e56b6f468d82ad0c624a7e6a6b8159a6a5796e0753f52
|
@@ -4,6 +4,7 @@ class @RjmcDatatable
|
|
4
4
|
@columns = columns
|
5
5
|
@ordering = opts.ordering ? true
|
6
6
|
@searching = opts.searching ? true
|
7
|
+
@pageLength = opts.pageLength ? 100
|
7
8
|
@order = opts.order ? []
|
8
9
|
@reload = $("[data-behavior='reload']")
|
9
10
|
@initializeTable()
|
@@ -12,6 +13,7 @@ class @RjmcDatatable
|
|
12
13
|
initializeTable: ->
|
13
14
|
@data = @table.DataTable
|
14
15
|
pagingType: 'full_numbers'
|
16
|
+
pageLength: @pageLength
|
15
17
|
responsive: true
|
16
18
|
ajax: @table.data('source')
|
17
19
|
processing: true
|
@@ -31,17 +31,29 @@ table.datatable {
|
|
31
31
|
margin: 1em 0;
|
32
32
|
}
|
33
33
|
|
34
|
+
table.dataTable thead .sorting:after {
|
35
|
+
content: "\f0c9";
|
36
|
+
}
|
37
|
+
|
34
38
|
table.dataTable thead .sorting_asc:after {
|
35
|
-
content: "\
|
39
|
+
content: "\f160";
|
40
|
+
}
|
41
|
+
|
42
|
+
table.dataTable thead .sorting_desc:after {
|
43
|
+
content: "\f161";
|
36
44
|
}
|
37
45
|
|
38
46
|
table.dataTable thead .sorting:after, table.dataTable thead .sorting_asc:after, table.dataTable thead .sorting_desc:after {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
47
|
+
position: absolute;
|
48
|
+
top: 8px;
|
49
|
+
left: 8px;
|
50
|
+
display: block;
|
51
|
+
// display: inline-block;
|
52
|
+
font: normal normal normal 14px/1 FontAwesome;
|
53
|
+
font-size: inherit;
|
54
|
+
text-rendering: auto;
|
55
|
+
-webkit-font-smoothing: antialiased;
|
56
|
+
-moz-osx-font-smoothing: grayscale;
|
45
57
|
}
|
46
58
|
|
47
59
|
table.dataTable thead > tr > th {
|
@@ -161,9 +161,7 @@ module RocketJobMissionControl
|
|
161
161
|
def dirmon_params
|
162
162
|
params
|
163
163
|
.fetch(:rocket_job_dirmon_entry, {})
|
164
|
-
.permit(:name, :archive_directory, :pattern, :job_class_name)
|
165
|
-
whitelist[:properties] = params[:rocket_job_dirmon_entry][:properties] if params.fetch(:rocket_job_dirmon_entry, {})[:properties]
|
166
|
-
end
|
164
|
+
.permit(:name, :archive_directory, :pattern, :job_class_name)
|
167
165
|
end
|
168
166
|
end
|
169
167
|
end
|
@@ -4,7 +4,7 @@ module RocketJobMissionControl
|
|
4
4
|
before_filter :show_sidebar
|
5
5
|
|
6
6
|
def running
|
7
|
-
@jobs = RocketJob::Job.where(state: :running).sort(
|
7
|
+
@jobs = RocketJob::Job.where(state: :running).sort(started_at: :desc)
|
8
8
|
respond_to do |format|
|
9
9
|
format.html
|
10
10
|
format.json { render(json: RunningJobsDatatable.new(view_context, @jobs)) }
|
@@ -12,7 +12,7 @@ module RocketJobMissionControl
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def paused
|
15
|
-
@jobs = RocketJob::Job.where(state: :paused).sort(
|
15
|
+
@jobs = RocketJob::Job.where(state: :paused).sort(completed_at: :desc)
|
16
16
|
respond_to do |format|
|
17
17
|
format.html
|
18
18
|
format.json { render(json: InterruptedJobsDatatable.new(view_context, @jobs)) }
|
@@ -20,7 +20,7 @@ module RocketJobMissionControl
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def completed
|
23
|
-
@jobs = RocketJob::Job.where(state: :completed).sort(
|
23
|
+
@jobs = RocketJob::Job.where(state: :completed).sort(completed_at: :desc)
|
24
24
|
respond_to do |format|
|
25
25
|
format.html
|
26
26
|
format.json { render(json: CompletedJobsDatatable.new(view_context, @jobs)) }
|
@@ -28,7 +28,7 @@ module RocketJobMissionControl
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def aborted
|
31
|
-
@jobs = RocketJob::Job.where(state: :aborted).sort(
|
31
|
+
@jobs = RocketJob::Job.where(state: :aborted).sort(completed_at: :desc)
|
32
32
|
respond_to do |format|
|
33
33
|
format.html
|
34
34
|
format.json { render(json: InterruptedJobsDatatable.new(view_context, @jobs)) }
|
@@ -36,7 +36,7 @@ module RocketJobMissionControl
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def failed
|
39
|
-
@jobs = RocketJob::Job.where(state: :failed).sort(
|
39
|
+
@jobs = RocketJob::Job.where(state: :failed).sort(completed_at: :desc)
|
40
40
|
respond_to do |format|
|
41
41
|
format.html
|
42
42
|
format.json { render(json: InterruptedJobsDatatable.new(view_context, @jobs)) }
|
@@ -44,7 +44,7 @@ module RocketJobMissionControl
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def queued
|
47
|
-
@jobs = RocketJob::Job.queued_now.sort(
|
47
|
+
@jobs = RocketJob::Job.queued_now.sort(created_at: :desc)
|
48
48
|
respond_to do |format|
|
49
49
|
format.html
|
50
50
|
format.json { render(json: QueuedJobsDatatable.new(view_context, @jobs)) }
|
@@ -52,7 +52,7 @@ module RocketJobMissionControl
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def scheduled
|
55
|
-
@jobs = RocketJob::Job.scheduled.sort(
|
55
|
+
@jobs = RocketJob::Job.scheduled.sort(run_at: :asc)
|
56
56
|
respond_to do |format|
|
57
57
|
format.html
|
58
58
|
format.json { render(json: ScheduledJobsDatatable.new(view_context, @jobs)) }
|
@@ -62,7 +62,9 @@ module RocketJobMissionControl
|
|
62
62
|
def action_buttons(job)
|
63
63
|
events = valid_events(job)
|
64
64
|
buttons = "<div class='inline-job-actions'>"
|
65
|
-
|
65
|
+
unless job.completed? || job.aborted?
|
66
|
+
buttons += "#{ link_to( 'Edit', edit_job_path(job), class: 'btn btn-default', title: 'Edit job') }"
|
67
|
+
end
|
66
68
|
if job.scheduled?
|
67
69
|
buttons += "#{ job_action_link('Run', run_now_job_path(job), :patch) }"
|
68
70
|
end
|
@@ -85,7 +87,7 @@ module RocketJobMissionControl
|
|
85
87
|
buttons += "#{ job_action_link('Retry', retry_job_path(job), :patch) }"
|
86
88
|
end
|
87
89
|
if job.respond_to?(:input) && job.input.failed_count > 0
|
88
|
-
buttons += "#{ link_to('
|
90
|
+
buttons += "#{ link_to('View Errors', job_failures_path(job), class: 'btn btn-default') }"
|
89
91
|
end
|
90
92
|
buttons += "</div>"
|
91
93
|
end
|
@@ -80,7 +80,7 @@ module RocketJobMissionControl
|
|
80
80
|
|
81
81
|
def filter_records(records)
|
82
82
|
return records unless (params[:search].present? && params[:search][:value].present?)
|
83
|
-
conditions = params[:search][:value]
|
83
|
+
conditions = params[:search][:value]
|
84
84
|
records = RocketJobMissionControl::Workers::Search.new(conditions, records).execute if conditions
|
85
85
|
records
|
86
86
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class JobSanitizer
|
2
|
+
attr_reader :params
|
3
|
+
|
4
|
+
def initialize(params)
|
5
|
+
@params = params
|
6
|
+
end
|
7
|
+
|
8
|
+
def sanitize
|
9
|
+
sanitize_log_level
|
10
|
+
params
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
def sanitize_log_level
|
15
|
+
params[:job][:log_level] = nil if params[:job][:log_level].blank?
|
16
|
+
end
|
17
|
+
end
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
= csrf_meta_tag
|
20
20
|
|
21
|
-
%link{href: "
|
21
|
+
%link{href: "https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css", rel: "stylesheet"}/
|
22
22
|
|
23
23
|
%body.rocket_job
|
24
24
|
#wrapper
|
@@ -18,15 +18,15 @@
|
|
18
18
|
= f.number_field :priority, value: @job.priority, class: 'form-control'
|
19
19
|
.col-md-4
|
20
20
|
= f.label :log_level
|
21
|
-
= f.select :log_level, ['
|
22
|
-
- if @job.
|
21
|
+
= f.select :log_level, ['trace', 'debug', 'info', 'warn', 'error', 'fatal'], { include_blank: true }, { class: 'form-control' }
|
22
|
+
- if @job.respond_to?(:max_active_workers)
|
23
23
|
.col-md-4
|
24
24
|
= f.label :max_active_workers
|
25
|
-
= f.number_field :max_active_workers, class: 'form-control'
|
26
|
-
- if @job.
|
25
|
+
= f.number_field :max_active_workers, value: @job.max_active_workers, min: 0, class: 'form-control'
|
26
|
+
- if @job.respond_to?(:cron_schedule)
|
27
27
|
.col-md-4
|
28
28
|
= f.label :cron_schedule
|
29
|
-
= f.text_field :cron_schedule, class: 'form-control'
|
29
|
+
= f.text_field :cron_schedule, value: @job.cron_schedule, class: 'form-control'
|
30
30
|
.row
|
31
31
|
.col-md-12
|
32
32
|
.buttons
|
@@ -30,9 +30,10 @@
|
|
30
30
|
= job_action_link('Retry', rocket_job_mission_control.retry_job_path(@job), :patch)
|
31
31
|
|
32
32
|
- if @job.respond_to?(:input) && @job.input.failed_count > 0
|
33
|
-
= link_to('
|
34
|
-
.
|
35
|
-
|
33
|
+
= link_to('View Errors', job_failures_path(@job), class: 'btn btn-default')
|
34
|
+
- unless @job.completed? || @job.aborted?
|
35
|
+
.btn-group
|
36
|
+
= link_to "Edit", edit_job_path(@job), class: "btn btn-default"
|
36
37
|
|
37
38
|
.col-md-12
|
38
39
|
= render partial: 'status', locals: { job: @job }
|
@@ -3,7 +3,7 @@
|
|
3
3
|
.list
|
4
4
|
.row
|
5
5
|
.col-md-6
|
6
|
-
%h2 Paused
|
6
|
+
%h2 Paused Servers
|
7
7
|
.col-md-6
|
8
8
|
.col-sm-10
|
9
9
|
.worker-collection-actions
|
@@ -33,5 +33,5 @@
|
|
33
33
|
jQuery(function() {
|
34
34
|
new RjmcDatatable(
|
35
35
|
$('.workers-datatable'),
|
36
|
-
[{data: '0'}, {data: '1', orderable: false}, {data: '2'
|
36
|
+
[{data: '0'}, {data: '1', orderable: false}, {data: '2'}, {data: '3'}, {data: '4', orderable: false}]);
|
37
37
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
.list
|
4
4
|
.row
|
5
5
|
.col-md-6
|
6
|
-
%h2 Running
|
6
|
+
%h2 Running Servers
|
7
7
|
.col-md-6
|
8
8
|
.col-sm-10
|
9
9
|
.worker-collection-actions
|
@@ -33,5 +33,5 @@
|
|
33
33
|
jQuery(function() {
|
34
34
|
new RjmcDatatable(
|
35
35
|
$('.workers-datatable'),
|
36
|
-
[{data: '0'}, {data: '1', orderable: false}, {data: '2'
|
36
|
+
[{data: '0'}, {data: '1', orderable: false}, {data: '2'}, {data: '3'}, {data: '4', orderable: false}]);
|
37
37
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
.list
|
4
4
|
.row
|
5
5
|
.col-md-6
|
6
|
-
%h2 Starting
|
6
|
+
%h2 Starting Servers
|
7
7
|
.col-md-6
|
8
8
|
.col-sm-10
|
9
9
|
.worker-collection-actions
|
@@ -33,5 +33,5 @@
|
|
33
33
|
jQuery(function() {
|
34
34
|
new RjmcDatatable(
|
35
35
|
$('.workers-datatable'),
|
36
|
-
[{data: '0'}, {data: '1', orderable: false}, {data: '2'
|
36
|
+
[{data: '0'}, {data: '1', orderable: false}, {data: '2'}, {data: '3'}, {data: '4', orderable: false}]);
|
37
37
|
});
|
@@ -3,7 +3,7 @@
|
|
3
3
|
.list
|
4
4
|
.row
|
5
5
|
.col-md-6
|
6
|
-
%h2 Stopping
|
6
|
+
%h2 Stopping Servers
|
7
7
|
.col-md-6
|
8
8
|
.col-sm-10
|
9
9
|
.worker-collection-actions
|
@@ -33,5 +33,5 @@
|
|
33
33
|
jQuery(function() {
|
34
34
|
new RjmcDatatable(
|
35
35
|
$('.workers-datatable'),
|
36
|
-
[{data: '0'}, {data: '1', orderable: false}, {data: '2'
|
36
|
+
[{data: '0'}, {data: '1', orderable: false}, {data: '2'}, {data: '3'}, {data: '4', orderable: false}]);
|
37
37
|
});
|
data/config/locales/en.yml
CHANGED
@@ -38,21 +38,21 @@ en:
|
|
38
38
|
other: "%{count} years" # default was: "almost %{count} years"
|
39
39
|
worker:
|
40
40
|
stop:
|
41
|
-
success: "
|
42
|
-
failure: "Error attempting to stop
|
41
|
+
success: "Server successfully stopped."
|
42
|
+
failure: "Error attempting to stop server."
|
43
43
|
destroy:
|
44
|
-
success: "
|
45
|
-
failure: "Error attempting to destroy
|
44
|
+
success: "Server successfully destroyed."
|
45
|
+
failure: "Error attempting to destroy server."
|
46
46
|
pause:
|
47
|
-
success: "
|
48
|
-
failure: "Error attempting to pause
|
47
|
+
success: "Server successfully paused."
|
48
|
+
failure: "Error attempting to pause server."
|
49
49
|
resume:
|
50
|
-
success: "
|
51
|
-
failure: "Error attempting to resume
|
50
|
+
success: "Server successfully resumed."
|
51
|
+
failure: "Error attempting to resume server."
|
52
52
|
update_all:
|
53
|
-
success: "
|
53
|
+
success: "Servers have been %{worker_action}."
|
54
54
|
invalid: "Action not allowed."
|
55
|
-
confirm: "Are you sure you want to %{action}
|
55
|
+
confirm: "Are you sure you want to %{action} servers?"
|
56
56
|
job:
|
57
57
|
find:
|
58
58
|
failure: "Could not find job with id: %{id}!"
|
@@ -35,23 +35,28 @@ module RocketJobMissionControl
|
|
35
35
|
|
36
36
|
describe "with #{state} dirmons" do
|
37
37
|
let(:not_state) { states[i-1] }
|
38
|
-
let!(:state_dirmon) {
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
let!(:state_dirmon) {
|
39
|
+
RocketJob::DirmonEntry.create!(
|
40
|
+
state: state,
|
41
|
+
pattern: '21',
|
42
|
+
arguments: ['42'],
|
43
|
+
job_class_name: 'AJob'
|
44
|
+
)
|
45
|
+
}
|
42
46
|
|
43
47
|
before do
|
44
48
|
RocketJob::DirmonEntry.create!(
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
49
|
+
name: 'Test',
|
50
|
+
state: not_state,
|
51
|
+
arguments: ['42'],
|
52
|
+
pattern: '21',
|
53
|
+
job_class_name: 'AJob'
|
54
|
+
)
|
50
55
|
get state.to_sym
|
51
56
|
end
|
52
57
|
|
53
58
|
after do
|
54
|
-
|
59
|
+
RocketJob::DirmonEntry.delete_all
|
55
60
|
end
|
56
61
|
|
57
62
|
it "succeeds" do
|