rocketjob_mission_control 5.0.1 → 6.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/config/manifest.js +3 -0
  4. data/app/assets/javascripts/rocket_job_mission_control/application.js +1 -1
  5. data/app/assets/javascripts/rocket_job_mission_control/nested_fields.js +112 -0
  6. data/app/assets/stylesheets/rocket_job_mission_control/{application.scss → application.css} +9 -8
  7. data/app/assets/stylesheets/rocket_job_mission_control/base.css +420 -0
  8. data/app/assets/stylesheets/rocket_job_mission_control/{callout.scss → callout.css} +50 -52
  9. data/app/assets/stylesheets/rocket_job_mission_control/jobs.css +57 -0
  10. data/app/assets/stylesheets/rocket_job_mission_control/worker_processes.css +7 -0
  11. data/app/controllers/rocket_job_mission_control/dirmon_entries_controller.rb +20 -20
  12. data/app/controllers/rocket_job_mission_control/jobs_controller.rb +44 -4
  13. data/app/datatables/rocket_job_mission_control/jobs_datatable.rb +1 -1
  14. data/app/helpers/rocket_job_mission_control/application_helper.rb +43 -26
  15. data/app/helpers/rocket_job_mission_control/dirmon_entries_helper.rb +8 -0
  16. data/app/helpers/rocket_job_mission_control/jobs_helper.rb +76 -8
  17. data/app/models/rocket_job_mission_control/dirmon_sanitizer.rb +68 -0
  18. data/app/models/rocket_job_mission_control/job_sanitizer.rb +35 -0
  19. data/app/views/rocket_job_mission_control/dirmon_entries/_form.html.erb +78 -42
  20. data/app/views/rocket_job_mission_control/dirmon_entries/_input_categories.html.erb +59 -0
  21. data/app/views/rocket_job_mission_control/dirmon_entries/_input_category_fields.html.erb +56 -0
  22. data/app/views/rocket_job_mission_control/dirmon_entries/_output_categories.html.erb +44 -0
  23. data/app/views/rocket_job_mission_control/dirmon_entries/_output_category_fields.html.erb +36 -0
  24. data/app/views/rocket_job_mission_control/dirmon_entries/_status.html.erb +22 -16
  25. data/app/views/rocket_job_mission_control/dirmon_entries/copy.html.erb +1 -1
  26. data/app/views/rocket_job_mission_control/dirmon_entries/edit.html.erb +7 -3
  27. data/app/views/rocket_job_mission_control/dirmon_entries/show.html.erb +2 -3
  28. data/app/views/rocket_job_mission_control/jobs/_attributes.html.erb +89 -0
  29. data/app/views/rocket_job_mission_control/jobs/_dates.html.erb +39 -0
  30. data/app/views/rocket_job_mission_control/jobs/_details.html.erb +86 -0
  31. data/app/views/rocket_job_mission_control/jobs/_exception.html.erb +33 -0
  32. data/app/views/rocket_job_mission_control/jobs/_input_categories.html.erb +126 -0
  33. data/app/views/rocket_job_mission_control/jobs/_input_category_fields.html.erb +56 -0
  34. data/app/views/rocket_job_mission_control/jobs/_output_categories.html.erb +60 -0
  35. data/app/views/rocket_job_mission_control/jobs/_output_category_fields.html.erb +36 -0
  36. data/app/views/rocket_job_mission_control/jobs/_retryable.html.erb +27 -0
  37. data/app/views/rocket_job_mission_control/jobs/_status.html.erb +21 -49
  38. data/app/views/rocket_job_mission_control/jobs/edit.html.erb +28 -0
  39. data/app/views/rocket_job_mission_control/jobs/exception.html.erb +1 -1
  40. data/app/views/rocket_job_mission_control/jobs/index.html.erb +24 -18
  41. data/app/views/rocket_job_mission_control/jobs/show.html.erb +32 -58
  42. data/app/views/rocket_job_mission_control/jobs/view_slice.html.erb +4 -4
  43. data/config/initializers/assets.rb +3 -4
  44. data/lib/rocket_job_mission_control/engine.rb +0 -1
  45. data/lib/rocket_job_mission_control/version.rb +1 -1
  46. data/test/controllers/rocket_job_mission_control/jobs_controller_test.rb +2 -1
  47. data/test/models/rocket_job_mission_control/dirmon_sanitizer_test.rb +146 -0
  48. data/test/test_helper.rb +5 -11
  49. data/vendor/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  50. data/vendor/assets/fonts/glyphicons-halflings-regular.svg +288 -0
  51. data/vendor/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  52. data/vendor/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  53. data/vendor/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  54. data/vendor/assets/stylesheets/bootstrap.min.css.erb +6 -0
  55. metadata +37 -29
  56. data/app/assets/stylesheets/rocket_job_mission_control/base.scss +0 -436
  57. data/app/assets/stylesheets/rocket_job_mission_control/bootstrap_and_overrides.scss +0 -488
  58. data/app/assets/stylesheets/rocket_job_mission_control/jobs.scss +0 -72
  59. data/app/assets/stylesheets/rocket_job_mission_control/worker_processes.scss +0 -9
  60. data/vendor/assets/stylesheets/bootstrap.min.css +0 -6
@@ -0,0 +1,56 @@
1
+ <% input_category = f.object %>
2
+
3
+ <div class="nested-fields">
4
+ <div class="panel panel-primary">
5
+ <div class="panel-heading">
6
+ <div class="row">
7
+ <div class="col-sm-12">
8
+ <h4><%= input_category.name %></h4>
9
+ </div>
10
+ </div>
11
+ </div>
12
+
13
+ <div class="panel-body">
14
+ <%= f.hidden_field :name, value: input_category.name %>
15
+
16
+ <div class="form-group">
17
+ <%= f.label :columns %>
18
+ <% options = input_category.columns || []%>
19
+ <%= f.select(:columns, options_for_select(options, options), { include_hidden: false }, { class: "selectize form-control", multiple: true }) %>
20
+ </div>
21
+
22
+ <div class="form-group">
23
+ <%= f.label :format %>
24
+ <% options = extract_inclusion_values(RocketJob::Category::Input, :format) %>
25
+ <% value = input_category.format %>
26
+ <%= f.select(:format, options, { include_blank: true, selected: value }, { class: "selectize form-control" }) %>
27
+ </div>
28
+
29
+ <div class="form-group">
30
+ <%= f.label :format_options %>
31
+ <% value = input_category.format_options %>
32
+ <%= f.text_field(:format_options, value: value ? value.to_json : nil, class: "form-control", placeholder: '{"key1":"value1", "key2":"value2", "key3":"value3"}') %>
33
+ </div>
34
+
35
+ <div class="form-group">
36
+ <%= f.label :mode %>
37
+ <% options = extract_inclusion_values(RocketJob::Category::Input, :mode) %>
38
+ <% value = input_category.mode %>
39
+ <%= f.select(:mode, options, { include_blank: true, selected: value }, { class: "selectize form-control" }) %>
40
+ </div>
41
+
42
+ <div class="form-group">
43
+ <%= f.label "Skip and Ignore Unknown Columns" %>
44
+ <% options = extract_inclusion_values(RocketJob::Category::Input, :skip_unknown) %>
45
+ <% value = input_category.skip_unknown %>
46
+ <%= f.select(:skip_unknown, options, { include_blank: true, selected: value }, { class: "selectize form-control" }) %>
47
+ </div>
48
+
49
+ <div class="form-group">
50
+ <%= f.label :slice_size %>
51
+ <% value = input_category.slice_size %>
52
+ <%= f.number_field(:slice_size, value: value, class: "form-control") %>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
@@ -0,0 +1,44 @@
1
+ <div class='lead'>Output Categories:</div>
2
+ <% @job.output_categories.each do |category| %>
3
+ <div class='row'>
4
+ <div class='col-md-12'>
5
+ <div class='status-message'><label><%= category.name.to_s.camelcase %>:</label></div>
6
+ <div class='row'>
7
+ <div class='col-md-12'>
8
+ <table>
9
+ <tr>
10
+ <td><label>Format:</label></td>
11
+ <td><%= category.format %></td>
12
+ </tr>
13
+ <% if category.format_options %>
14
+ <tr>
15
+ <td><label>Format Options:</label></td>
16
+ <td>
17
+ <pre><code><%= category.format_options.ai(plain: true, ruby19_syntax: true, sort_keys: true) %></code></pre>
18
+ </td>
19
+ </tr>
20
+ <% end %>
21
+ <% if category.columns %>
22
+ <% first = true %>
23
+ <% category.columns.each do |item| %>
24
+ <% if first %>
25
+ <tr>
26
+ <td><label>Columns:</label></td>
27
+ <td><%= item %></td>
28
+ </tr>
29
+ <% first = false %>
30
+ <% else %>
31
+ <tr>
32
+ <td></td>
33
+ <td><%= item %></td>
34
+ </tr>
35
+ <% end %>
36
+ <% end %>
37
+ <% end %>
38
+ </table>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <br/>
44
+ <% end %>
@@ -0,0 +1,36 @@
1
+ <% output_category = f.object %>
2
+
3
+ <div class="nested-fields">
4
+ <div class="panel panel-success">
5
+ <div class="panel-heading">
6
+ <div class="row">
7
+ <div class="col-sm-12">
8
+ <h4><%= output_category.name %></h4>
9
+ </div>
10
+ </div>
11
+ </div>
12
+
13
+ <div class="panel-body">
14
+ <%= f.hidden_field :name, value: output_category.name %>
15
+
16
+ <div class="form-group">
17
+ <%= f.label :columns %>
18
+ <% options = output_category.columns || [] %>
19
+ <%= f.select(:columns, options_for_select(options, options), { include_hidden: false }, { class: "selectize form-control", multiple: true }) %>
20
+ </div>
21
+
22
+ <div class="form-group">
23
+ <%= f.label :format %>
24
+ <% options = extract_inclusion_values(RocketJob::Category::Output, :format) %>
25
+ <% value = output_category.format %>
26
+ <%= f.select(:format, options, { include_blank: true, selected: value }, { class: "selectize form-control" }) %>
27
+ </div>
28
+
29
+ <div class="form-group">
30
+ <%= f.label :format_options %>
31
+ <% value = output_category.format_options %>
32
+ <%= f.text_field(:format_options, value: value ? value.to_json : nil, class: "form-control", placeholder: '{"key1":"value1", "key2":"value2", "key3":"value3"}') %>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
@@ -1,20 +1,26 @@
1
- <div><label>Name:</label><%= @dirmon_entry.name %></div>
2
- <div><label>Pattern:</label><%= @dirmon_entry.pattern %></div>
3
- <div><label>Job Class Name:</label><%= @dirmon_entry.job_class_name %></div>
4
- <div><label>Archive Directory:</label><%= @dirmon_entry.archive_directory %></div>
5
-
6
- </br>
1
+ <div class='row'>
2
+ <div class='col-md-12'>
3
+ <div><label>Job Class:</label><%= @dirmon_entry.job_class_name %></div>
4
+ <div><label>Pattern:</label><%= @dirmon_entry.pattern %></div>
5
+ <div><label>Archive Directory:</label><%= @dirmon_entry.archive_directory %></div>
6
+ <div class='id'><label>ID:</label><%= @dirmon_entry.id %></div>
7
+ </div>
8
+ </div>
7
9
 
8
- <% @dirmon_entry.properties.each_pair do |name, value| %>
9
- <div class='parameters'>
10
- <label><%= name.to_s.titleize %>:</label>
10
+ <div class='lead'>Properties</div>
11
+ <div class='row'>
12
+ <div class='col-md-12'>
13
+ <% @dirmon_entry.properties.keys.sort.each do |name| %>
14
+ <% value = @dirmon_entry.properties[name] %>
15
+ <div class='parameters'>
16
+ <label><%= name.to_s.titleize %>:</label>
11
17
 
12
- <% if value.is_a?(Array) || value.is_a?(Hash) %>
13
- <pre><code><%= pretty_print_array_or_hash(value) %></code></pre>
14
- <% else %>
15
- <%= value %>
18
+ <% if value.is_a?(Array) || value.is_a?(Hash) %>
19
+ <pre><code><%= pretty_print_array_or_hash(value) %></code></pre>
20
+ <% else %>
21
+ <%= value %>
22
+ <% end %>
23
+ </div>
16
24
  <% end %>
17
25
  </div>
18
- <% end %>
19
-
20
- <div class='id'><label>ID:</label><%= @dirmon_entry.id %></div>
26
+ </div>
@@ -1,4 +1,4 @@
1
1
  <div class='container-fluid'>
2
2
  <div class='lead'>Copy Dirmon Entry</div>
3
3
  <%= render partial: 'form', locals: { action: :replicate} %>
4
- </div>
4
+ </div>
@@ -1,5 +1,9 @@
1
- <div class='container-fluid'>
2
- <div class='lead'>Edit Dirmon Entry</div>
1
+ <div class="container-fluid">
2
+ <div class="row">
3
+ <div class="col-md-12">
4
+ <div class="lead">Edit Dirmon Entry</div>
5
+ </div>
6
+ </div>
3
7
 
4
- <%= render partial: 'form', locals: { action: :update } %>
8
+ <%= render partial: "form", locals: { action: :update } %>
5
9
  </div>
@@ -1,18 +1,17 @@
1
1
  <div class='col-md-12 job-status'>
2
2
  <div id='job'>
3
- <div class='lead'><%= @dirmon_entry.job_class_name %></div>
3
+ <div class='lead'><%= @dirmon_entry.name %></div>
4
4
 
5
5
  <div class='job-state inline-block'>
6
6
  <div class='left'>status</div>
7
7
  <div class="<%= @dirmon_entry.state %> right"><%= @dirmon_entry.state %></div>
8
8
  </div>
9
9
 
10
- <div class='btn-toolbar job-actions pull-right'>
10
+ <div class='btn-toolbar job-actions'>
11
11
  <div class='btn-group'>
12
12
  <% if (@dirmon_entry.disabled? || @dirmon_entry.pending?) && can?(:enable, @dirmon_entry) %>
13
13
  <%= link_to 'Enable', enable_dirmon_entry_path(@dirmon_entry.id), method: :put, class: 'btn btn-default' %>
14
14
  <% end %>
15
-
16
15
  <% if @dirmon_entry.enabled? && can?(:disable, @dirmon_entry)%>
17
16
  <%= link_to 'Disable', disable_dirmon_entry_path(@dirmon_entry.id), method: :put, class: 'btn btn-default', data: { confirm: 'Are you sure?' } %>
18
17
  <% end %>
@@ -0,0 +1,89 @@
1
+ <div class='lead'>Attributes:</div>
2
+ <div class='row'>
3
+ <div class='col-md-12'>
4
+ <table>
5
+ <% @attributes.each_pair do |key, value| %>
6
+ <% next if value.is_a?(Array) || value.is_a?(Hash) %>
7
+ <% key = key.to_s.titleize %>
8
+ <tr>
9
+ <td><label><%= key %>:</label></td>
10
+ <% if value.nil? %>
11
+ <td><label>nil</label></td>
12
+ <% else %>
13
+ <td><%= value %></td>
14
+ <% end %>
15
+ </tr>
16
+ <% end %>
17
+ <% @attributes.each_pair do |key, value| %>
18
+ <% next unless value.is_a?(Array) %>
19
+ <% key = key.to_s.titleize %>
20
+ <% if value.empty? %>
21
+ <tr>
22
+ <td><label><%= key %>:</label></td>
23
+ <td><label>[]</label></td>
24
+ </tr>
25
+ <% else %>
26
+ <% first = true %>
27
+ <% value.each do |item| %>
28
+ <% if first %>
29
+ <tr>
30
+ <td><label><%= key %>:</label></td>
31
+ <% if item.is_a?(Hash) || item.is_a?(Array) %>
32
+ <td>
33
+ <pre><code><%= pretty_print_array_or_hash(item) %></code></pre>
34
+ </td>
35
+ <% else %>
36
+ <td><%= item %></td>
37
+ <% end %>
38
+ </tr>
39
+ <% first = false %>
40
+ <% else %>
41
+ <tr>
42
+ <td></td>
43
+ <% if item.is_a?(Hash) || item.is_a?(Array) %>
44
+ <td>
45
+ <pre><code><%= pretty_print_array_or_hash(item) %></code></pre>
46
+ </td>
47
+ <% else %>
48
+ <td><%= item %></td>
49
+ <% end %>
50
+ </tr>
51
+ <% end %>
52
+ <% end %>
53
+ <% end %>
54
+ <% end %>
55
+ <% @attributes.each_pair do |key, value| %>
56
+ <% next unless value.is_a?(Hash) %>
57
+ <% key = key.to_s.titleize %>
58
+ <tr>
59
+ <th valign="top"><label><%= key %>:</label></th>
60
+ <td>
61
+ <% if value.empty? %>
62
+ <label>{}</label>
63
+ <% else %>
64
+ <div class='row'>
65
+ <div class='col-md-12'>
66
+ <table>
67
+ <% value.each_pair do |key2, value2| %>
68
+ <tr>
69
+ <td><label><%= key2.to_s.titleize %>:</label></td>
70
+ <% if value2.is_a?(Hash) || value2.is_a?(Array) %>
71
+ <td>
72
+ <pre><code><%= pretty_print_array_or_hash(value2) %></code></pre>
73
+ </td>
74
+ <% else %>
75
+ <td><%= value2 %></td>
76
+ <% end %>
77
+ </tr>
78
+ <% end %>
79
+ </table>
80
+ </div>
81
+ </div>
82
+ <% end %>
83
+ </td>
84
+ </tr>
85
+ <% end %>
86
+ </table>
87
+ </div>
88
+ </div>
89
+ <br/>
@@ -0,0 +1,39 @@
1
+ <div class='lead'>Dates:</div>
2
+ <div class='row'>
3
+ <div class='col-md-12'>
4
+ <table>
5
+ <tr>
6
+ <td><label>Created:</label></td>
7
+ <td><%= job_time(@job.created_at) %></td>
8
+ </tr>
9
+ <% if !@job.queued? %>
10
+ <tr>
11
+ <td><label><%= job_state_name(@job) %>:</label></td>
12
+ <td>
13
+ <%= job_state_time(@job) %>
14
+ <% unless @job.scheduled? %>
15
+ , <%= RocketJob.seconds_as_duration(Time.now - (@job.completed_at || @job.started_at || @job.created_at)) %> ago
16
+ <% end %>
17
+ </td>
18
+ </tr>
19
+ <% end %>
20
+ <% if @job.scheduled? %>
21
+ <tr>
22
+ <td><label>Run At:</label></td>
23
+ <td><%= job_time(@job.run_at) %></td>
24
+ </tr>
25
+ <tr>
26
+ <td><label>Runs In:</label></td>
27
+ <td><%= RocketJob.seconds_as_duration(@job.run_at - Time.now) %></td>
28
+ </tr>
29
+ <% end %>
30
+ <% if @job.expires_at %>
31
+ <tr>
32
+ <td><label>Expires At:</label></td>
33
+ <td><%= job_time(@job.expires_at) %></td>
34
+ </tr>
35
+ <% end %>
36
+ </table>
37
+ </div>
38
+ </div>
39
+ <br/>
@@ -0,0 +1,86 @@
1
+ <div class='lead'>Details:</div>
2
+ <div class='row'>
3
+ <div class='col-md-12 job-status'>
4
+ <table>
5
+ <tr>
6
+ <td><label>State:</label></td>
7
+ <td>
8
+ <div class='job-state inline-block'>
9
+ <div class='left'>State</div>
10
+ <div class="<%= job_state(@job) %> right"><%= job_state(@job) %></div>
11
+ </div>
12
+
13
+ <% if sub_state = @job['sub_state'] %>
14
+ <div class='job-state inline-block'>
15
+ <div class='left'>Batch</div>
16
+ <div class='running right'><%= @job.sub_state %></div>
17
+ </div>
18
+ <% end %>
19
+ </td>
20
+ </tr>
21
+ <% if @job.description %>
22
+ <tr>
23
+ <td><label>Description: </label></td>
24
+ <td><%= @job.description %></td>
25
+ </tr>
26
+ <% end %>
27
+ <% if @job.respond_to?(:cron_schedule) && @job.cron_schedule %>
28
+ <tr>
29
+ <td><label>Cron Schedule:</label></td>
30
+ <td><%= @job.cron_schedule %></td>
31
+ </tr>
32
+ <% end %>
33
+ <% if @job.respond_to?(:upload_file_name) && @job.upload_file_name %>
34
+ <tr>
35
+ <td><label>Upload File Name:</label></td>
36
+ <td><%= @job.upload_file_name %></td>
37
+ </tr>
38
+ <% end %>
39
+ <tr>
40
+ <td><label>Priority:</label></td>
41
+ <td><%= @job.priority %></td>
42
+ </tr>
43
+ <% if @job.failure_count.to_i > 0 %>
44
+ <tr>
45
+ <td><label>Failure Count:</label></td>
46
+ <td><%= @job.failure_count %></td>
47
+ </tr>
48
+ <% end %>
49
+ <% if @job.log_level %>
50
+ <tr>
51
+ <td><label>Log Level</label></td>
52
+ <td><%= @job.log_level %></td>
53
+ </tr>
54
+ <% end %>
55
+ <% if @job.respond_to?(:throttle_group) && @job.throttle_group %>
56
+ <tr>
57
+ <td><label>Throttle Group:</label></td>
58
+ <td><%= @job.throttle_group %></td>
59
+ </tr>
60
+ <% end %>
61
+ <% if @job.respond_to?(:throttle_running_workers) && @job.throttle_running_workers %>
62
+ <tr>
63
+ <td><label>Throttle Running Workers:</label></td>
64
+ <td><%= @job.throttle_running_workers %></td>
65
+ </tr>
66
+ <% end %>
67
+ <% if @job.worker_name %>
68
+ <tr>
69
+ <td><label>Worker Name:</label></td>
70
+ <td><%= @job.worker_name %></td>
71
+ </tr>
72
+ <% end %>
73
+ <% unless @job.completed? %>
74
+ <tr>
75
+ <td><label>Destroy on completion?</label></td>
76
+ <td><%= @job.destroy_on_complete %></td>
77
+ </tr>
78
+ <% end %>
79
+ <tr>
80
+ <td><label>ID:</label></td>
81
+ <td><%= @job.id %></td>
82
+ </tr>
83
+ </table>
84
+ </div>
85
+ </div>
86
+ <br/>
@@ -0,0 +1,33 @@
1
+ <div class='lead'>Exception:</div>
2
+ <div class='row'>
3
+ <div class='col-md-12'>
4
+ <table>
5
+ <tr>
6
+ <td><label>Exception:</label></td>
7
+ <td><%= @job.exception.class_name %></td>
8
+ </tr>
9
+ <tr>
10
+ <td><label>Message:</label></td>
11
+ <td><%= @job.exception.message %></td>
12
+ </tr>
13
+ <% if @job.exception.backtrace.present?
14
+ first = true %>
15
+ <% @job.exception.backtrace.each do |line| %>
16
+ <% if first %>
17
+ <tr>
18
+ <td><label>Backtrace:</label></td>
19
+ <td><%= line %></td>
20
+ </tr>
21
+ <% first = false %>
22
+ <% else %>
23
+ <tr>
24
+ <td></td>
25
+ <td><%= line %></td>
26
+ </tr>
27
+ <% end %>
28
+ <% end %>
29
+ <% end %>
30
+ </table>
31
+ </div>
32
+ </div>
33
+ <br/>