rocketjob_mission_control 3.0.0.rc1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +10 -6
  3. data/app/assets/javascripts/rocket_job_mission_control/application.js +4 -3
  4. data/app/assets/javascripts/rocket_job_mission_control/base.js +12 -0
  5. data/app/assets/javascripts/rocket_job_mission_control/datatable.js +40 -0
  6. data/app/assets/javascripts/rocket_job_mission_control/dirmon_entries.js +16 -0
  7. data/app/assets/javascripts/rocket_job_mission_control/selectize.js +6 -0
  8. data/app/controllers/rocket_job_mission_control/active_workers_controller.rb +16 -5
  9. data/app/controllers/rocket_job_mission_control/application_controller.rb +2 -0
  10. data/app/controllers/rocket_job_mission_control/dirmon_entries_controller.rb +47 -67
  11. data/app/controllers/rocket_job_mission_control/jobs_controller.rb +113 -19
  12. data/app/controllers/rocket_job_mission_control/servers_controller.rb +71 -28
  13. data/app/datatables/rocket_job_mission_control/abstract_datatable.rb +3 -3
  14. data/app/datatables/rocket_job_mission_control/active_workers_datatable.rb +8 -14
  15. data/app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb +7 -15
  16. data/app/datatables/rocket_job_mission_control/jobs_datatable.rb +128 -13
  17. data/app/datatables/rocket_job_mission_control/servers_datatable.rb +13 -15
  18. data/app/helpers/rocket_job_mission_control/application_helper.rb +58 -0
  19. data/app/helpers/rocket_job_mission_control/jobs_helper.rb +15 -7
  20. data/app/helpers/rocket_job_mission_control/servers_helper.rb +1 -1
  21. data/app/models/rocket_job_mission_control/job_sanitizer.rb +47 -0
  22. data/app/models/rocket_job_mission_control/query.rb +24 -18
  23. data/app/views/layouts/rocket_job_mission_control/application.html.erb +43 -0
  24. data/app/views/layouts/rocket_job_mission_control/partials/_flash.html.erb +20 -0
  25. data/app/views/layouts/rocket_job_mission_control/partials/_header.html.erb +45 -0
  26. data/app/views/layouts/rocket_job_mission_control/partials/_sidebar.html.erb +12 -0
  27. data/app/views/rocket_job_mission_control/active_workers/index.html.erb +40 -0
  28. data/app/views/rocket_job_mission_control/dirmon_entries/_form.html.erb +60 -0
  29. data/app/views/rocket_job_mission_control/dirmon_entries/_sidebar.html.erb +38 -0
  30. data/app/views/rocket_job_mission_control/dirmon_entries/_status.html.erb +17 -0
  31. data/app/views/rocket_job_mission_control/dirmon_entries/edit.html.erb +4 -0
  32. data/app/views/rocket_job_mission_control/dirmon_entries/index.html.erb +33 -0
  33. data/app/views/rocket_job_mission_control/dirmon_entries/new.html.erb +8 -0
  34. data/app/views/rocket_job_mission_control/dirmon_entries/show.html.erb +29 -0
  35. data/app/views/rocket_job_mission_control/jobs/_pagination.html.erb +26 -0
  36. data/app/views/rocket_job_mission_control/jobs/_sidebar.html.erb +32 -0
  37. data/app/views/rocket_job_mission_control/jobs/_status.html.erb +42 -0
  38. data/app/views/rocket_job_mission_control/jobs/edit.html.erb +32 -0
  39. data/app/views/rocket_job_mission_control/jobs/exception.html.erb +19 -0
  40. data/app/views/rocket_job_mission_control/jobs/exceptions.html.erb +40 -0
  41. data/app/views/rocket_job_mission_control/jobs/index.html.erb +33 -0
  42. data/app/views/rocket_job_mission_control/jobs/show.html.erb +68 -0
  43. data/app/views/rocket_job_mission_control/servers/_sidebar.html.erb +31 -0
  44. data/app/views/rocket_job_mission_control/servers/index.html.erb +56 -0
  45. data/config/locales/en.yml +3 -10
  46. data/config/routes.rb +20 -17
  47. data/lib/rocket_job_mission_control/engine.rb +10 -0
  48. data/lib/rocket_job_mission_control/version.rb +1 -1
  49. data/test/compare_hashes.rb +17 -0
  50. data/test/controllers/rocket_job_mission_control/application_controller_test.rb +49 -0
  51. data/test/controllers/rocket_job_mission_control/dirmon_entries_controller_test.rb +417 -0
  52. data/test/controllers/rocket_job_mission_control/jobs_controller_test.rb +363 -0
  53. data/test/controllers/rocket_job_mission_control/servers_controller_test.rb +251 -0
  54. data/test/helpers/rocket_job_mission_control/application_helper_test.rb +54 -0
  55. data/test/helpers/rocket_job_mission_control/jobs_helper_test.rb +85 -0
  56. data/test/helpers/rocket_job_mission_control/pagination_helper_test.rb +23 -0
  57. data/test/helpers/rocket_job_mission_control/servers_helper_test.rb +64 -0
  58. data/test/helpers/rocket_job_mission_control/slices_helper_test.rb +30 -0
  59. data/test/models/rocket_job_mission_control/job_sanitizer_test.rb +92 -0
  60. data/test/models/rocket_job_mission_control/query_test.rb +136 -0
  61. data/test/test_helper.rb +23 -0
  62. metadata +75 -175
  63. data/app/assets/javascripts/rocket_job_mission_control/base.js.coffee +0 -11
  64. data/app/assets/javascripts/rocket_job_mission_control/datatable.js.coffee +0 -33
  65. data/app/assets/javascripts/rocket_job_mission_control/dirmon_entries.js.coffee +0 -13
  66. data/app/assets/javascripts/rocket_job_mission_control/selectize.js.coffee +0 -5
  67. data/app/assets/stylesheets/rocket_job_mission_control/jquery.bootstrap-touchspin.scss +0 -45
  68. data/app/controllers/rocket_job_mission_control/dirmon_entries/index_filters_controller.rb +0 -45
  69. data/app/controllers/rocket_job_mission_control/jobs/failures_controller.rb +0 -30
  70. data/app/controllers/rocket_job_mission_control/jobs/index_filters_controller.rb +0 -90
  71. data/app/controllers/rocket_job_mission_control/servers/index_filters_controller.rb +0 -49
  72. data/app/datatables/rocket_job_mission_control/completed_jobs_datatable.rb +0 -27
  73. data/app/datatables/rocket_job_mission_control/interrupted_jobs_datatable.rb +0 -26
  74. data/app/datatables/rocket_job_mission_control/queued_jobs_datatable.rb +0 -23
  75. data/app/datatables/rocket_job_mission_control/running_jobs_datatable.rb +0 -47
  76. data/app/datatables/rocket_job_mission_control/scheduled_jobs_datatable.rb +0 -31
  77. data/app/models/job_failures.rb +0 -20
  78. data/app/models/job_sanitizer.rb +0 -17
  79. data/app/views/layouts/rocket_job_mission_control/application.html.haml +0 -45
  80. data/app/views/layouts/rocket_job_mission_control/partials/_header.html.haml +0 -32
  81. data/app/views/layouts/rocket_job_mission_control/partials/_sidebar.html.haml +0 -11
  82. data/app/views/rocket_job_mission_control/active_workers/index.html.haml +0 -24
  83. data/app/views/rocket_job_mission_control/dirmon_entries/_form.html.haml +0 -37
  84. data/app/views/rocket_job_mission_control/dirmon_entries/_properties.html.haml +0 -30
  85. data/app/views/rocket_job_mission_control/dirmon_entries/_sidebar.html.haml +0 -27
  86. data/app/views/rocket_job_mission_control/dirmon_entries/_status.html.haml +0 -23
  87. data/app/views/rocket_job_mission_control/dirmon_entries/edit.html.haml +0 -4
  88. data/app/views/rocket_job_mission_control/dirmon_entries/index.html.haml +0 -18
  89. data/app/views/rocket_job_mission_control/dirmon_entries/index_filters/disabled.html.haml +0 -17
  90. data/app/views/rocket_job_mission_control/dirmon_entries/index_filters/enabled.html.haml +0 -17
  91. data/app/views/rocket_job_mission_control/dirmon_entries/index_filters/failed.html.haml +0 -17
  92. data/app/views/rocket_job_mission_control/dirmon_entries/index_filters/pending.html.haml +0 -17
  93. data/app/views/rocket_job_mission_control/dirmon_entries/new.html.haml +0 -6
  94. data/app/views/rocket_job_mission_control/dirmon_entries/show.html.haml +0 -23
  95. data/app/views/rocket_job_mission_control/jobs/_sidebar.html.haml +0 -28
  96. data/app/views/rocket_job_mission_control/jobs/_status.html.haml +0 -45
  97. data/app/views/rocket_job_mission_control/jobs/edit.html.haml +0 -34
  98. data/app/views/rocket_job_mission_control/jobs/exceptions.html.haml +0 -29
  99. data/app/views/rocket_job_mission_control/jobs/failures/_pagination.html.haml +0 -16
  100. data/app/views/rocket_job_mission_control/jobs/failures/index.html.haml +0 -32
  101. data/app/views/rocket_job_mission_control/jobs/index.html.haml +0 -25
  102. data/app/views/rocket_job_mission_control/jobs/index_filters/aborted.html.haml +0 -23
  103. data/app/views/rocket_job_mission_control/jobs/index_filters/completed.html.haml +0 -24
  104. data/app/views/rocket_job_mission_control/jobs/index_filters/failed.html.haml +0 -23
  105. data/app/views/rocket_job_mission_control/jobs/index_filters/paused.html.haml +0 -23
  106. data/app/views/rocket_job_mission_control/jobs/index_filters/queued.html.haml +0 -24
  107. data/app/views/rocket_job_mission_control/jobs/index_filters/running.html.haml +0 -25
  108. data/app/views/rocket_job_mission_control/jobs/index_filters/scheduled.html.haml +0 -24
  109. data/app/views/rocket_job_mission_control/jobs/show.html.haml +0 -51
  110. data/app/views/rocket_job_mission_control/servers/_actions.html.haml +0 -9
  111. data/app/views/rocket_job_mission_control/servers/_sidebar.html.haml +0 -20
  112. data/app/views/rocket_job_mission_control/servers/index.html.haml +0 -37
  113. data/app/views/rocket_job_mission_control/servers/index_filters/paused.html.haml +0 -37
  114. data/app/views/rocket_job_mission_control/servers/index_filters/running.html.haml +0 -37
  115. data/app/views/rocket_job_mission_control/servers/index_filters/starting.html.haml +0 -37
  116. data/app/views/rocket_job_mission_control/servers/index_filters/stopping.html.haml +0 -37
  117. data/spec/controllers/application_controller_spec.rb +0 -47
  118. data/spec/controllers/dirmon_entries/index_filters_controller_spec.rb +0 -77
  119. data/spec/controllers/dirmon_entries_controller_spec.rb +0 -383
  120. data/spec/controllers/jobs/failures_controller_spec.rb +0 -82
  121. data/spec/controllers/jobs/index_filters_controller_spec.rb +0 -66
  122. data/spec/controllers/jobs_controller_spec.rb +0 -172
  123. data/spec/controllers/workers/index_filters_controller_spec.rb +0 -59
  124. data/spec/controllers/workers_controller_spec.rb +0 -125
  125. data/spec/dummy/Rakefile +0 -7
  126. data/spec/dummy/config.ru +0 -4
  127. data/spec/dummy/config/application.rb +0 -26
  128. data/spec/dummy/config/boot.rb +0 -5
  129. data/spec/dummy/config/database.yml +0 -25
  130. data/spec/dummy/config/environment.rb +0 -5
  131. data/spec/dummy/config/environments/test.rb +0 -37
  132. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  133. data/spec/dummy/config/initializers/session_store.rb +0 -3
  134. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  135. data/spec/dummy/config/mongoid.yml +0 -88
  136. data/spec/dummy/config/routes.rb +0 -3
  137. data/spec/dummy/config/secrets.yml +0 -22
  138. data/spec/dummy/config/symmetric-encryption.yml +0 -8
  139. data/spec/dummy/db/test.sqlite3 +0 -0
  140. data/spec/dummy/log/development.log +0 -0
  141. data/spec/dummy/log/test.log +0 -118933
  142. data/spec/helpers/application_helper_spec.rb +0 -58
  143. data/spec/helpers/jobs_helper_spec.rb +0 -35
  144. data/spec/helpers/pagination_helper_spec.rb +0 -21
  145. data/spec/helpers/servers_helper_spec.rb +0 -16
  146. data/spec/helpers/slices_helper_spec.rb +0 -33
  147. data/spec/models/job_failures_spec.rb +0 -14
  148. data/spec/models/job_sanitizer_spec.rb +0 -16
  149. data/spec/rails_helper.rb +0 -47
  150. data/spec/spec_helper.rb +0 -84
  151. data/vendor/assets/javascripts/jquery.bootstrap-touchspin.js +0 -686
  152. data/vendor/assets/javascripts/prism.js +0 -6
  153. data/vendor/assets/stylesheets/jquery.bootstrap-touchspin.css +0 -45
  154. data/vendor/assets/stylesheets/prism.scss +0 -160
@@ -0,0 +1,38 @@
1
+ <ul class="nav hidden-xs" id="lg-menu">
2
+ <li>
3
+ <%= link_to(new_dirmon_entry_path) do %>
4
+ <i class="fa fa-plus"></i>Create
5
+ <% end %>
6
+ <%= link_to(dirmon_entries_path) do %>
7
+ <i class="fa fa-list"></i>All
8
+ <% end %>
9
+ </li>
10
+ <% RocketJob::DirmonEntry.aasm.states.map { |s| s.name.to_s }.each do |state| %>
11
+ <li class="<%= state %>">
12
+ <%= link_to("#{state}_dirmon_entries".to_sym) do %>
13
+ <i class="fa <%= state_icon(state) %>"></i> <%= state.capitalize %> (<%= dirmon_counts_by_state(state) %>)
14
+ <% end %>
15
+ </li>
16
+ <% end %>
17
+ </ul>
18
+
19
+ <!-- tiny only nav -->
20
+
21
+ <ul class="nav visible-xs" id="xs-menu">
22
+ <li>
23
+ <%= link_to(new_dirmon_entry_path) do %>
24
+ <i class="fa fa-plus"></i>
25
+ <% end %>
26
+ <%= link_to(dirmon_entries_path) do %>
27
+ <i class="fa fa-list"></i>
28
+ <% end %>
29
+ </li>
30
+ <% RocketJob::DirmonEntry.aasm.states.map { |s| s.name.to_s }.each do |state| %>
31
+ <li class="<%= state %>">
32
+ <%= link_to("#{state}_dirmon_entries".to_sym) do %>
33
+ <i class="fa <%= state_icon(state) %>"></i>
34
+ <% end %>
35
+ </li>
36
+ <% end %>
37
+ </ul>
38
+
@@ -0,0 +1,17 @@
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>
7
+ <% @dirmon_entry.properties.each_pair do |name, value| %>
8
+ <div class="parameters">
9
+ <label><%= name.to_s.titleize %>:</label>
10
+ <% if value.is_a?(Array) || value.is_a?(Hash) %>
11
+ <pre><code><%= pretty_print_array_or_hash(value) %></code></pre>
12
+ <% else %>
13
+ <%= value %>
14
+ <% end %>
15
+ </div>
16
+ <% end %>
17
+ <div class="id"><label>ID:</label><%= @dirmon_entry.id %></div>
@@ -0,0 +1,4 @@
1
+ <div class="container-fluid">
2
+ <div class="lead">Edit Dirmon Entry</div>
3
+ <%= render partial: 'form', locals: {action: :update} %>
4
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="dirmon-list">
2
+ <div class="list">
3
+ <div class="row">
4
+ <div class="col-sm-10">
5
+ <h2><%= @description %> Dirmon Entries</h2>
6
+ </div>
7
+ <div class="col-sm-2">
8
+ <div class="btn btn-default pull-right dt-reload" data-behavior="reload">
9
+ <i class="fa fa-refresh"></i>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ <table class='table datatable dirmon-datatable' data-source='<%= @data_table_url %>' style='width: 100%'>
14
+ <thead>
15
+ <tr>
16
+ <th>Name</th>
17
+ <th>Job Class</th>
18
+ <th>Pattern</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody></tbody>
22
+ </table>
23
+ </div>
24
+ </div>
25
+
26
+ <script>
27
+ jQuery(function () {
28
+ new RjmcDatatable(
29
+ $(".dirmon-datatable"),
30
+ [{data: '0'}, {data: '1'}, {data: '2'}]
31
+ );
32
+ });
33
+ </script>
@@ -0,0 +1,8 @@
1
+ <div class="container-fluid">
2
+ <div class="row">
3
+ <div class="col-xm-14">
4
+ <div class="lead">New Dirmon Entry</div>
5
+ <%= render partial: 'form' %>
6
+ </div>
7
+ </div>
8
+ </div>
@@ -0,0 +1,29 @@
1
+ <div class="col-md-12 job-status">
2
+ <div id="job">
3
+ <div class="lead"><%= @dirmon_entry.job_class_name %></div>
4
+ <div class="job-state inline-block">
5
+ <div class="left">status</div>
6
+ <div class="<%= @dirmon_entry.state %> right"><%= @dirmon_entry.state %></div>
7
+ </div>
8
+ <div class="btn-toolbar job-actions pull-right">
9
+ <div class="btn-group">
10
+ <% if @dirmon_entry.disabled? || @dirmon_entry.pending? %>
11
+ <%= link_to "Enable", enable_dirmon_entry_path(@dirmon_entry.id), method: :put, class: "btn btn-default" %>
12
+ <% end %>
13
+ <% if @dirmon_entry.enabled? %>
14
+ <%= link_to "Disable", disable_dirmon_entry_path(@dirmon_entry.id), method: :put, class: "btn btn-default", :data => {:confirm => 'Are you sure?'} %>
15
+ <% end %>
16
+ </div>
17
+
18
+ <div class="btn-group">
19
+ <%= link_to "Destroy", dirmon_entry_path(@dirmon_entry), method: :delete, class: 'btn btn-default', :data => {:confirm => 'Are you sure?'} %>
20
+ </div>
21
+
22
+ <div class="btn-group">
23
+ <%= link_to "Edit", edit_dirmon_entry_path(@dirmon_entry), class: "btn btn-default" %>
24
+ </div>
25
+ </div>
26
+ <div class="clearfix"></div>
27
+ <%= render partial: 'status', locals: {dirmon_entry: @job} %>
28
+ </div>
29
+ </div>
@@ -0,0 +1,26 @@
1
+ <%
2
+ previous_offset = [0, pagination[:offset].pred].max
3
+ next_offset = [pagination[:total], pagination[:offset].next].min
4
+ %>
5
+ <ul class="pagination">
6
+ <li>
7
+ <%= link_to(exception_job_path(error_type: error_type, offset: 0), class: "btn btn-default #{page_nav_disabled_class(pagination[:offset], 0)}", title: 'First') do %>
8
+ <i class="fa fa-angle-double-left"></i>
9
+ <% end %>
10
+ </li>
11
+ <li>
12
+ <%= link_to(exception_job_path(error_type: error_type, offset: previous_offset), class: "btn btn-default #{page_nav_disabled_class(pagination[:offset], 0)}", title: 'Previous') do %>
13
+ <i class="fa fa-angle-left"></i>
14
+ <% end %>
15
+ </li>
16
+ <li>
17
+ <%= link_to(exception_job_path(error_type: error_type, offset: next_offset), class: "btn btn-default #{page_nav_disabled_class(pagination[:offset], pagination[:total])}", title: 'Next') do %>
18
+ <i class="fa fa-angle-right"></i>
19
+ <% end %>
20
+ </li>
21
+ <li>
22
+ <%= link_to(exception_job_path(error_type: error_type, offset: pagination[:total]), class: "btn btn-default #{page_nav_disabled_class(pagination[:offset], pagination[:total])}", title: 'Last') do %>
23
+ <i class="fa fa-angle-double-right"></i>
24
+ <% end %>
25
+ </li>
26
+ </ul>
@@ -0,0 +1,32 @@
1
+ <ul class="nav hidden-xs" id="lg-menu">
2
+ <li class="active">
3
+ <%= link_to(jobs_path) do %>
4
+ <i class="fa fa-list"></i>All
5
+ <% end %>
6
+ </li>
7
+ <% job_states_with_scheduled.each do |state| %>
8
+ <li class="<%= state %>">
9
+ <%= link_to("#{state}_jobs".to_sym) do %>
10
+ <i class="fa <%= state_icon(state) %>"></i> <%= state.capitalize %> (<%= job_counts_by_state(state) %>)
11
+ <% end %>
12
+ </li>
13
+ <% end %>
14
+ </ul>
15
+
16
+ <!-- tiny only nav -->
17
+
18
+ <ul class="nav visible-xs" id="xs-menu">
19
+ <li>
20
+ <%= link_to(jobs_path) do %>
21
+ <i class="fa fa-list"></i>
22
+ <% end %>
23
+ </li>
24
+ <% job_states_with_scheduled.each do |state| %>
25
+ <li class="<%= state %>">
26
+ <%= link_to("#{state}_jobs".to_sym) do %>
27
+ <i class="fa <%= state_icon(state) %>"></i>
28
+ <% end %>
29
+ </li>
30
+ <% end %>
31
+ </ul>
32
+
@@ -0,0 +1,42 @@
1
+ <% status = job.status(Time.zone) %>
2
+ <div class="id"><label>ID:</label><%= status.delete('_id') %></div>
3
+
4
+ <% if description = status.delete('description') %>
5
+ <div class="status-message"><label>Description:</label><%= description %></div>
6
+ <% end %>
7
+ <% if duration = status.delete('duration') %>
8
+ <div class="status-message"><label>Duration:</label><%= duration %></div>
9
+ <% end %>
10
+ <% if record_count = status.delete('record_count') %>
11
+ <div class="status-message"><label>Record Count:</label><%= record_count %></div>
12
+ <% end %>
13
+
14
+ <div class="created_at"><label>Created At:</label><%= status.delete('created_at') %></div>
15
+
16
+ <% if started_at = status.delete('started_at') %>
17
+ <div class="status-message"><label>Started At:</label><%= started_at %></div>
18
+ <% end %>
19
+ <% if percent_complete = status.delete('percent_complete') %>
20
+ <div class="status-message"><label>% Complete:</label><%= percent_complete %></div>
21
+ <% end %>
22
+
23
+ <%
24
+ remaining = {}
25
+ status.each_pair do |key, value|
26
+ next if value.blank? || ['state', '_type', 'sub_state'].include?(key)
27
+ if value.kind_of?(Hash) || value.kind_of?(Array)
28
+ remaining[key] = value
29
+ next
30
+ end
31
+ %>
32
+ <div class="status-message"><label><%= key.to_s.titleize %>:</label><%= value %></div>
33
+ <% end %>
34
+
35
+ <div class="clearfix"></div>
36
+
37
+ <% remaining.each_pair do |key, value| %>
38
+ <div class="status-message">
39
+ <label><%= key.to_s.titleize %>:</label>
40
+ <pre><code><%= pretty_print_array_or_hash(value) %></code></pre>
41
+ </div>
42
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <div class="container-fluid">
2
+ <div class="lead">Edit <%= @job._type %></div>
3
+ <% if @job.errors.present? %>
4
+ <div class="alert alert-alert">
5
+ Failed to save the changes!
6
+ <% @job.errors.messages.each_pair do |field, message| %>
7
+ <div class="message"><%= field.to_s.humanize %> is not valid: <%= message.join(', ') %></div>
8
+ <% end %>
9
+ </div>
10
+ <% end %>
11
+ <%= form_for(@job, as: :job, url: job_path(@job)) do |f| %>
12
+ <div class="row">
13
+ <div class="arguments">
14
+ <div class="job_arguments form-group"></div>
15
+ <div class="form-group">
16
+ <% @job.class.user_editable_fields.each do |property_name| %>
17
+ <%= f.label property_name.to_s %>
18
+ <%= editable_field_html(@job.class, property_name, @job.send(property_name), f) %>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <div class="row">
24
+ <div class="col-md-12">
25
+ <div class="buttons">
26
+ <%= f.submit 'Save', class: 'btn btn-primary' %>
27
+ <%= link_to 'Cancel', :back, class: 'btn btn-default' %>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ <% end %>
32
+ </div>
@@ -0,0 +1,19 @@
1
+ <div class="row">
2
+ <div class="col-md-8">
3
+ <div class="job-status">
4
+ <div class="failures">
5
+ <div class="lead"><%= link_to(@job.class.name, job_path(@job)) %>: <%= @failure_exception.class_name %></div>
6
+ <div class="pagination-buttons pull-right">
7
+ <%= render partial: 'pagination', locals: {error_type: @failure_exception.class_name, pagination: @pagination} %>
8
+ </div>
9
+ <div class="clearfix"></div>
10
+ <div class="message">
11
+ <pre><code><%= @failure_exception.message %></code></pre>
12
+ </div>
13
+ <div class="error">
14
+ <pre class="small"><%= @failure_exception.backtrace.join("\n") %></pre>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
@@ -0,0 +1,40 @@
1
+ <div class="job-list">
2
+ <div class="list">
3
+ <div class="row">
4
+ <div class="col-sm-10">
5
+ <h2>Exceptions for <%= @job.class.name %></h2>
6
+ <%= link_to(@job.class.name, job_path(@job)) %>
7
+ <%= h(@job.description) %>
8
+ </div>
9
+ <div class="col-sm-2">
10
+ <div class="btn btn-default pull-right dt-reload" data-behavior="reload">
11
+ <i class="fa fa-refresh"></i>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <table class='table datatable jobs-datatable' data-source='<%= jobs_url(format: 'json') %>' style='width: 100%'>
16
+ <thead>
17
+ <tr>
18
+ <th>Count</th>
19
+ <th>Exception Class</th>
20
+ <th>Exception Messages</th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <% @exceptions.each do |exception| %>
25
+ <tr>
26
+ <th><%= exception.count %></th>
27
+ <th>
28
+ <%= link_to(exception.class_name, exception_job_path(@job, error_type: exception.class_name), class: "card callout") %>
29
+ </th>
30
+ <th>
31
+ <% exception.messages.each do |message| %>
32
+ <div><%= message %></div>
33
+ <% end %>
34
+ </th>
35
+ </tr>
36
+ <% end %>
37
+ </tbody>
38
+ </table>
39
+ </div>
40
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="job-list">
2
+ <div class="list">
3
+ <div class="row">
4
+ <div class="col-sm-10">
5
+ <h2><%= @description %> Jobs</h2>
6
+ </div>
7
+ <div class="col-sm-2">
8
+ <div class="btn btn-default pull-right dt-reload" data-behavior="reload">
9
+ <i class="fa fa-refresh"></i>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ <table class='table datatable jobs-datatable' data-source='<%= @data_table_url %>' style='width: 100%'>
14
+ <thead>
15
+ <tr>
16
+ <% @columns.each do |column| %>
17
+ <th><%= column[:display] %></th>
18
+ <% end %>
19
+ </tr>
20
+ </thead>
21
+ <tbody></tbody>
22
+ </table>
23
+ </div>
24
+ </div>
25
+
26
+ <script>
27
+ jQuery(function () {
28
+ new RjmcDatatable(
29
+ $(".jobs-datatable"),
30
+ <%= @table_layout.to_json.html_safe %>
31
+ );
32
+ });
33
+ </script>
@@ -0,0 +1,68 @@
1
+ <div class="row">
2
+ <div class="col-md-14 col-md-offset-1 job-status">
3
+ <div id="job">
4
+ <div class="lead"><%= @job.class.name %></div>
5
+ <div class="job-state inline-block">
6
+ <div class="left">State</div>
7
+ <div class="<%= @job.state %> right"><%= @job.state %></div>
8
+ </div>
9
+
10
+ <% if sub_state = @job['sub_state'] %>
11
+ <div class="job-state inline-block">
12
+ <div class="left">Batch</div>
13
+ <div class="running right"><%= @job.sub_state %></div>
14
+ </div>
15
+ <% end %>
16
+
17
+ <div class="btn-toolbar job-actions pull-right">
18
+ <% if @job.respond_to?(:input) && @job.input.failed.count > 0 %>
19
+ <div class="btn-group">
20
+ <%= link_to('Show Exceptions', exceptions_job_path(@job), class: 'btn btn-default') %>
21
+ </div>
22
+ <% end %>
23
+
24
+ <% if @job.scheduled? %>
25
+ <div class="btn-group">
26
+ <%= job_action_link('Run', rocket_job_mission_control.run_now_job_path(@job), :patch) %>
27
+ </div>
28
+ <% end %>
29
+
30
+ <div class="btn-group">
31
+ <% valid_events = @job.aasm.events.collect { |e| e.name } %>
32
+ <% if valid_events.include?(:pause) %>
33
+ <%= job_action_link('Pause', rocket_job_mission_control.pause_job_path(@job), :patch) %>
34
+ <% end %>
35
+
36
+ <% if valid_events.include?(:resume) %>
37
+ <%= job_action_link('Resume', rocket_job_mission_control.resume_job_path(@job), :patch) %>
38
+ <% end %>
39
+
40
+ <% if valid_events.include?(:retry) %>
41
+ <%= job_action_link('Retry', rocket_job_mission_control.retry_job_path(@job), :patch) %>
42
+ <% end %>
43
+ </div>
44
+
45
+ <div class="btn-group">
46
+ <% if valid_events.include?(:fail) %>
47
+ <%= job_action_link('Fail', rocket_job_mission_control.fail_job_path(@job), :patch) %>
48
+ <% end %>
49
+
50
+ <% if valid_events.include?(:abort) %>
51
+ <%= job_action_link('Abort', rocket_job_mission_control.abort_job_path(@job), :patch) %>
52
+ <% end %>
53
+
54
+ <%= job_action_link('Destroy', rocket_job_mission_control.job_path(@job), :delete) %>
55
+ </div>
56
+
57
+ <% unless @job.completed? || @job.aborted? %>
58
+ <div class="btn-group">
59
+ <%= link_to "Edit", edit_job_path(@job), class: "btn btn-default" %>
60
+ </div>
61
+ <% end %>
62
+ </div>
63
+ <div class="col-md-12">
64
+ <%= render partial: 'status', locals: {job: @job} %>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </div>
@@ -0,0 +1,31 @@
1
+ <ul class="nav hidden-xs" id="lg-menu">
2
+ <li>
3
+ <%= link_to(servers_path) do %>
4
+ <i class="fa fa-list"></i>All
5
+ <% end %>
6
+ </li>
7
+ <% @states.each do |state| %>
8
+ <li class="#{state}">
9
+ <%= link_to("#{state}_servers".to_sym) do %>
10
+ <i class="fa <%= state_icon(state) %>"></i> <%= state.capitalize%> (<%= server_counts_by_state(state)%>)
11
+ <% end %>
12
+ </li>
13
+ <% end %>
14
+ </ul>
15
+
16
+ <!-- tiny only nav -->
17
+
18
+ <ul class="nav visible-xs" id="xs-menu">
19
+ <li>
20
+ <%= link_to(servers_path) do %>
21
+ <i class="fa fa-list"></i>
22
+ <% end %>
23
+ </li>
24
+ <% @states.each do |state| %>
25
+ <li class="#{state}">
26
+ <%= link_to("#{state}_servers".to_sym) do %>
27
+ <i class="fa <%= state_icon(state) %>"></i>
28
+ <% end %>
29
+ </li>
30
+ <% end %>
31
+ </ul>